linux-unionfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [syzbot] [overlayfs?] WARNING in ovl_listxattr
@ 2025-05-17  9:38 syzbot
  2025-06-12 15:01 ` [PATCH] fs/xattr: reset err to 0 after get security.* xattrs Edward Adam Davis
  2025-07-17  7:47 ` [syzbot] [overlayfs?] WARNING in ovl_listxattr syzbot
  0 siblings, 2 replies; 4+ messages in thread
From: syzbot @ 2025-05-17  9:38 UTC (permalink / raw)
  To: amir73il, linux-kernel, linux-unionfs, miklos, syzkaller-bugs

Hello,

syzbot found the following issue on:

HEAD commit:    e9565e23cd89 Merge tag 'sched_ext-for-6.15-rc6-fixes' of g..
git tree:       upstream
console+strace: https://syzkaller.appspot.com/x/log.txt?x=15ee8f68580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=5929ac65be9baf3c
dashboard link: https://syzkaller.appspot.com/bug?extid=4125590f2a9f5b3cdf43
compiler:       Debian clang version 20.1.2 (++20250402124445+58df0ef89dd6-1~exp1~20250402004600.97), Debian LLD 20.1.2
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=12cb6af4580000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=1301f670580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/88b9a7ce7297/disk-e9565e23.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/6ef1e04f11ea/vmlinux-e9565e23.xz
kernel image: https://storage.googleapis.com/syzbot-assets/dfb61d29ee21/bzImage-e9565e23.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+4125590f2a9f5b3cdf43@syzkaller.appspotmail.com

WARNING: The mand mount option has been deprecated and
         and is ignored by this kernel. Remove the mand
         option from the mount to silence this warning.
=======================================================
------------[ cut here ]------------
WARNING: CPU: 0 PID: 5827 at fs/overlayfs/xattrs.c:136 ovl_listxattr+0x3a3/0x400 fs/overlayfs/xattrs.c:136
Modules linked in:
CPU: 0 UID: 0 PID: 5827 Comm: syz-executor209 Not tainted 6.15.0-rc6-syzkaller-00047-ge9565e23cd89 #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
RIP: 0010:ovl_listxattr+0x3a3/0x400 fs/overlayfs/xattrs.c:136
Code: d5 f3 fe e9 47 ff ff ff e8 da 06 94 fe 4c 89 f8 48 83 c4 10 5b 41 5c 41 5d 41 5e 41 5f 5d c3 cc cc cc cc cc e8 be 06 94 fe 90 <0f> 0b 90 49 c7 c7 fb ff ff ff eb d7 e8 ac 06 94 fe 90 0f 0b 90 e9
RSP: 0018:ffffc9000440fdb8 EFLAGS: 00010293
RAX: ffffffff832bea42 RBX: ffff888020aec700 RCX: ffff88802faf5a00
RDX: 0000000000000000 RSI: 0000000000000011 RDI: 0000000000000012
RBP: ffff88823bf5cf01 R08: ffff8880335691d3 R09: 1ffff110066ad23a
R10: dffffc0000000000 R11: ffffed10066ad23b R12: ffffffffffffffff
R13: 0000000000000012 R14: ffff8880687d7820 R15: 0000000000000011
FS:  000055558015f380(0000) GS:ffff8881260fb000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000200000001000 CR3: 000000007f130000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 vfs_listxattr fs/xattr.c:493 [inline]
 listxattr+0x10d/0x2a0 fs/xattr.c:924
 filename_listxattr fs/xattr.c:958 [inline]
 path_listxattrat+0x179/0x390 fs/xattr.c:988
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fcb6cb2da39
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffdbfef0558 EFLAGS: 00000246 ORIG_RAX: 00000000000000c3
RAX: ffffffffffffffda RBX: 0030656c69662f2e RCX: 00007fcb6cb2da39
RDX: 00000000000000b6 RSI: 0000200000000200 RDI: 00002000000001c0
RBP: 0000200000000180 R08: 0000000000000006 R09: 0000000000000006
R10: 0000200000000300 R11: 0000000000000246 R12: 00007fcb6cb7c17c
R13: 00007fcb6cb77082 R14: 0000000000000001 R15: 0000000000000001
 </TASK>


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] fs/xattr: reset err to 0 after get security.* xattrs
  2025-05-17  9:38 [syzbot] [overlayfs?] WARNING in ovl_listxattr syzbot
