The patch titled Subject: fs/proc/proc_sysctl.c: fix potential page fault while unregistering sysctl table has been added to the -mm tree. Its filename is fs-sysctl-fix-potential-page-fault-while-unregistering-sysctl-table.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/fs-sysctl-fix-potential-page-fault-while-unregistering-sysctl-table.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/fs-sysctl-fix-potential-page-fault-while-unregistering-sysctl-table.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/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Danilo Krummrich <danilokrummrich@xxxxxxxxxxxxx> Subject: fs/proc/proc_sysctl.c: fix potential page fault while unregistering sysctl table proc_sys_link_fill_cache() does not take currently unregistering sysctl tables into account, which might result into a page fault in sysctl_follow_link() - add a check to fix it. This bug has been present since v3.4. Link: http://lkml.kernel.org/r/20180228013506.4915-1-danilokrummrich@xxxxxxxxxxxxx Fixes: 0e47c99d7fe25 ("sysctl: Replace root_list with links between sysctl_table_sets") Signed-off-by: Danilo Krummrich <danilokrummrich@xxxxxxxxxxxxx> Acked-by: Kees Cook <keescook@xxxxxxxxxxxx> Cc: "Luis R . Rodriguez" <mcgrof@xxxxxxxxxx> Cc: "Eric W. Biederman" <ebiederm@xxxxxxxxxxxx> Cc: Alexey Dobriyan <adobriyan@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/proc/proc_sysctl.c | 3 +++ 1 file changed, 3 insertions(+) diff -puN fs/proc/proc_sysctl.c~fs-sysctl-fix-potential-page-fault-while-unregistering-sysctl-table fs/proc/proc_sysctl.c --- a/fs/proc/proc_sysctl.c~fs-sysctl-fix-potential-page-fault-while-unregistering-sysctl-table +++ a/fs/proc/proc_sysctl.c @@ -707,7 +707,10 @@ static bool proc_sys_link_fill_cache(str struct ctl_table *table) { bool ret = true; + head = sysctl_head_grab(head); + if (IS_ERR(head)) + return false; if (S_ISLNK(table->mode)) { /* It is not an error if we can not follow the link ignore it */ _ Patches currently in -mm which might be from danilokrummrich@xxxxxxxxxxxxx are fs-sysctl-fix-potential-page-fault-while-unregistering-sysctl-table.patch fs-sysctl-remove-redundant-link-check-in-proc_sys_link_fill_cache.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