From: Mimi Zohar <zohar@linux.ibm.com>
To: Hillf Danton <hdanton@sina.com>
Cc: syzbot <syzbot+b42fe626038981fb7bfa@syzkalhler.appspotmail.com>,
linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org,
miklos@szeredi.hu, syzkaller-bugs@googlegroups.com,
syzbot <syzbot+b42fe626038981fb7bfa@syzkaller.appspotmail.com>,
Amir Goldstein <amir73il@gmail.com>
Subject: Re: [syzbot] possible deadlock in mnt_want_write (2)
Date: Wed, 06 Jul 2022 18:24:30 -0400 [thread overview]
Message-ID: <d262e97cea0b9c32065ee8e02354a0aa0134c8ab.camel@linux.ibm.com> (raw)
In-Reply-To: <20220706121038.2045-1-hdanton@sina.com>
Hi Hillf,g
On Wed, 2022-07-06 at 20:10 +0800, Hillf Danton wrote:
> On Tue, 05 Jul 2022 08:53:15 -0400 Mimi Zohar wrote:
> >
> > Thank you for the reproducer. This seems to be a similar false
> > positive as was discussed:
> > https://lore.kernel.org/linux-unionfs/000000000000c5b77105b4c3546e@google.com/
> >
> > thanks,
> >
>
> Hi Mimi
>
> Please pick up the patch attached if it makes sense to you.
The patch itself looks good, but missing from the patch description is
an indication that the lockdep warning is a false positive. Perhaps
add a "Suggested-by" line crediting Amir. I'd appreciate your posting
the patch on the mailing list.
thanks!
Mimi
> From: Hillf Danton <hdanton@sina.com>
> Subject: [PATCH] integrity: lockdep annotate of iint->mutex
>
> This fixes a reported lockdep splat
>
> CPU0 CPU1
> ---- ----
> lock(&iint->mutex);
> lock(sb_writers#4);
> lock(&iint->mutex);
> lock(sb_writers#4);
>
> *** DEADLOCK ***
>
> using the method in 4eae06de482b annotating OVL_I(inode)->lock.
>
> Links: https://lore.kernel.org/linux-unionfs/CAOQ4uxjk4XYuwz5HCmN-Ge=Ld=tM1f7ZxVrd5U1AC2Wisc9MTA@mail.gmail.com/
> Reported-and-tested-by: syzbot <syzbot+b42fe626038981fb7bfa@syzkaller.appspotmail.com>
> Cc: Mimi Zohar <zohar@linux.ibm.com>
> Cc: Amir Goldstein <amir73il@gmail.com>
> Signed-off-by: Hillf Danton <hdanton@sina.com>
> ---
>
> --- a/security/integrity/iint.c
> +++ b/security/integrity/iint.c
> @@ -85,6 +85,17 @@ static void iint_free(struct integrity_i
> kmem_cache_free(iint_cache, iint);
> }
>
> +static void iint_annotate_mutex_key(struct integrity_iint_cache *iint, struct inode *inode)
> +{
> +#ifdef CONFIG_LOCKDEP
> + static struct lock_class_key iint_mutex_key[FILESYSTEM_MAX_STACK_DEPTH];
> +
> + int depth = inode->i_sb->s_stack_depth;
> +
> + lockdep_set_class(&iint->mutex, &iint_mutex_key[depth]);
> +#endif
> +}
> +
> /**
> * integrity_inode_get - find or allocate an iint associated with an inode
> * @inode: pointer to the inode
> @@ -114,6 +125,8 @@ struct integrity_iint_cache *integrity_i
> if (!iint)
> return NULL;
>
> + iint_annotate_mutex_key(iint, inode);
> +
> write_lock(&integrity_iint_lock);
>
> p = &integrity_iint_tree.rb_node;
> --
prev parent reply other threads:[~2022-07-06 22:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <000000000000466f0d05e2d5d1d1@google.com>
[not found] ` <c75858662b90592ae3f3ab57d4500381a28bafe5.camel@linux.ibm.com>
2022-07-06 12:10 ` Hillf Danton
2022-07-06 22:24 ` Mimi Zohar [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d262e97cea0b9c32065ee8e02354a0aa0134c8ab.camel@linux.ibm.com \
--to=zohar@linux.ibm.com \
--cc=amir73il@gmail.com \
--cc=hdanton@sina.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=miklos@szeredi.hu \
--cc=syzbot+b42fe626038981fb7bfa@syzkalhler.appspotmail.com \
--cc=syzbot+b42fe626038981fb7bfa@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox