diff options
author | Jann Horn <jannh@google.com> | 2025-01-14 20:49:00 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-02-01 20:39:40 +0300 |
commit | efd96fbe23fa87de39116f632401f67b93be21ab (patch) | |
tree | 2abc6b87d1a039957c4fef5dcbf2d92647f3e1a1 /net/unix/sysctl_net_unix.c | |
parent | 5d114fa2b6508d89bcd96b8b0bc21a76c1d6dc1b (diff) | |
download | linux-efd96fbe23fa87de39116f632401f67b93be21ab.tar.xz |
io_uring/rsrc: require cloned buffers to share accounting contexts
Commit 19d340a2988d4f3e673cded9dde405d727d7e248 upstream.
When IORING_REGISTER_CLONE_BUFFERS is used to clone buffers from uring
instance A to uring instance B, where A and B use different MMs for
accounting, the accounting can go wrong:
If uring instance A is closed before uring instance B, the pinned memory
counters for uring instance B will be decremented, even though the pinned
memory was originally accounted through uring instance A; so the MM of
uring instance B can end up with negative locked memory.
Cc: stable@vger.kernel.org
Closes: https://lore.kernel.org/r/CAG48ez1zez4bdhmeGLEFxtbFADY4Czn3CV0u9d_TMcbvRA01bg@mail.gmail.com
Fixes: 7cc2a6eadcd7 ("io_uring: add IORING_REGISTER_COPY_BUFFERS method")
Signed-off-by: Jann Horn <jannh@google.com>
Link: https://lore.kernel.org/r/20250114-uring-check-accounting-v1-1-42e4145aa743@google.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/unix/sysctl_net_unix.c')
0 files changed, 0 insertions, 0 deletions