mm-commits.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* + fs-pipe-local-vars-has-to-match-types-of-proper-pipe_inode_info-fields.patch added to -mm tree
@ 2022-01-27  2:38 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2022-01-27  2:38 UTC (permalink / raw)
  To: 0x7f454c46, avagin, mm-commits


The patch titled
     Subject: fs/pipe.c: local vars have to match types of proper pipe_inode_info fields
has been added to the -mm tree.  Its filename is
     fs-pipe-local-vars-has-to-match-types-of-proper-pipe_inode_info-fields.patch

This patch should soon appear at
    https://ozlabs.org/~akpm/mmots/broken-out/fs-pipe-local-vars-has-to-match-types-of-proper-pipe_inode_info-fields.patch
and later at
    https://ozlabs.org/~akpm/mmotm/broken-out/fs-pipe-local-vars-has-to-match-types-of-proper-pipe_inode_info-fields.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Andrei Vagin <avagin@gmail.com>
Subject: 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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 fs/pipe.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/fs/pipe.c~fs-pipe-local-vars-has-to-match-types-of-proper-pipe_inode_info-fields
+++ a/fs/pipe.c
@@ -606,7 +606,7 @@ out:
 static long pipe_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
 {
 	struct pipe_inode_info *pipe = filp->private_data;
-	int count, head, tail, mask;
+	unsigned int count, head, tail, mask;
 
 	switch (cmd) {
 	case FIONREAD:
@@ -828,7 +828,7 @@ out_free_uid:
 
 void free_pipe_info(struct pipe_inode_info *pipe)
 {
-	int i;
+	unsigned int i;
 
 #ifdef CONFIG_WATCH_QUEUE
 	if (pipe->watch_queue) {
_

Patches currently in -mm which might be from avagin@gmail.com are

fs-pipe-use-kvcalloc-to-allocate-a-pipe_buffer-array.patch
fs-pipe-local-vars-has-to-match-types-of-proper-pipe_inode_info-fields.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-27  2:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-27  2:38 + fs-pipe-local-vars-has-to-match-types-of-proper-pipe_inode_info-fields.patch added to -mm tree akpm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).