]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ovl: fix NULL pointer dereference in copy up warning
authorChristoph Fritz <chf.fritz@googlemail.com>
Wed, 12 Jan 2022 18:33:21 +0000 (19:33 +0100)
committerMiklos Szeredi <mszeredi@redhat.com>
Fri, 14 Jan 2022 14:59:22 +0000 (15:59 +0100)
This patch is fixing a NULL pointer dereference to get a recently
introduced warning message working.

Fixes: 4add4127716e ("ovl: fix filattr copy-up failure")
Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com>
Cc: <stable@vger.kernel.org> # v5.15
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/overlayfs/copy_up.c

index b193d08a3dc367e23213d22eedd5dcbcf8a09d67..347b06479663d9c8dae8339f3a2cacfedea04e16 100644 (file)
@@ -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;
        }
 
@@ -168,7 +168,7 @@ static int ovl_copy_fileattr(struct inode *inode, struct path *old,
        err = ovl_real_fileattr_get(new, &newfa);
        if (err) {
                pr_warn("failed to retrieve upper fileattr (%pd2, err=%i)\n",
-                       new, err);
+                       new->dentry, err);
                return err;
        }