Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1691899pxb; Mon, 12 Apr 2021 04:33:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8cQbLSI7/ho+jtFxQc6dw9cSvQ+6txDBTHlFPrJLnaTASFa/ZUVw1++SBiodHAH046q2v X-Received: by 2002:a17:907:e87:: with SMTP id ho7mr26318824ejc.2.1618227238878; Mon, 12 Apr 2021 04:33:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618227238; cv=none; d=google.com; s=arc-20160816; b=cQtrRVwj84On9qydGthcF9I1HhXIetVFu97pgmolm68TnkuTJMw0YAHh9NqW8i4pel vmvCzD8fM36qnzpMD0ExSUymP9muL3TcipsDfrKxzTsuvACU+MOLxT2x5Y6h4rMMMpxS 16VQu3Hmm3eBYntgvtQtgpBa0Wjk1RwZ+L0VEfu5wQOWbv2uD4yrJ7lMUcF438B9/4+P YgHY+4rGcgN3PNfdg63tyjnUNUbSzkaU/RNihuz89A0wm3iqISyB7vV+8tZPw7a6/NC2 q+AW3jzLrklu8lSip5IuV2jFCYbCwuQLhXhUDLde4n8qv5ZZOhBT0VvpgXBEwn4bKwBw cYwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=cIAbM81TgRijnEQwtJgoUaMxFip0i/gSQ8MrJbFN2zU=; b=Vx8YH6h0OeqDqNawTCueuVyKiAql1kqI0fASV7trBl25ag9tQdspMDl0fDQanAjMSp 6pMLbVsv7bMJMfXzIclp5TgPNtyrV1w/Z9210n+8j1m0METenIVk5ye28y1XKlQ8AByT hhdgcamQo3sT0rLq445FmPokIiOE0/aHGbFX2nul123f8r90/e0LtGY1K7D7kUUgxYlY xUJTLXGYM55oNDq4U9U8oge4NDBf1pBItimwGFTKwKJ/3FKGKuoDXPbWuxFbRrQBnzis yszSY8Fqp9iUEoWNJOPqey8VZsNIastWqW8X12jfPyB0bJUltsc22tX9icrKmURdKlgT M5nA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e10si7817385ejb.452.2021.04.12.04.33.35; Mon, 12 Apr 2021 04:33:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240388AbhDLLcS (ORCPT + 99 others); Mon, 12 Apr 2021 07:32:18 -0400 Received: from mx2.suse.de ([195.135.220.15]:49214 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237792AbhDLLcR (ORCPT ); Mon, 12 Apr 2021 07:32:17 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 1022BAE20; Mon, 12 Apr 2021 11:31:59 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id C89371F2B62; Mon, 12 Apr 2021 13:31:58 +0200 (CEST) Date: Mon, 12 Apr 2021 13:31:58 +0200 From: Jan Kara To: Hao Sun Cc: Jan Kara , linux-kernel@vger.kernel.org, jack@suse.com, linux-ext4@vger.kernel.org, tytso@mit.edu Subject: Re: More KCSAN data-race Reports Message-ID: <20210412113158.GA4679@quack2.suse.cz> References: <20210412090212.GA31090@quack2.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 12-04-21 18:42:58, Hao Sun wrote: > Jan Kara 于2021年4月12日周一 下午5:02写道: > > > > Hello, > > > > On Sun 11-04-21 11:42:05, Hao Sun wrote: > > > Since the last KCSAN report[1], I found two more KCSAN reports that > > > Syzbot had not reported. > > > Not sure if they are valid bugs, I hope the stack information in > > > reports can help you locate the problem. > > > Kernel config can be found in the attachment. > > > > Do we have symbolic decoding of the traces below? Because involved > > functions are really big so it's difficult to guess what KCSAN is > > complaining about... At least I wasn't able to guess it after looking into > > the stacktraces for a while. > > > Sorry, the log processing module of Fuzzer still has some logic bugs, > only some of the symbolized reports are stored in the disk. > Interestingly, however, the read-write end that causes data racing in > both reports are in the same location (fs/jbd2/commit.c:443), and this > information should help locate the problem. > > Partial symbolized report 1: > ================================================================== > BUG: KCSAN: data-race in ext4_mark_iloc_dirty / jbd2_journal_commit_transaction > read-write to 0xffff88804451d800 of 8 bytes by task 4821 on cpu 1: > jbd2_journal_commit_transaction+0x222/0x3200 fs/jbd2/commit.c:443 > kjournald2+0x253/0x470 fs/jbd2/journal.c:213 > kthread+0x1f0/0x220 kernel/kthread.c:292 > ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 OK, that is: journal->j_flags |= JBD2_FULL_COMMIT_ONGOING; So likely this is a complaint about j_flags update vs j_flags check race (we check for JBD2_ABORT flag) all around the code. So again this is harmless unless the compiler plays some devilish tricks and doesn't store bogus intermediate values in j_flags during RMW operations. Not sure how to deal with this one. Just putting data_race() here doesn't seem right - if the compiler does something unexpected, we are indeed in trouble. Maybe using bitops for j_flags would be beneficial for other reasons as well as silencing KCSAN. But it needs more thought. Honza -- Jan Kara SUSE Labs, CR