From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E2EFFC43334 for ; Wed, 6 Jul 2022 22:24:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 52D4D6B0072; Wed, 6 Jul 2022 18:24:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4DCDF6B0073; Wed, 6 Jul 2022 18:24:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3A5266B0074; Wed, 6 Jul 2022 18:24:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 27AE16B0072 for ; Wed, 6 Jul 2022 18:24:41 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id EC4736A6 for ; Wed, 6 Jul 2022 22:24:40 +0000 (UTC) X-FDA: 79658105520.21.6B86832 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf02.hostedemail.com (Postfix) with ESMTP id 75B418000F for ; Wed, 6 Jul 2022 22:24:40 +0000 (UTC) Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 266LVUS3028569; Wed, 6 Jul 2022 22:24:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : subject : from : to : cc : date : in-reply-to : references : content-type : content-transfer-encoding : mime-version; s=pp1; bh=F22vL1+5zsau5Vgjd7MmaM1vXo7+Zz3f/wM7XhhKd6c=; b=pC3mI7Xh3kdusXzPklz6t1ERL4zskFdqN8XyKYog1arE5r+JGDm7p/4hr/zw3gaG8NYY NHptSpjQpy6e41lPW5IRDTG2YytQzH/2FjymRj8O8bF6ZZvgaginmbYxm796P4BdhHGU NyuBW2LHmUDOWt9V6FwhJMyXkbG/h0wd5atnZVznRHRsFoyTOdoam5hSXKOsB5I7Ee9u blnyHMLSqQcn1rnGssbfs/ZVIZGcYLca/cAqQq7UBySJX0TEjOxZjbyNpu5kxX+irl3Z EgThFGZUz/NIsth/y5L2sj3dIL1f0yDSwyp5c/w9SROjgqhqYHpoMoxg9fUQuXkHgTkL ow== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3h5g39vhtd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 06 Jul 2022 22:24:39 +0000 Received: from m0098420.ppops.net (m0098420.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 266MFcFk027819; Wed, 6 Jul 2022 22:24:38 GMT Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3h5g39vhsu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 06 Jul 2022 22:24:38 +0000 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 266MM9iD001881; Wed, 6 Jul 2022 22:24:36 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma04ams.nl.ibm.com with ESMTP id 3h4v4jsnvd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 06 Jul 2022 22:24:36 +0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 266MOYlB21692744 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 6 Jul 2022 22:24:34 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5DDBB11C04C; Wed, 6 Jul 2022 22:24:34 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C859111C04A; Wed, 6 Jul 2022 22:24:31 +0000 (GMT) Received: from li-f45666cc-3089-11b2-a85c-c57d1a57929f.ibm.com (unknown [9.163.26.108]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 6 Jul 2022 22:24:31 +0000 (GMT) Message-ID: Subject: Re: [syzbot] possible deadlock in mnt_want_write (2) From: Mimi Zohar To: Hillf Danton Cc: syzbot , 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 , Amir Goldstein Date: Wed, 06 Jul 2022 18:24:30 -0400 In-Reply-To: <20220706121038.2045-1-hdanton@sina.com> References: <000000000000466f0d05e2d5d1d1@google.com> <20220706121038.2045-1-hdanton@sina.com> Content-Type: text/plain; charset="ISO-8859-15" X-Mailer: Evolution 3.28.5 (3.28.5-18.el8) X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: vCVT9Ma_lepHnNYECMUdcbyAA1tib5nH X-Proofpoint-GUID: QlBo5NoRdChiUREP_Mp9wQWZ9xlRLJNy Content-Transfer-Encoding: 7bit X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-07-06_12,2022-06-28_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1011 impostorscore=0 priorityscore=1501 mlxlogscore=999 phishscore=0 suspectscore=0 adultscore=0 bulkscore=0 lowpriorityscore=0 mlxscore=0 spamscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2207060083 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1657146280; a=rsa-sha256; cv=none; b=ysHSs2DBhQnNgXUG01tV4fn4J77a5Tztik7jbgA3Lo+GjuvEK6MGHTPZfTd+NLVPm7zgpg zbaK53uALpCEPuoTBzO95cVspbaaS8sn7hU8A352CLFMWu4iqYOgQFcNJliPwDhJIQxyKG 9u7KOucOq1KbH05pJh9cPwUDKuAXJoY= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=pC3mI7Xh; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf02.hostedemail.com: domain of zohar@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=zohar@linux.ibm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1657146280; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=F22vL1+5zsau5Vgjd7MmaM1vXo7+Zz3f/wM7XhhKd6c=; b=vDLv5iJPHmh1WFa/2E14HCsoqJBkJgYcRUWsEB+6cFUQtWmPbOpgtYsGsa8pJhjWVtciuY AUodI9P6mPSs9xk9set5WKUhbcgetUecKePOMLwg0wg/5zkDagd8meMBTDoI20U55AlY8l YH9YWSnlWpkOx426ZpykBeh6hNwe+Is= X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 75B418000F Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=pC3mI7Xh; dmarc=pass (policy=none) header.from=ibm.com; spf=pass (imf02.hostedemail.com: domain of zohar@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=zohar@linux.ibm.com X-Stat-Signature: iijezthqqj9q8gdb5qec1rusb6jxh48x X-HE-Tag: 1657146280-680040 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 > 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 > Cc: Mimi Zohar > Cc: Amir Goldstein > Signed-off-by: Hillf Danton > --- > > --- 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; > --