+ vfs-simplify-seq_file-iteration-code-and-interface-fix.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: VFS: seq_file: ensure ->from is valid
has been added to the -mm tree.  Its filename is
     vfs-simplify-seq_file-iteration-code-and-interface-fix.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/vfs-simplify-seq_file-iteration-code-and-interface-fix.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/vfs-simplify-seq_file-iteration-code-and-interface-fix.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: NeilBrown <neilb@xxxxxxxx>
Subject: VFS: seq_file: ensure ->from is valid

Previous patch ("VFS: simplify seq_file iteration code and interface")
removed code to set ->from to zero when ->count is zero, as ->from is
dead at that time.  However it didn't ensure ->from was set properly
whenever ->count becomes non-zero.
This can only happen when ->show() is called.  Of the three places it
is called one already has ->from set to zero.  The other two are
fixed by setting from to zero after fully flushing the buffer (at which
point ->count will also be zero).

Link: http://lkml.kernel.org/r/87601ryb8a.fsf@xxxxxxxxxxxxxxxxxxxxxxxx
Signed-off-by: NeilBrown <neilb@xxxxxxxx>
Reported-by: Jann Horn <jannh@xxxxxxxxxx>
Cc: Alexander Viro <viro@xxxxxxxxxxxxxxxxxx>
Cc: Kees Cook <keescook@xxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 fs/seq_file.c |    1 +
 1 file changed, 1 insertion(+)

diff -puN fs/seq_file.c~vfs-simplify-seq_file-iteration-code-and-interface-fix fs/seq_file.c
--- a/fs/seq_file.c~vfs-simplify-seq_file-iteration-code-and-interface-fix
+++ a/fs/seq_file.c
@@ -220,6 +220,7 @@ ssize_t seq_read(struct file *file, char
 			goto Done;
 	}
 	/* we need at least one record in buffer */
+	m->from = 0;
 	p = m->op->start(m, &m->index);
 	while (1) {
 		err = PTR_ERR(p);
_

Patches currently in -mm which might be from neilb@xxxxxxxx are

vfs-discard-attr_attr_flag.patch
vfs-simplify-seq_file-iteration-code-and-interface.patch
vfs-simplify-seq_file-iteration-code-and-interface-fix.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux