From: Christoph Fritz Date: Wed, 12 Jan 2022 18:33:21 +0000 (+0100) Subject: ovl: fix NULL pointer dereference in copy up warning X-Git-Tag: Ubuntu-5.15.0-23.23~1039 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=d14710d5ee95e4959e78c550f5e2e13ee7722a6c;p=mirror_ubuntu-jammy-kernel.git ovl: fix NULL pointer dereference in copy up warning BugLink: https://bugs.launchpad.net/bugs/1960509 commit 4ee7e4a6c9b298da44029ed9ec8ed23ae49cc209 upstream. This patch is fixing a NULL pointer dereference to get a recently introduced warning message working. Fixes: 5b0a414d06c3 ("ovl: fix filattr copy-up failure") Signed-off-by: Christoph Fritz Cc: # v5.15 Signed-off-by: Miklos Szeredi Signed-off-by: Greg Kroah-Hartman Signed-off-by: Paolo Pisati --- diff --git a/fs/overlayfs/copy_up.c b/fs/overlayfs/copy_up.c index 791b1916b098..e040970408d4 100644 --- a/fs/overlayfs/copy_up.c +++ b/fs/overlayfs/copy_up.c @@ -145,7 +145,7 @@ static int ovl_copy_fileattr(struct inode *inode, struct path *old, if (err == -ENOTTY || err == -EINVAL) return 0; pr_warn("failed to retrieve lower fileattr (%pd2, err=%i)\n", - old, err); + old->dentry, err); return err; } @@ -178,7 +178,7 @@ static int ovl_copy_fileattr(struct inode *inode, struct path *old, return 0; } pr_warn("failed to retrieve upper fileattr (%pd2, err=%i)\n", - new, err); + new->dentry, err); return err; }