Received: by 2002:ab2:7a55:0:b0:1f4:4a7d:290d with SMTP id u21csp433683lqp; Thu, 4 Apr 2024 19:27:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWtj/72qrSOs6TdTRgihvuVg+gTDsy5JtD5psSo4lpYnzj06+Ac5S0G85NkZ9EMGVxOyA4mDt01TUJP/DdfTHLBIUoghae5mpd5RlZLSQ== X-Google-Smtp-Source: AGHT+IFxe2OoDbOVAmqBYIb7W15OrWDUY7zvhkYJw+R32B/5W+zPQinYUUxoobmXExb7jcilLNHQ X-Received: by 2002:a19:6407:0:b0:516:b408:29d8 with SMTP id y7-20020a196407000000b00516b40829d8mr106494lfb.25.1712284063662; Thu, 04 Apr 2024 19:27:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712284063; cv=pass; d=google.com; s=arc-20160816; b=O302jBbb61a39KUwRe3dHrBO1t3oCHAQAXHAkIlh0GlE7saAW049Wz0Pt4b6+f3U1F 7fP7mMIm/pvakWQGvyU+9D7VtnGWSWNsAWyZc4sSuioyWp680TF1CkJKO+g6yQwc4aIi yq8K+6j/tXK2uMXO632zbPQdDVLbOaST6e5ifV7QqZD4Vir9Kt3133hICOUzH5BbF8pT Bd4gY2f5uWO6Nz1ZlKPj7JdR+iQcydHgJfa8vHKdXve0/ACu4X97EZy8MzjJ5PMNFLZq Vcpho0hUK7RaYCvESi1VUCboWkUU04Wf4GPvtCFq82EUlU9i1As5fVKaqzbdCa0gIrn5 yw6g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=recwD/IQWzE/0BMPOsDL3jZNvegzzgNj1gF0H+r6mNs=; fh=fkRTnC9sZoAnfOY7bZOnVCOxQVJVi4l91lgbkm2wm4w=; b=nOp3ZH/qPbGtnowBHI46U85U4j9btZJTjtgn5VCeCuNRGIMVEJ6RNr2JYHNvSK55Me 4+L+RgovE0yYoitVF0Eh0BIa7BsPX9F/2PvvySXM3GfYIurrRMwBGM96npu1gAIe+XXp V+06caCMaVpmkG0eXcNOkVnnHulw3WbpcDcu0e0WaZi0zUs4I/4j5Vf35hRlO9wx+9D/ F5FPu9AxQ9DPxS+lVAFLZRLDqZ1LVEFO8giH5UhBIQBLgFQLszT5aDA6jGAAND4BoK3B gM39Xb0yhbMoMYlhbybLGZkH0c5LoT1BtTLn6JczTWc97McVx2o0kqf8YRsEc4gmCBTV ieeA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@mit.edu header.s=outgoing header.b=PjC2XAxj; arc=pass (i=1 spf=pass spfdomain=mit.edu dkim=pass dkdomain=mit.edu dmarc=pass fromdomain=mit.edu); spf=pass (google.com: domain of linux-kernel+bounces-132327-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-132327-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mit.edu Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id kw21-20020a170907771500b00a51a69cab85si96613ejc.441.2024.04.04.19.27.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 19:27:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-132327-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@mit.edu header.s=outgoing header.b=PjC2XAxj; arc=pass (i=1 spf=pass spfdomain=mit.edu dkim=pass dkdomain=mit.edu dmarc=pass fromdomain=mit.edu); spf=pass (google.com: domain of linux-kernel+bounces-132327-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-132327-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mit.edu Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B48D11F2296E for ; Fri, 5 Apr 2024 02:27:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 19E501643D; Fri, 5 Apr 2024 02:27:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mit.edu header.i=@mit.edu header.b="PjC2XAxj" Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4337312B82 for ; Fri, 5 Apr 2024 02:27:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=18.9.28.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712284035; cv=none; b=UuQDKBNNTkS5e/3dZgqja1bLwdyrz6S5HXaeEkKKVbFzI4HowDik7RiNfAIPq5/Y1YI+p/guhTlMEoZUSVv+MZc2f3wwMFYNra8F8ZkKeQJfg2GY0C6H/SSNu3JFLEx9DsuHAKuiycaSAlkRaXpNZVchQjidnRCDpiABRKr/o60= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712284035; c=relaxed/simple; bh=NiS5deyMvevKlNkCo0sSnhd4ZIm3jHMnIcGkBixMHOU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=TtlnsTXzmjG+zTiofoQ0Aj2VBigDMxO0Aw6J8LICXdhFM41R/HgTKuRDuVUSdZItqhAPiN1NZ0PhnZeb+IiepuHS9vTxJ1pXrt63MU/9tR08dqEQmEnkyzVIW1eywjnDjLUvbi3sLLaWuY/rZlyD+wNrkmYIFQtgMIAfxpU7sCk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mit.edu; spf=pass smtp.mailfrom=mit.edu; dkim=pass (2048-bit key) header.d=mit.edu header.i=@mit.edu header.b=PjC2XAxj; arc=none smtp.client-ip=18.9.28.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mit.edu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mit.edu Received: from cwcc.thunk.org (pool-173-48-113-2.bstnma.fios.verizon.net [173.48.113.2]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 4352Qphf021537 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 4 Apr 2024 22:26:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mit.edu; s=outgoing; t=1712284015; bh=recwD/IQWzE/0BMPOsDL3jZNvegzzgNj1gF0H+r6mNs=; h=Date:From:Subject:Message-ID:MIME-Version:Content-Type; b=PjC2XAxj+KeDdXAOrm1O+Gtd9HoTbW7SWKp+Fzb1zGt15Byhbn0CEhyhnbChayawz SPtJyycGkfuCqyugqw+QorL0w9qDItKOS1fZePAd0UBturG+UnPXqJvwsvC/NQKp9X GtQ98StBPqed1u6nEzzuiJbigHchuH/OpmzGcWv4AsrgKjIWEjuy3PwaNrpbrWB/4S 0wMNSw8ZCbBWVgSrMeOWP/AisdkoaNYTb+4xig8qwHwLa8yRkwVWtGpr7aVAwIWomK SOGms6fiUARYoaOi17duory7yeX3PmC5lNiKkSps/dNvXApcD650DnEOt4clurPcHc cnBRFxihiUBAg== Received: by cwcc.thunk.org (Postfix, from userid 15806) id CB38C15C00DE; Thu, 4 Apr 2024 22:26:51 -0400 (EDT) Date: Thu, 4 Apr 2024 22:26:51 -0400 From: "Theodore Ts'o" To: Mikhail Ukhin Cc: stable@vger.kernel.org, Andreas Dilger , linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, Michail Ivanov , Pavel Koshutin , Artem Sadovnikov Subject: Re: [PATCH] ext4: fix i_data_sem unlock order in ext4_ind_migrate() Message-ID: <20240405022651.GB13376@mit.edu> References: <20240404095000.5872-1-mish.uxin2012@yandex.ru> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240404095000.5872-1-mish.uxin2012@yandex.ru> On Thu, Apr 04, 2024 at 12:50:00PM +0300, Mikhail Ukhin wrote: > Fuzzing reports a possible deadlock in jbd2_log_wait_commit. > > The problem occurs in ext4_ind_migrate due to an incorrect order of > unlocking of the journal and write semaphores - the order of unlocking > must be the reverse of the order of locking. > > Found by Linux Verification Center (linuxtesting.org) with syzkaller. This doesn't make any sense. Lock order matters; the order in which you unlock shouldn't (and doesn't) make a difference. This is also something which lockdep doesn't complain about --- because it's not a problem. So how was this "found by syzkaller"? - Ted