fs/pipe.c: local vars have to match types of proper pipe_inode_info fields
authorAndrei Vagin <avagin@gmail.com>
Wed, 16 Feb 2022 04:32:01 +0000 (15:32 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 17 Feb 2022 03:46:55 +0000 (14:46 +1100)
commitd4ff19f718ec57301bd4cd438359a04d4daad124
treebbd1140e858fcbdf8e97770bf9aff4613125281c
parenteb5ec433aabde7580bcde0cb4c73152cf0f5dbe9
fs/pipe.c: local vars have to match types of proper pipe_inode_info fields

head, tail, ring_size are declared as unsigned int, so all local variables
that operate with these fields have to be unsigned to avoid signed integer
overflow.

Right now, it isn't an issue because the maximum pipe size is limited by
1U<<31.

Link: https://lkml.kernel.org/r/20220106171946.36128-1-avagin@gmail.com
Signed-off-by: Andrei Vagin <avagin@gmail.com>
Suggested-by: Dmitry Safonov <0x7f454c46@gmail.com>
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
fs/pipe.c