]> 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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 May 2025 09:12:51 +0000 (11:12 +0200)
commitc8bad227f88e16a7fa151281fab349d8c1a9353b
treeae2a5bf331ab0a918204ec431d377ab8de23ce31
parent83a40402e0d1475929ea1861921beddb3762039e
fs/pipe: Limit the slots in pipe_resize_ring()

[ Upstream commit cf3d0c54b21c4a351d4f94cf188e9715dbd1ef5b ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/pipe.c