linux-unionfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [syzbot] [ext4?] [overlayfs?] WARNING in file_seek_cur_needs_f_lock
@ 2025-04-07  3:57 syzbot
  2025-04-07  9:18 ` Miklos Szeredi
  2025-04-07 21:10 ` syzbot
  0 siblings, 2 replies; 6+ messages in thread
From: syzbot @ 2025-04-07  3:57 UTC (permalink / raw)
  To: adilger.kernel, amir73il, linux-ext4, linux-kernel, linux-unionfs,
	miklos, syzkaller-bugs, tytso

Hello,

syzbot found the following issue on:

HEAD commit:    16cd1c265776 Merge tag 'timers-cleanups-2025-04-06' of git..
git tree:       upstream
console+strace: https://syzkaller.appspot.com/x/log.txt?x=12e7923f980000
kernel config:  https://syzkaller.appspot.com/x/.config?x=c79406130aa88d22
dashboard link: https://syzkaller.appspot.com/bug?extid=4036165fc595a74b09b2
compiler:       gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=14f9bd98580000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=1571c7e4580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/a4435e7379c4/disk-16cd1c26.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/5a00533ae7ab/vmlinux-16cd1c26.xz
kernel image: https://storage.googleapis.com/syzbot-assets/2069327dcea6/bzImage-16cd1c26.xz

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

------------[ cut here ]------------
WARNING: CPU: 0 PID: 5824 at fs/file.c:1201 file_seek_cur_needs_f_lock+0x141/0x190 fs/file.c:1201
Modules linked in:
CPU: 0 UID: 0 PID: 5824 Comm: syz-executor625 Not tainted 6.14.0-syzkaller-13546-g16cd1c265776 #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
RIP: 0010:file_seek_cur_needs_f_lock+0x141/0x190 fs/file.c:1201
Code: 31 ff 89 c3 89 c6 e8 0e 9e 7f ff 84 db 74 15 e8 25 a3 7f ff bb 01 00 00 00 89 d8 5b 5d 41 5c c3 cc cc cc cc e8 10 a3 7f ff 90 <0f> 0b 90 eb e0 e8 05 a3 7f ff 31 db 89 d8 5b 5d 41 5c c3 cc cc cc
RSP: 0018:ffffc90002f07df8 EFLAGS: 00010293
RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffffff823b9ae2
RDX: ffff888031808000 RSI: ffffffff823b9b00 RDI: 0000000000000001
RBP: 0000000000000001 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: bfffffffffffffff
R13: 0000000000000005 R14: 00000ffffffff000 R15: 00000ffffffff000
FS:  00005555717cf380(0000) GS:ffff8881249b3000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000200000001000 CR3: 0000000026d60000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 generic_file_llseek_size+0x153/0x480 fs/read_write.c:178
 ext4_llseek+0x180/0x2f0 fs/ext4/file.c:941
 vfs_llseek+0x9a/0xe0 fs/read_write.c:387
 ovl_llseek+0x15c/0x2c0 fs/overlayfs/file.c:277
 vfs_llseek fs/read_write.c:387 [inline]
 ksys_lseek+0xf0/0x1b0 fs/read_write.c:400
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xcd/0x260 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fdc41bae4a9
Code: 48 83 c4 28 c3 e8 37 17 00 00 0f 1f 80 00 00 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:00007ffc49e17ef8 EFLAGS: 00000246 ORIG_RAX: 0000000000000008
RAX: ffffffffffffffda RBX: 0000200000000140 RCX: 00007fdc41bae4a9
RDX: 0000000000000001 RSI: 0000000000000005 RDI: 0000000000000003
RBP: 00007fdc41c21610 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000003 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffc49e180c8 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] 6+ messages in thread

* Re: [syzbot] [ext4?] [overlayfs?] WARNING in file_seek_cur_needs_f_lock
  2025-04-07  3:57 [syzbot] [ext4?] [overlayfs?] WARNING in file_seek_cur_needs_f_lock syzbot
@ 2025-04-07  9:18 ` Miklos Szeredi
  2025-04-07 14:07   ` syzbot
  2025-04-07 21:10 ` syzbot
  1 sibling, 1 reply; 6+ messages in thread
From: Miklos Szeredi @ 2025-04-07  9:18 UTC (permalink / raw)
  To: syzbot
  Cc: adilger.kernel, amir73il, linux-ext4, linux-kernel, linux-unionfs,
	syzkaller-bugs, tytso

[-- Attachment #1: Type: text/plain, Size: 817 bytes --]

On Mon, 7 Apr 2025 at 05:57, syzbot
<syzbot+4036165fc595a74b09b2@syzkaller.appspotmail.com> wrote:
>
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit:    16cd1c265776 Merge tag 'timers-cleanups-2025-04-06' of git..
> git tree:       upstream
> console+strace: https://syzkaller.appspot.com/x/log.txt?x=12e7923f980000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=c79406130aa88d22
> dashboard link: https://syzkaller.appspot.com/bug?extid=4036165fc595a74b09b2
> compiler:       gcc (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=14f9bd98580000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=1571c7e4580000


#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
v6.15-rc1

[-- Attachment #2: ovl-dont-seek_cur-on-realfile.patch --]
[-- Type: text/x-patch, Size: 569 bytes --]

diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c
index 969b458100fe..548f0e6aed54 100644
--- a/fs/overlayfs/file.c
+++ b/fs/overlayfs/file.c
@@ -273,6 +273,12 @@ static loff_t ovl_llseek(struct file *file, loff_t offset, int whence)
 	ovl_inode_lock(inode);
 	realfile->f_pos = file->f_pos;
 
+	/* Prevent WARNING in file_seek_cur_needs_f_lock() */
+	if (whence == SEEK_CUR && offset) {
+		offset += file->f_pos;
+		whence = SEEK_SET;
+	}
+
 	old_cred = ovl_override_creds(inode->i_sb);
 	ret = vfs_llseek(realfile, offset, whence);
 	ovl_revert_creds(old_cred);

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

* Re: [syzbot] [ext4?] [overlayfs?] WARNING in file_seek_cur_needs_f_lock
  2025-04-07  9:18 ` Miklos Szeredi
