Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1476226lqm; Thu, 2 May 2024 16:54:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUA/2oJZ2SMFYn3ALkmr0UQa/+bvZ2uRe8Buc8qUpAG9mm34XcDcjNb2qXvQrnhdLTkl5Td12arxZ21LQoczMAcjrASjDE8e7zAwaalFA== X-Google-Smtp-Source: AGHT+IHDcqrKJyrHRpmezxB8DWTkffdIOJKfGvk7GW6qk1wooFNWS98wPBiaCRmR/tJiFGoDhWt9 X-Received: by 2002:a17:90b:684:b0:2af:42ce:54f with SMTP id m4-20020a17090b068400b002af42ce054fmr6339303pjz.6.1714694090739; Thu, 02 May 2024 16:54:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714694090; cv=pass; d=google.com; s=arc-20160816; b=Wy2uK4/7xufH0B3P2iLMLm9tBcb1hu3SRQWKLTYpzQDu0d2FdCoAcS2+7O2GktYgZq ncUVAXf6n+9IEZPLPkMnZxeS87YLn9a026+RQ/I/v0zstnlyS6FIxl3D6ORcA5iKo3pb q7HC1Nvmb265YjThOkjiZ+bvs4hNovkiWzSTJ0mp2AJJBKgdRm50g8pnPqBiTMHNSKS6 zJ8He4dcFFS06oGw5NKWlx3uZemZSVP1Sk6SyxJ30NomeCz3GgFEmbhuLRbD2rcDmHn6 wqIDPvILStS01bOFvWNJqK6OzHm2inOltCwIRu0TD+1y5lhVTua1KPinH+KyWCC37PZt /8mA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=YNRMSGG7bMtLrlxPQiJj9+wxUDnBJEj1vFRQJyWTBLQ=; fh=wlwCPYy7lJ4dMnKtIFxflIUSSCA9VmcBNXAFld0FfmI=; b=ICFQfSDz/vn8tK6YI+a/wHNJBhpRzeOgBZ86Fe631airSFAOfTWtOagPUCGVd6z2yC m5n9vxMDMxrWcd8XmTZHxMywlNGkBJMkoZlvtlluBDGaVgkIZ9xejcylJkDkyani1R6X ZOKx2Xh5JtJ1FY/pxEE5YVGMZGijT+TsUX3qptjHWD55vsoBBzdWKDSirYeD1H6P3kxq PsDJmIljR1kMWQn6fBKukiAggWzqlLtBU42Y4WWwvajsdpKt/JlEIlwynAA3xW7iTVWT nOxNq8AugXUsOBIMvR83EuCnoY3AUp6rs4JlhLckDBvTKXwrOKjGL37W+aCKJiwYyGvY 3fSA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=i-love.sakura.ne.jp); spf=pass (google.com: domain of linux-kernel+bounces-167081-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167081-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id s4-20020a63dc04000000b0061a13c6902csi1810239pgg.698.2024.05.02.16.54.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 16:54:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-167081-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=i-love.sakura.ne.jp); spf=pass (google.com: domain of linux-kernel+bounces-167081-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167081-linux.lists.archive=gmail.com@vger.kernel.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 273D9284558 for ; Thu, 2 May 2024 23:54:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4072315887B; Thu, 2 May 2024 23:54:45 +0000 (UTC) Received: from www262.sakura.ne.jp (www262.sakura.ne.jp [202.181.97.72]) (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 75EF01C683 for ; Thu, 2 May 2024 23:54:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.181.97.72 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714694084; cv=none; b=omjPlJAQMHgY1Gm3SRygAgx26xnF5iIFz7bjQhrr5JOazGUE7tAX4UkjBAnne8ukqRhDCeF3Jjx9SO+1NXNEYx2w5hLqv2tL1DB/66vokEErDlvOmCxf+C+T+IEObryfOmP0d7GtT7v57okwzrabmXlWhHZfdeDyGUE9rp/xPwg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714694084; c=relaxed/simple; bh=R7zvqIEVHCQucEkuQis7KHQ9EfpPJDpzAXpo8fb2NtI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=DVMFeSBQfDwnPn51BaOKhd9bnbMVyONZ9KiC8zm31TWWK8c6Nt9nYsNyQuvxqqirm5Gzv/mkz8731V/sDXPoS0rJ3tVltHzzsxkmwdTwAsTNpvp+u7FKZTQgldP/dD4g0crYqGXuR0mjLN1Thg3LvZ/KyQIRGnduxvROdq+7b30= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=I-love.SAKURA.ne.jp; spf=pass smtp.mailfrom=I-love.SAKURA.ne.jp; arc=none smtp.client-ip=202.181.97.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=I-love.SAKURA.ne.jp Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=I-love.SAKURA.ne.jp Received: from fsav313.sakura.ne.jp (fsav313.sakura.ne.jp [153.120.85.144]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id 442NsBtJ085623; Fri, 3 May 2024 08:54:11 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav313.sakura.ne.jp (F-Secure/fsigk_smtp/550/fsav313.sakura.ne.jp); Fri, 03 May 2024 08:54:11 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/fsav313.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 442NsAgW085620 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NO); Fri, 3 May 2024 08:54:11 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Message-ID: <5125d9ac-32d5-476d-82cc-b57d4e5d0807@I-love.SAKURA.ne.jp> Date: Fri, 3 May 2024 08:54:10 +0900 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3] tty: tty_io: remove hung_up_tty_fops To: Linus Torvalds Cc: Marco Elver , paulmck@kernel.org, Greg Kroah-Hartman , Dmitry Vyukov , syzbot , linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com, Nathan Chancellor , Arnd Bergmann , Al Viro , Jiri Slaby References: <8edbd558-a05f-c775-4d0c-09367e688682@I-love.SAKURA.ne.jp> <18a58415-4aa9-4cba-97d2-b70384407313@I-love.SAKURA.ne.jp> <892324fc-9b75-4e8a-b3b6-cf3c5b4c3506@paulmck-laptop> Content-Language: en-US From: Tetsuo Handa In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 2024/05/03 2:29, Linus Torvalds wrote: >> Hmm, debugfs assumes that f_op does not change? >> >> fs/debugfs/file.c: In function 'full_proxy_release': >> fs/debugfs/file.c:357:45: warning: initialization discards 'volatile' qualifier from pointer target type [-Wdiscarded-qualifiers] >> const struct file_operations *proxy_fops = filp->f_op; >> ^~~~ > > This error is a direct result of placing the __data_racy in the wrong place. Oops. But it seems to me that the problem is that > > It's not that the _result_ of reading filp->f_op is racy. It's the > read of filp->f_op itself that is. debugfs (or maybe any filesystems that wraps f_op) caches filp->f_op into private data struct debugfs_fsdata { const struct file_operations *real_fops; // <= may not be up to dated? (...snip...) } and cannot update cached real_fops value when filp->f_op = &hung_up_tty_fops; or mfile->file->f_op = &snd_shutdown_f_ops; is called. Such filesystems need to be updated to cache "struct file *" rather than "struct file_operations *" ?