The patch titled Subject: coda: avoid NULL pointer dereference from a bad inode has been added to the -mm tree. Its filename is coda-avoid-null-pointer-dereference-from-a-bad-inode.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/broken-out/coda-avoid-null-pointer-dereference-from-a-bad-inode.patch and later at https://ozlabs.org/~akpm/mmotm/broken-out/coda-avoid-null-pointer-dereference-from-a-bad-inode.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: Jan Harkes <jaharkes@xxxxxxxxxx> Subject: coda: avoid NULL pointer dereference from a bad inode Patch series "Coda updates for -next". The following patch series contains some fixes for the Coda kernel module I've had sitting around and were tested extensively in a development version of the Coda kernel module that lives outside of the main kernel. This patch (of 9): Avoid accessing coda_inode_info from a dentry with a bad inode. Link: https://lkml.kernel.org/r/20210908140308.18491-1-jaharkes@xxxxxxxxxx Link: https://lkml.kernel.org/r/20210908140308.18491-2-jaharkes@xxxxxxxxxx Signed-off-by: Jan Harkes <jaharkes@xxxxxxxxxx> Cc: Alex Shi <alex.shi@xxxxxxxxxxxxxxxxx> Cc: Jing Yangyang <jing.yangyang@xxxxxxxxxx> Cc: Xin Tan <tanxin.ctf@xxxxxxxxx> Cc: Xiyu Yang <xiyuyang19@xxxxxxxxxxxx> Cc: Zeal Robot <zealci@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/coda/dir.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) --- a/fs/coda/dir.c~coda-avoid-null-pointer-dereference-from-a-bad-inode +++ a/fs/coda/dir.c @@ -499,15 +499,20 @@ out: */ static int coda_dentry_delete(const struct dentry * dentry) { - int flags; + struct inode *inode; + struct coda_inode_info *cii; if (d_really_is_negative(dentry)) return 0; - flags = (ITOC(d_inode(dentry))->c_flags) & C_PURGE; - if (is_bad_inode(d_inode(dentry)) || flags) { + inode = d_inode(dentry); + if (!inode || is_bad_inode(inode)) return 1; - } + + cii = ITOC(inode); + if (cii->c_flags & C_PURGE) + return 1; + return 0; } _ Patches currently in -mm which might be from jaharkes@xxxxxxxxxx are coda-avoid-null-pointer-dereference-from-a-bad-inode.patch coda-check-for-async-upcall-request-using-local-state.patch coda-avoid-flagging-null-inodes.patch coda-avoid-hidden-code-duplication-in-rename.patch coda-avoid-doing-bad-things-on-inode-type-changes-during-revalidation.patch coda-bump-module-version-to-72.patch