@ 2025-04-07 14:07   ` syzbot
  2025-04-07 21:02     ` David Howells
  0 siblings, 1 reply; 6+ messages in thread
From: syzbot @ 2025-04-07 14:07 UTC (permalink / raw)
  To: adilger.kernel, amir73il, linux-ext4, linux-kernel, linux-unionfs,
	miklos, syzkaller-bugs, tytso

Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
unregister_netdevice: waiting for DEV to become free

unregister_netdevice: waiting for batadv0 to become free. Usage count = 3


Tested on:

commit:         0af2f6be Linux 6.15-rc1
git tree:       git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git v6.15-rc1
console output: https://syzkaller.appspot.com/x/log.txt?x=123c0070580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=bae073f4634b7fd
dashboard link: https://syzkaller.appspot.com/bug?extid=4036165fc595a74b09b2
compiler:       Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
patch:          https://syzkaller.appspot.com/x/patch.diff?x=151deb4c580000


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

* Re: [syzbot] [ext4?] [overlayfs?] WARNING in file_seek_cur_needs_f_lock
  2025-04-07 14:07   ` syzbot
@ 2025-04-07 21:02     ` David Howells
  2025-04-08  6:17       ` Miklos Szeredi
  0 siblings, 1 reply; 6+ messages in thread
From: David Howells @ 2025-04-07 21:02 UTC (permalink / raw)
  To: syzbot
  Cc: dhowells, adilger.kernel, amir73il, linux-ext4, linux-kernel,
	linux-unionfs, miklos, syzkaller-bugs, tytso

syzbot <syzbot+4036165fc595a74b09b2@syzkaller.appspotmail.com> wrote:

> syzbot has tested the proposed patch but the reproducer is still triggering an issue:
> unregister_netdevice: waiting for DEV to become free
> 
> unregister_netdevice: waiting for batadv0 to become free. Usage count = 3

I've seen this in a bunch of different syzbot tests also where, as far as I
can tell, the patch I've offered fixes the actual bug.

David


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

* Re: [syzbot] [ext4?] [overlayfs?] WARNING in file_seek_cur_needs_f_lock
  2025-04-07  3:57 [syzbot] [ext4?] [overlayfs?] WARNING in file_seek_cur_needs_f_lock syzbot
  2025-04-07  9:18 ` Miklos Szeredi
@ 2025-04-07 21:10 ` syzbot
  1 sibling, 0 replies; 6+ messages in thread
From: syzbot @ 2025-04-07 21:10 UTC (permalink / raw)
  To: adilger.kernel, amir73il, dhowells, edumazet, linux-ext4,
	linux-kernel, linux-unionfs, miklos, sven, sw, syzkaller-bugs,
	tytso

syzbot has bisected this issue to:

commit 00b35530811f2aa3d7ceec2dbada80861c7632a8
Author: Eric Dumazet <edumazet@google.com>
Date:   Thu Feb 6 14:04:22 2025 +0000

    batman-adv: adopt netdev_hold() / netdev_put()

bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=175f8c04580000
start commit:   16cd1c265776 Merge tag 'timers-cleanups-2025-04-06' of git..
git tree:       upstream
final oops:     https://syzkaller.appspot.com/x/report.txt?x=14df8c04580000
console output: https://syzkaller.appspot.com/x/log.txt?x=10df8c04580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=c79406130aa88d22
dashboard link: https://syzkaller.appspot.com/bug?extid=4036165fc595a74b09b2
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=14f9bd98580000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=1571c7e4580000

Reported-by: syzbot+4036165fc595a74b09b2@syzkaller.appspotmail.com
Fixes: 00b35530811f ("batman-adv: adopt netdev_hold() / netdev_put()")

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

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

* Re: [syzbot] [ext4?] [overlayfs?] WARNING in file_seek_cur_needs_f_lock
  2025-04-07 21:02     ` David Howells
@ 2025-04-08  6:17       ` Miklos Szeredi
  0 siblings, 0 replies; 6+ messages in thread
From: Miklos Szeredi @ 2025-04-08  6:17 UTC (permalink / raw)
  To: David Howells
  Cc: syzbot, adilger.kernel, amir73il, linux-ext4, linux-kernel,
	linux-unionfs, syzkaller-bugs, tytso

On Mon, 7 Apr 2025 at 23:03, David Howells <dhowells@redhat.com> wrote:
>
> syzbot <syzbot+4036165fc595a74b09b2@syzkaller.appspotmail.com> wrote:
>
> > syzbot has tested the proposed patch but the reproducer is still triggering an issue:
> > unregister_netdevice: waiting for DEV to become free
> >
> > unregister_netdevice: waiting for batadv0 to become free. Usage count = 3
>
> I've seen this in a bunch of different syzbot tests also where, as far as I
> can tell, the patch I've offered fixes the actual bug.

Which one is that?  I can't seem to find it.

Thanks,
Miklos

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

end of thread, other threads:[~2025-04-08  6:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-07  3:57 [syzbot] [ext4?] [overlayfs?] WARNING in file_seek_cur_needs_f_lock syzbot
2025-04-07  9:18 ` Miklos Szeredi
2025-04-07 14:07   ` syzbot
2025-04-07 21:02     ` David Howells
2025-04-08  6:17       ` Miklos Szeredi
2025-04-07 21:10 ` 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).