diff options
| author | Jens Axboe <[email protected]> | 2025-08-08 12:35:14 +0000 |
|---|---|---|
| committer | Jens Axboe <[email protected]> | 2025-08-08 12:35:14 +0000 |
| commit | 33503c083fda048c77903460ac0429e1e2c0e341 (patch) | |
| tree | 161b8c3a6de755f59ffb92b4120037d34ab8948e /net/core/dev_api.c | |
| parent | io_uring/net: Allow to do vectorized send (diff) | |
| download | kernel-33503c083fda048c77903460ac0429e1e2c0e341.tar.gz kernel-33503c083fda048c77903460ac0429e1e2c0e341.zip | |
io_uring/memmap: cast nr_pages to size_t before shifting
If the allocated size exceeds UINT_MAX, then it's necessary to cast
the mr->nr_pages value to size_t to prevent it from overflowing. In
practice this isn't much of a concern as the required memory size will
have been validated upfront, and accounted to the user. And > 4GB sizes
will be necessary to make the lack of a cast a problem, which greatly
exceeds normal user locked_vm settings that are generally in the kb to
mb range. However, if root is used, then accounting isn't done, and
then it's possible to hit this issue.
Link: https://lore.kernel.org/all/[email protected]/
Cc: [email protected]
Reported-by: [email protected]
Fixes: 087f997870a9 ("io_uring/memmap: implement mmap for regions")
Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'net/core/dev_api.c')
0 files changed, 0 insertions, 0 deletions
