syzbot


WARNING: bad unlock balance in ovl_llseek

Status: fixed on 2020/04/15 17:19
Subsystems: overlayfs
[Documentation on labels]
Reported-by: syzbot+66a9752fa927f745385e@syzkaller.appspotmail.com
Fix commit: 531d3040bc5c ovl: fix lock in ovl_llseek()
First crash: 1517d, last: 1501d
Cause bisection: introduced by (bisect log) :
commit b1f9d3858f724ed45b279b689fb5b400d91352e3
Author: Amir Goldstein <amir73il@gmail.com>
Date: Sat Dec 21 09:42:29 2019 +0000

  ovl: use ovl_inode_lock in ovl_llseek()

Crash: WARNING: bad unlock balance in ovl_llseek (log)
Repro: C syz .config
  
Discussions (1)
Title Replies (including bot) Last reply
WARNING: bad unlock balance in ovl_llseek 9 (11) 2020/03/06 22:35
Last patch testing requests (1)
Created Duration User Patch Repo Result
2020/03/03 07:34 19m amir73il@gmail.com https://github.com/amir73il/linux.git ovl-fixes OK

Sample crash report:
=====================================
WARNING: bad unlock balance detected!
5.6.0-rc3-syzkaller #0 Not tainted
-------------------------------------
syz-executor058/10771 is trying to release lock (&ovl_i_lock_key[depth]) at:
[<ffffffff82890c0d>] ovl_inode_unlock fs/overlayfs/overlayfs.h:328 [inline]
[<ffffffff82890c0d>] ovl_llseek+0x29d/0x3b0 fs/overlayfs/file.c:193
but there are no more locks to release!

other info that might help us debug this:
1 lock held by syz-executor058/10771:
 #0: ffff8880a774bde0 (&f->f_pos_lock){+.+.}, at: __fdget_pos+0xee/0x110 fs/file.c:821

stack backtrace:
CPU: 0 PID: 10771 Comm: syz-executor058 Not tainted 5.6.0-rc3-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x197/0x210 lib/dump_stack.c:118
 print_unlock_imbalance_bug kernel/locking/lockdep.c:4007 [inline]
 print_unlock_imbalance_bug.cold+0x114/0x123 kernel/locking/lockdep.c:3983
 __lock_release kernel/locking/lockdep.c:4241 [inline]
 lock_release+0x5f2/0x960 kernel/locking/lockdep.c:4502
 __mutex_unlock_slowpath+0x86/0x6a0 kernel/locking/mutex.c:1228
 mutex_unlock+0xd/0x10 kernel/locking/mutex.c:740
 ovl_inode_unlock fs/overlayfs/overlayfs.h:328 [inline]
 ovl_llseek+0x29d/0x3b0 fs/overlayfs/file.c:193
 vfs_llseek fs/read_write.c:300 [inline]
 ksys_lseek+0x116/0x1b0 fs/read_write.c:313
 __do_sys_lseek fs/read_write.c:324 [inline]
 __se_sys_lseek fs/read_write.c:322 [inline]
 __x64_sys_lseek+0x73/0xb0 fs/read_write.c:322
 do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x4459b9
Code: e8 bc b7 02 00 48 83 c4 18 c3 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 0f 83 2b 12 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f2b78befdb8 EFLAGS: 00000246 ORIG_RAX: 0000000000000008
RAX: ffffffffffffffda R

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/03/03 08:07 upstream 63623fd44972 c88c7b75 .config console log report syz C ci-upstream-kasan-gce-selinux-root
2020/03/02 02:31 upstream 63623fd44972 c88c7b75 .config console log report syz C ci-upstream-kasan-gce-root
2020/02/28 12:12 upstream f8788d86ab28 59b57593 .config console log report syz C ci-upstream-kasan-gce-smack-root
2020/03/15 02:36 linux-next 770fbb32d34e 749688d2 .config console log report syz C ci-upstream-linux-next-kasan-gce-root
* Struck through repros no longer work on HEAD.