Re: WARNING: bad unlock balance in ovl_llseek

From: Miklos Szeredi
Date: Mon Mar 02 2020 - 06:17:48 EST


On Mon, Mar 2, 2020 at 12:10 PM Amir Goldstein <amir73il@xxxxxxxxx> wrote:

> > =====================================
> > WARNING: bad unlock balance detected!
> > 5.6.0-rc3-syzkaller #0 Not tainted
> > -------------------------------------
> > syz-executor194/8947 is trying to release lock (&ovl_i_lock_key[depth]) at:
> > [<ffffffff828b7835>] ovl_inode_unlock fs/overlayfs/overlayfs.h:328 [inline]
> > [<ffffffff828b7835>] ovl_llseek+0x215/0x2c0 fs/overlayfs/file.c:193
> > but there are no more locks to release!
> >
>
> This is strange. I don't see how that can happen nor how my change would
> have caused this regression. If anything, the lock chance may have brought
> a bug in stack file ops to light, but don't see the bug.

The bug is that ovl_inode_lock() is interruptible and that the caller
doesn't check for error.

I think the fix is to make this lock uninterruptible (probably rename
the current helper to _interruptible and use the current name as the
uninterruptible version).

Thanks,
Miklos