Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/fs/union When testing whiteout support on the underlying...



details:   https://anonhg.NetBSD.org/src/rev/a392608adfe0
branches:  trunk
changeset: 372388:a392608adfe0
user:      hannken <hannken%NetBSD.org@localhost>
date:      Mon Nov 21 10:37:14 2022 +0000

description:
When testing whiteout support on the underlying file system
union_mount() should not use a NULL componentname as not all
file systems can handle it.

Use static { LOOKUP, NOCRED } componentname instead.

Reported-by: syzbot+ecda308a1dd9652836d0%syzkaller.appspotmail.com@localhost
Reported-by: syzbot+9b687847ee5f43e94ca3%syzkaller.appspotmail.com@localhost
Reported-by: syzbot+9f9d1a841734f9f50de2%syzkaller.appspotmail.com@localhost

diffstat:

 sys/fs/union/union_vfsops.c |  12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diffs (34 lines):

diff -r 7446a9c36496 -r a392608adfe0 sys/fs/union/union_vfsops.c
--- a/sys/fs/union/union_vfsops.c       Mon Nov 21 09:51:13 2022 +0000
+++ b/sys/fs/union/union_vfsops.c       Mon Nov 21 10:37:14 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: union_vfsops.c,v 1.84 2022/11/04 11:20:39 hannken Exp $        */
+/*     $NetBSD: union_vfsops.c,v 1.85 2022/11/21 10:37:14 hannken Exp $        */
 
 /*
  * Copyright (c) 1994 The Regents of the University of California.
@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: union_vfsops.c,v 1.84 2022/11/04 11:20:39 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: union_vfsops.c,v 1.85 2022/11/21 10:37:14 hannken Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -205,9 +205,13 @@
         * supports whiteout operations
         */
        if ((mp->mnt_flag & MNT_RDONLY) == 0) {
+               static struct componentname nullcn = {
+                       .cn_nameiop = LOOKUP,
+                       .cn_cred = NOCRED
+               };
+
                vn_lock(um->um_uppervp, LK_EXCLUSIVE | LK_RETRY);
-               error = VOP_WHITEOUT(um->um_uppervp,
-                   (struct componentname *) 0, LOOKUP);
+               error = VOP_WHITEOUT(um->um_uppervp, &nullcn, LOOKUP);
                VOP_UNLOCK(um->um_uppervp);
                if (error)
                        goto bad;



Home | Main Index | Thread Index | Old Index