Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp5001356rwr; Sun, 23 Apr 2023 18:53:51 -0700 (PDT) X-Google-Smtp-Source: AKy350Zg4xi1oUSlTZGQeK0XQlawafyV6utuip17icGcyOH1TAsLSz/HCLtRD78tiiG0F5MxfIGG X-Received: by 2002:a17:90a:a381:b0:247:35f8:81d2 with SMTP id x1-20020a17090aa38100b0024735f881d2mr12574942pjp.29.1682301231405; Sun, 23 Apr 2023 18:53:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682301231; cv=none; d=google.com; s=arc-20160816; b=lXKIZHb0ZUfNxHtOCSiWYJhsYxE6W9thipe3xCVuK3u4W56mkJ8WbNQvn+Hpqbj5wB Lc7DgErEoKa5brSlQb653I3i4q3ylm99xfKb/UDl/UJ9xNsFLp1iaDldsnx7j1jyl5qQ IhLqSLLaJoFxLoT3VNf41JYzzytmzmF+iQm0DlluOwo/W6vwOhDuSMPBPiEkT2ORgDom x6Olaij3Eh1LcDpSukq2coMkQfjbZnZW39ot7ZHaKyalTqM+xHqL0eD73stqwS05vuC9 42AM2YCBxcWpFaxIUCgsn1Sog70g90M9YK9SNW6PHQN6+NZ1opJXanFPO381dYas3k3O MrUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=Z3CPkMSzwAbhUMhccX/SecXGK5HaNgE7BOlImvRESdo=; b=EdVMfD3v8ThG8tKrDTeuXiE5vQmraLRKtXidWKVnqiPjkuTl9BQD6/qDmCRDQ+ja0A /Z4QR+93UBDVCdkz8dwolBQqPiuOKn9AntPRV18gpuHMQTFG/i5SLKgZvOqGcAZZ+L5l rUbxZngALSRt3Ly647KAZdwEq6EXENcnzcq/mpMTKpmN0rfN3lyoNK66sY/iUf7AKsCx z3swCXa9BRQfPnwLr7AS9Ia145AcFUHMlMwIpG+mGdk+/TKQm10zAncfS2oelWEyQHIQ X6WPl5wu8QGKiFyApsK9stqzAl8bWEpZzEUawQP8HV5uHf181iPQ+tPAb0DaXSj02Ifc 9o+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t14-20020a6564ce000000b0051b9a71329fsi9325113pgv.360.2023.04.23.18.53.40; Sun, 23 Apr 2023 18:53:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229535AbjDWX4V (ORCPT + 99 others); Sun, 23 Apr 2023 19:56:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229476AbjDWX4S (ORCPT ); Sun, 23 Apr 2023 19:56:18 -0400 Received: from www262.sakura.ne.jp (www262.sakura.ne.jp [202.181.97.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8362110E7 for ; Sun, 23 Apr 2023 16:56:16 -0700 (PDT) Received: from fsav111.sakura.ne.jp (fsav111.sakura.ne.jp [27.133.134.238]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id 33NNu04H062661; Mon, 24 Apr 2023 08:56:00 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav111.sakura.ne.jp (F-Secure/fsigk_smtp/550/fsav111.sakura.ne.jp); Mon, 24 Apr 2023 08:56:00 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/fsav111.sakura.ne.jp) Received: from [192.168.1.6] (M106072142033.v4.enabler.ne.jp [106.72.142.33]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id 33NNu0Ic062658 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NO); Mon, 24 Apr 2023 08:56:00 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Message-ID: Date: Mon, 24 Apr 2023 08:55:58 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [syzbot] [kernel?] KCSAN: data-race in __fput / __tty_hangup (4) Content-Language: en-US To: Al Viro Cc: Dmitry Vyukov , syzbot , Greg Kroah-Hartman , Jiri Slaby , linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com References: <00000000000013aaac05f9d44e7a@google.com> <6ff6fdea-c955-f9dd-289e-b0d613a28280@I-love.SAKURA.ne.jp> <20230423233433.GF3390869@ZenIV> From: Tetsuo Handa In-Reply-To: <20230423233433.GF3390869@ZenIV> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,NICE_REPLY_A, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023/04/24 8:34, Al Viro wrote: > As for the original report - add a (failing) ->splice_read() in hung_ut_tty_fops > to deal with the original problem. Yes, adding a dummy splice_read callback is OK for avoiding NULL pointer dereference. But we need more changes for avoiding KCSAN race reporting. Are you OK with https://lkml.kernel.org/r/6bec279c-07b3-d6f1-0860-4d6b136a2025@I-love.SAKURA.ne.jp which will require touching so many locations ? If you want tty layer handle this race without rewriting all f_op dereferences, we would need to replace filp->f_op = &hung_up_tty_fops; with data_race(filp->some_flags_for_tty = true); rather than data_race(filp->f_op = &hung_up_tty_fops); and check if (data_race(filp->some_flags_for_tty)) { return error; } from each "struct tty_operations" callback function.