@ 2025-06-12 15:01 ` Edward Adam Davis
  2025-06-12 15:09   ` Stephen Smalley
  2025-07-17  7:47 ` [syzbot] [overlayfs?] WARNING in ovl_listxattr syzbot
  1 sibling, 1 reply; 4+ messages in thread
From: Edward Adam Davis @ 2025-06-12 15:01 UTC (permalink / raw)
  To: syzbot+4125590f2a9f5b3cdf43
  Cc: amir73il, linux-kernel, linux-unionfs, miklos,
	stephen.smalley.work, syzkaller-bugs

After successfully getting "security.SMACK64", err is not reset to 0, which
causes simple_xattr_list() to return 17, which is much smaller than the
actual buffer size..

After updating err to remaining_size, reset err to 0 to avoid returning an
inappropriate buffer size.

Fixes: 8b0ba61df5a1 ("fs/xattr.c: fix simple_xattr_list to always include security.* xattrs")
Reported-by: syzbot+4125590f2a9f5b3cdf43@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=4125590f2a9f5b3cdf43
Tested-by: syzbot+4125590f2a9f5b3cdf43@syzkaller.appspotmail.com
Signed-off-by: Edward Adam Davis <eadavis@qq.com>
---
 fs/xattr.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/xattr.c b/fs/xattr.c
index 8ec5b0204bfd..600ae97969cf 100644
--- a/fs/xattr.c
+++ b/fs/xattr.c
@@ -1479,6 +1479,7 @@ ssize_t simple_xattr_list(struct inode *inode, struct simple_xattrs *xattrs,
 		buffer += err;
 	}
 	remaining_size -= err;
+	err = 0;
 
 	read_lock(&xattrs->lock);
 	for (rbp = rb_first(&xattrs->rb_root); rbp; rbp = rb_next(rbp)) {
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] fs/xattr: reset err to 0 after get security.* xattrs
  2025-06-12 15:01 ` [PATCH] fs/xattr: reset err to 0 after get security.* xattrs Edward Adam Davis
@ 2025-06-12 15:09   ` Stephen Smalley
  0 siblings, 0 replies; 4+ messages in thread
From: Stephen Smalley @ 2025-06-12 15:09 UTC (permalink / raw)
  To: Edward Adam Davis
  Cc: syzbot+4125590f2a9f5b3cdf43, amir73il, linux-kernel,
	linux-unionfs, miklos, syzkaller-bugs

On Thu, Jun 12, 2025 at 11:01 AM Edward Adam Davis <eadavis@qq.com> wrote:
>
> After successfully getting "security.SMACK64", err is not reset to 0, which
> causes simple_xattr_list() to return 17, which is much smaller than the
> actual buffer size..
>
> After updating err to remaining_size, reset err to 0 to avoid returning an
> inappropriate buffer size.
>
> Fixes: 8b0ba61df5a1 ("fs/xattr.c: fix simple_xattr_list to always include security.* xattrs")
> Reported-by: syzbot+4125590f2a9f5b3cdf43@syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=4125590f2a9f5b3cdf43
> Tested-by: syzbot+4125590f2a9f5b3cdf43@syzkaller.appspotmail.com
> Signed-off-by: Edward Adam Davis <eadavis@qq.com>

Already fixed on vfs/vfs.fixes, see:
https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git/commit/?h=vfs.fixes&id=800d0b9b6a8b1b354637b4194cc167ad1ce2bdd3

> ---
>  fs/xattr.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/fs/xattr.c b/fs/xattr.c
> index 8ec5b0204bfd..600ae97969cf 100644
> --- a/fs/xattr.c
> +++ b/fs/xattr.c
> @@ -1479,6 +1479,7 @@ ssize_t simple_xattr_list(struct inode *inode, struct simple_xattrs *xattrs,
>                 buffer += err;
>         }
>         remaining_size -= err;
> +       err = 0;
>
>         read_lock(&xattrs->lock);
>         for (rbp = rb_first(&xattrs->rb_root); rbp; rbp = rb_next(rbp)) {
> --
> 2.43.0
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [syzbot] [overlayfs?] WARNING in ovl_listxattr
  2025-05-17  9:38 [syzbot] [overlayfs?] WARNING in ovl_listxattr syzbot
  2025-06-12 15:01 ` [PATCH] fs/xattr: reset err to 0 after get security.* xattrs Edward Adam Davis
@ 2025-07-17  7:47 ` syzbot
  1 sibling, 0 replies; 4+ messages in thread
From: syzbot @ 2025-07-17  7:47 UTC (permalink / raw)
  To: amir73il, brauner, eadavis, jack, linux-fsdevel, linux-kernel,
	linux-unionfs, lizhi.xu, miklos, stephen.smalley.work,
	syzkaller-bugs, viro

syzbot suspects this issue was fixed by commit:

commit 800d0b9b6a8b1b354637b4194cc167ad1ce2bdd3
Author: Stephen Smalley <stephen.smalley.work@gmail.com>
Date:   Thu Jun 5 16:51:16 2025 +0000

    fs/xattr.c: fix simple_xattr_list()

bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=173de382580000
start commit:   e9565e23cd89 Merge tag 'sched_ext-for-6.15-rc6-fixes' of g..
git tree:       upstream
kernel config:  https://syzkaller.appspot.com/x/.config?x=5929ac65be9baf3c
dashboard link: https://syzkaller.appspot.com/bug?extid=4125590f2a9f5b3cdf43
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=12cb6af4580000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=1301f670580000

If the result looks correct, please mark the issue as fixed by replying with:

#syz fix: fs/xattr.c: fix simple_xattr_list()

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-07-17  7:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-17  9:38 [syzbot] [overlayfs?] WARNING in ovl_listxattr syzbot
2025-06-12 15:01 ` [PATCH] fs/xattr: reset err to 0 after get security.* xattrs Edward Adam Davis
2025-06-12 15:09   ` Stephen Smalley
2025-07-17  7:47 ` [syzbot] [overlayfs?] WARNING in ovl_listxattr syzbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).