Received: by 2002:ab2:2441:0:b0:1f3:1f8c:d0c6 with SMTP id k1csp162002lqe; Thu, 4 Apr 2024 03:01:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUuYB4jRVNARCZJ7RnU5wRVpddlHstDD+y68fTyIg6s2WjtJ2pCrCDmvB+yoG2dS9yWVX5Ty2kYMH8OlrFdCkccsC2qxCfJTaJuc6GjOg== X-Google-Smtp-Source: AGHT+IESxMr1ZyJS/Ugm4ZpJeBFxaewvBmSQYUDimRWjFM4zkhnElGNYKMbjmylhTdmTJoFBpnge X-Received: by 2002:a0c:e0c2:0:b0:699:3702:ab7a with SMTP id x2-20020a0ce0c2000000b006993702ab7amr395330qvk.51.1712224862023; Thu, 04 Apr 2024 03:01:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712224862; cv=pass; d=google.com; s=arc-20160816; b=ndgEWatiy3x7V3aX1VOSf+znn+1BOOzk9eV0lYuoajtHkWoxSVdYQxZkliRMu5iXjf ergRayUddHIHCJ1EVnvZquCYbm4r5PvTvs+TQMyASTjdk3TflAsaMHocrKZSeBKfvDdv cjryq/ugVPSznqKCGcsadsviI9VBkVxqBaw9nxOxA2tTdRF5GuHO59DV3qMfRsnVeUqX GLJ9CAMMoRehElWUoW2T7Y+/uAY97BZfbhX+bpWE6RF/fXb+/6/29KdnK5KCG4dhZtnP ei4SvlMEbj2HExZoS5EwgeYvwWFN+96WZ135kPBM+OO+8CAdXGEmBgV8jwiLVZCzcgog +kSg== 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=7G7w/jxSDJfK01O7mDNdKphR6NOre/DqsSFKhOc8tdk=; fh=KsgNb/WuI47547mTwvAwsXiMqsBGSjnp6VVcNxq0EH4=; b=HhgIBOtCrf6PinF9plMDqINIEgWozF5pSu0sO6g4cxuPwmrfxOdpQLelzer2+W+snY m6M6ari+jaQgT+b8VWd4+T5+GTgLODYYVjsjcq4o909EcAjEUAGKg3yS//CMl1NlfZEm TnevlexkAWWbC7Ko1JXlbtj5Cj7KWDhcqlrYzS5bm5xysZ+mNJPtahQItFmg93SDDdxz ck2WTPvIk1qodiUS3Y1I9GbhurwnjbEleVSbTPrfP1TW0KEWDA3W2ckJz7Lk7z/T6IQ4 JGLFZw6rkwTw+RfwWad0FenwCPs+qTAfuLHIXGYp3S5BnGsrPToGJjmwIG2jb8LluUHK FNNA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CV47OjUS; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-ext4+bounces-1852-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1852-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id o4-20020a0ccb04000000b00696166e1092si16872649qvk.103.2024.04.04.03.01.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 03:01:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4+bounces-1852-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CV47OjUS; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-ext4+bounces-1852-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1852-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id B53591C226CA for ; Thu, 4 Apr 2024 10:01:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 47CA9762EF; Thu, 4 Apr 2024 10:00:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="CV47OjUS" X-Original-To: linux-ext4@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 AFB425D8EB; Thu, 4 Apr 2024 10:00:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712224847; cv=none; b=kzRNdVIFAbydmyz8yBV6vpbkkXzu/RGFKhkhom8b89JPlF7yFFr0gQO6enL6xtVggERfmbPNqYWi+LKIn6/x5p44YBcP35MQQF2ByONJFDkNKyDhMvmPAJQcZx+Py4vZuVqcWfYEYQs2dneWfhvZhPAegWnuf3SeS/7GGdC5aXs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712224847; c=relaxed/simple; bh=pzg/NxCbsTpVY8BNmN1lAO6InQKeDAeyEthGxsKZB04=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=TkCZaiiMib5E9qYW3bk0sSDYje/gHy5sH+ID9WTwcaqGmzBmWp5QjIxODY9nzX3au5ZweAq7K7Ldpthg+tRnsnTxa0eeFo3DR3Jl1+/6LNqjmHYopDhzY3sqe7E4YqLwEvaeDPMMsTk5sNXv3PQAhZtQNqesLkYpHbl6eR1LE00= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=CV47OjUS; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1BC1AC433C7; Thu, 4 Apr 2024 10:00:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1712224847; bh=pzg/NxCbsTpVY8BNmN1lAO6InQKeDAeyEthGxsKZB04=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CV47OjUS7AHnFMtpiQzFpVg9yPfEeouSXWGrCsve6UuRIY5+vrKeIeFjOcXQMtcYY dNqTCNhzR+XJJh1mSeGewOutrdaiiceST0bcCciVHBTqOTr8PAd15sEBkEX1Ui8f7O dkUiY54HhrqumPKZXE4qdtnQ7uBmx2S2CourDoXE= Date: Thu, 4 Apr 2024 12:00:43 +0200 From: Greg KH To: Mikhail Ukhin Cc: Theodore Ts'o , 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: <2024040424-fax-freeway-ff7c@gregkh> References: <20240404095000.5872-1-mish.uxin2012@yandex.ru> Precedence: bulk X-Mailing-List: linux-ext4@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. > > Signed-off-by: Artem Sadovnikov Does not match your From: line :( > --- > fs/ext4/migrate.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/ext4/migrate.c b/fs/ext4/migrate.c > index d98ac2af8199..a5e1492bbaaa 100644 > --- a/fs/ext4/migrate.c > +++ b/fs/ext4/migrate.c > @@ -663,8 +663,8 @@ int ext4_ind_migrate(struct inode *inode) > if (unlikely(ret2 && !ret)) > ret = ret2; > errout: > - ext4_journal_stop(handle); > up_write(&EXT4_I(inode)->i_data_sem); > + ext4_journal_stop(handle); > out_unlock: > ext4_writepages_up_write(inode->i_sb, alloc_ctx); > return ret; > -- > 2.25.1 > > This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read: https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html for how to do this properly.