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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 594F6C77B75 for ; Wed, 3 May 2023 17:43:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229924AbjECRnG (ORCPT ); Wed, 3 May 2023 13:43:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229735AbjECRnE (ORCPT ); Wed, 3 May 2023 13:43:04 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4071E4EC9; Wed, 3 May 2023 10:42:59 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id DC31222B29; Wed, 3 May 2023 17:42:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1683135777; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=vMRb6YixvaXRrTTXEMUc7Ew/vp3Ex6L4GYbhpZg+Cxc=; b=qr/k6Nx1QqblgGx3If8I3F7C92ZEMfmQ3uDTtGhVuUjTHG36FYyXNHvlwJVA0VexHAmN/L zosA4egvWy3ReOiZYo1HOYnOaKfmt5V8fIGwymyCF7vB/N5tmr5oXrRisp+vtGPzWNK7RJ bucE+PID5Z2cvkbWxUYX5LgkxVDAyn0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1683135777; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=vMRb6YixvaXRrTTXEMUc7Ew/vp3Ex6L4GYbhpZg+Cxc=; b=3N3tm83zW2Xj0CKBMB1xd9Svim/jAW8DeYjn/crMGp+Dzn5i4xqgt+PUKKwUhYRIsoUeeP s9uFdPg2SquP6DAg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 4AB9113584; Wed, 3 May 2023 17:42:57 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id +kMsEiGdUmRoKwAAMHmgww (envelope-from ); Wed, 03 May 2023 17:42:57 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 2F197A0744; Wed, 3 May 2023 19:42:54 +0200 (CEST) Date: Wed, 3 May 2023 19:42:54 +0200 From: Jan Kara To: Dmitry Vyukov Cc: syzbot , adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com, tytso@mit.edu Subject: Re: [syzbot] [ext4?] KCSAN: data-race in __es_find_extent_range / __es_find_extent_range (6) Message-ID: <20230503174254.xbggzuzej6bbugts@quack3> References: <000000000000d3b33905fa0fd4a6@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Mon 24-04-23 09:27:00, Dmitry Vyukov wrote: > On Mon, 24 Apr 2023 at 09:19, syzbot > wrote: > > > > Hello, > > > > syzbot found the following issue on: > > > > HEAD commit: 44149752e998 Merge tag 'cgroup-for-6.3-rc6-fixes' of git:/.. > > git tree: upstream > > console output: https://syzkaller.appspot.com/x/log.txt?x=100db37bc80000 > > kernel config: https://syzkaller.appspot.com/x/.config?x=710057cbb8def08c > > dashboard link: https://syzkaller.appspot.com/bug?extid=4a03518df1e31b537066 > > compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2 > > > > Unfortunately, I don't have any reproducer for this issue yet. > > > > Downloadable assets: > > disk image: https://storage.googleapis.com/syzbot-assets/7bfa303f05cc/disk-44149752.raw.xz > > vmlinux: https://storage.googleapis.com/syzbot-assets/4e8ea8730409/vmlinux-44149752.xz > > kernel image: https://storage.googleapis.com/syzbot-assets/e584bce13ba7/bzImage-44149752.xz > > > > IMPORTANT: if you fix the issue, please add the following tag to the commit: > > Reported-by: syzbot+4a03518df1e31b537066@syzkaller.appspotmail.com > > The race is here: > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/ext4/extents_status.c?id=44149752e9987a9eac5ad78e6d3a20934b5e018d#n271 > > If I am reading this correctly, it can lead to returning a wrong > extent if tree->cache_es is re-read after the range check. > I think tree->cache_es read/write should use READ/WRITE_ONCE. Right. I'll send a fix. Honza -- Jan Kara SUSE Labs, CR