* + seq_file-fix-passing-wrong-private-data.patch added to -mm tree
@ 2021-10-29 22:17 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2021-10-29 22:17 UTC (permalink / raw)
To: adobriyan, andriy.shevchenko, christian.brauner, mm-commits,
revest, sfr, songmuchun
The patch titled
Subject: seq_file: fix passing wrong private data
has been added to the -mm tree. Its filename is
seq_file-fix-passing-wrong-private-data.patch
This patch should soon appear at
https://ozlabs.org/~akpm/mmots/broken-out/seq_file-fix-passing-wrong-private-data.patch
and later at
https://ozlabs.org/~akpm/mmotm/broken-out/seq_file-fix-passing-wrong-private-data.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: Muchun Song <songmuchun@bytedance.com>
Subject: seq_file: fix passing wrong private data
DEFINE_PROC_SHOW_ATTRIBUTE() is supposed to be used to define a series
of functions and variables to register proc file easily. And the users
can use proc_create_data() to pass their own private data and get it
via seq->private in the callback. Unfortunately, the proc file system
use PDE_DATA() to get private data instead of inode->i_private. So fix
it. Fortunately, there only one user of it which does not pass any
private data, so this bug does not break any in-tree codes.
Link: https://lkml.kernel.org/r/20211029032638.84884-1-songmuchun@bytedance.com
Fixes: 97a32539b956 ("proc: convert everything to "struct proc_ops"")
Signed-off-by: Muchun Song <songmuchun@bytedance.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Florent Revest <revest@chromium.org>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
include/linux/seq_file.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/include/linux/seq_file.h~seq_file-fix-passing-wrong-private-data
+++ a/include/linux/seq_file.h
@@ -209,7 +209,7 @@ static const struct file_operations __na
#define DEFINE_PROC_SHOW_ATTRIBUTE(__name) \
static int __name ## _open(struct inode *inode, struct file *file) \
{ \
- return single_open(file, __name ## _show, inode->i_private); \
+ return single_open(file, __name ## _show, PDE_DATA(inode)); \
} \
\
static const struct proc_ops __name ## _proc_ops = { \
_
Patches currently in -mm which might be from songmuchun@bytedance.com are
mm-list_lru-remove-holding-lru-lock.patch
mm-list_lru-fix-the-return-value-of-list_lru_count_one.patch
mm-memcontrol-remove-kmemcg_id-reparenting.patch
mm-memcontrol-remove-the-kmem-states.patch
mm-list_lru-only-add-memcg-aware-lrus-to-the-global-lru-list.patch
seq_file-fix-passing-wrong-private-data.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-10-29 22:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-29 22:17 + seq_file-fix-passing-wrong-private-data.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).