]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
fs/pipe: Limit the slots in pipe_resize_ring()
authorK Prateek Nayak <kprateek.nayak@amd.com>
Fri, 7 Mar 2025 05:29:16 +0000 (05:29 +0000)
committerChristian Brauner <brauner@kernel.org>
Mon, 10 Mar 2025 07:55:05 +0000 (08:55 +0100)
commitcf3d0c54b21c4a351d4f94cf188e9715dbd1ef5b
tree3d4a2fe9c20d3ed3e3000925f499cd7f6987887e
parent00a7d39898c8010bfd5ff62af31ca5db34421b38
fs/pipe: Limit the slots in pipe_resize_ring()

Limit the number of slots in pipe_resize_ring() to the maximum value
representable by pipe->{head,tail}. Values beyond the max limit can
lead to incorrect pipe occupancy related calculations where the pipe
will never appear full.

Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: K Prateek Nayak <kprateek.nayak@amd.com>
Link: https://lore.kernel.org/r/20250307052919.34542-2-kprateek.nayak@amd.com
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/pipe.c