Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1303854lqm; Thu, 2 May 2024 10:30:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUnHyhXNd2PJftLWsn9MJ1Wao6a22S3irgSSOYMtstfNM4CnNT4G8DpEHTFqKb0q04/pFIg0hO8PpaMuasi/K6nJQxxbEckduxh5J/0GQ== X-Google-Smtp-Source: AGHT+IGZsGitdTrkPOFxBimsq5R/AKf6/nOqytWkj8XllzhKajdz3HNXSL4c0QNL/dOpwlv5PKCU X-Received: by 2002:a05:622a:2a05:b0:43c:7c7f:97b0 with SMTP id hc5-20020a05622a2a0500b0043c7c7f97b0mr212521qtb.42.1714671023263; Thu, 02 May 2024 10:30:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714671023; cv=pass; d=google.com; s=arc-20160816; b=PoZF2pzq5X3B+tKTSKYulsZVcB99AMA8tzO4PO6AzAZU+9evmiWyTPblCzXjmQgngO OuPf2uUf/Oj75NBBSE/hqw9vJ0v4/CIb9CydsCHKeO+r/SgnSS6++iRhfFgxHNh0j7fG iD2o6QUB0o3YUza0ITPtxFULfpFbrTsbGZ/JtHdOa5SJc3F0dN1luXPWm4Fc5GCeTqDt QHEZGqxaOjAdJtn/rv/djpoUQKAUs/H2Muom0NQCHCnO5smlLOPwpFvDHd95o0AJs/ds 7VpKwcF9LHOOepmxh+7gqAotvMx7n98kP+7fcDCz4j1VmFECX+4Q4gSvXn7ibyoiosnu ecig== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=al/XALPvGZ6wbzrZ3ZXTgtodLl0MJe+M6+JN32CWI4g=; fh=4x210wR4MMkLo7JMho8GUggkLM0ygp65/7qneRqREXk=; b=0iLyawGELK9ZM4RygMCiDxm3qnLpt2WGRxO5gliB7BLmqCfiFVjODFhvgALz3VcQA3 GE/GYVkGsR1T2+Asuj/HgJmWJjPxtJD+G91qqrc15Yp3MjlZg+EQ0erVl2up9q6zraEe GOPxEmJeUmgXKakPtx+Hoa9H5T1muicT1AYVk6cJBzPOYEQyOTZY9zXXaFgpsGhfrRph RD3EnTeuM1nJnMUr5lX/VsRTEZve8dT/hZSbDlQ5MbO9cFErqagtK2WvJjC5qj+nMWgW QLs1z6gvJZ0Jb4o6To8YqmktHsNCB515YOj4qdnNqx0nRw7caZya4CNmWcLGMcIOEqEV J4Fg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=DBnAz794; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-166791-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166791-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id z17-20020ac87f91000000b0043adb75e8b7si1449507qtj.399.2024.05.02.10.30.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 10:30:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-166791-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=DBnAz794; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-166791-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166791-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id D9D431C22415 for ; Thu, 2 May 2024 17:30:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 93E9316FF43; Thu, 2 May 2024 17:30:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="DBnAz794" Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A535016FF39 for ; Thu, 2 May 2024 17:30:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714671014; cv=none; b=INnMyhMlvq4OurDw8mtGsrag3KZT5VpFNEAlHicEGMx1miEd5T/6eCWW7DVVjP15Z0hEArRukFkz15u7x93e+vEcxpLEwMoP0C37e3YygEHjIf0MtL071vGQh5kF6TNSo0w/AdYqFvBlhlK7wm/fHvlZAiJswk+CU2+jWcJ6Q7w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714671014; c=relaxed/simple; bh=J2ZneBvOCmv6w7g5DfFYRHZ0EG8iANH8HJsLT/96dgY=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=thOiYcsZa7f97yvWlfkiscTlFxWyY/3LDkkQmIH6WUCGmw0fenTKYhLVEWSbCLh9skuI8olzaFuKjtMjr4A4J5u5aqDAS5A/o4eKN/BVL/2ot/L973DaWWo5yXzYZoNghIB/APSpZRmPpm6GnZO/6z3kFUfsQWXRJi4w5H5syC0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org; spf=pass smtp.mailfrom=linuxfoundation.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=DBnAz794; arc=none smtp.client-ip=209.85.218.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linuxfoundation.org Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-a595199cb9bso295312366b.3 for ; Thu, 02 May 2024 10:30:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1714671011; x=1715275811; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=al/XALPvGZ6wbzrZ3ZXTgtodLl0MJe+M6+JN32CWI4g=; b=DBnAz794yQjRTtVHHNPouRuBydlw8bShuJy6YPB8uK7do50ftdHT3lySKIkJxjKmq+ BYGZuwAhI+z7/wxBWtgPqtjsF69rAL7BQ5NArXTdZtA+e6f3AKvygI9XMw1SN/rZ0LGz KFl4r70StG9WkAW9uEEdKwJmoAdbbh8Aaj8jg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714671011; x=1715275811; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=al/XALPvGZ6wbzrZ3ZXTgtodLl0MJe+M6+JN32CWI4g=; b=q3YXUQfMZaLRJuylMb+IjowPoP6Fgs1zB2J8JwJ+x1rOLT8gZa36Ahc0xMBFLgMEpZ 2+XpZYQQaFn8VR3sKkYSE46b78TK083PXwcZA00aj2Ad5pdgNciElThO855YWZaPeZkT 61ZdSgdxBhw/O8PVw4gfUbLryfgUz2LJC/dtWKf5lqTIXgIoGeX550mvAL10oVlnD7pZ CR5tlduabu9LG274jioAS7hjaJu6VBPkC94uMVwS4PxxpKLi9bnqC1fIPGAA/NSds36n yrbfsPWfEEBZsYK4RfLlWC3HhtPnzyZvWYCgtWePIrF72Q/tPBS8+lNBruvQZJrzW9XX 516w== X-Forwarded-Encrypted: i=1; AJvYcCU2lO2SVQ2DFUgd8NwomHMUhNcm/f1Ghc8Ct0/0EvKRQ75K5ZDMRsHUPIusYV7fUjobkECrtQM/577w53UDrICZI3I54QNGISXHRZbh X-Gm-Message-State: AOJu0YwPkmXv+mVqZ35yAdynd2QrR6IOZDPc3V2IYBwYJftYqO7q6m3D SbwCHH2x8/sDtQyJbLBVY8PMMoWDuh6lB9ysu53KgvnAgvOAm1QfqVFEt8qxwDkpZRWjyxmRjhR hgnTigg== X-Received: by 2002:a50:9549:0:b0:572:78df:c606 with SMTP id v9-20020a509549000000b0057278dfc606mr72373eda.26.1714671010906; Thu, 02 May 2024 10:30:10 -0700 (PDT) Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com. [209.85.218.46]) by smtp.gmail.com with ESMTPSA id d17-20020a056402517100b0056fe755f1e6sm724906ede.91.2024.05.02.10.30.09 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 May 2024 10:30:10 -0700 (PDT) Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-a596cb8a7dbso194866166b.1 for ; Thu, 02 May 2024 10:30:09 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCU95FeFqLu4RiyMRQus0crKp9QE/aEx1gXWPus5Cx6HrwROvlkv0Z9LfbSVM2nYlz8pjz9uL6NrEL7xNqL8OQCbxDdvR7Cxg2opR1PG X-Received: by 2002:a17:906:4a09:b0:a59:6dc8:6e9 with SMTP id w9-20020a1709064a0900b00a596dc806e9mr105065eju.24.1714671009446; Thu, 02 May 2024 10:30:09 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <8edbd558-a05f-c775-4d0c-09367e688682@I-love.SAKURA.ne.jp> <2023053048-saved-undated-9adf@gregkh> <18a58415-4aa9-4cba-97d2-b70384407313@I-love.SAKURA.ne.jp> <892324fc-9b75-4e8a-b3b6-cf3c5b4c3506@paulmck-laptop> In-Reply-To: From: Linus Torvalds Date: Thu, 2 May 2024 10:29:52 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3] tty: tty_io: remove hung_up_tty_fops To: Tetsuo Handa 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 Content-Type: text/plain; charset="UTF-8" On Thu, 2 May 2024 at 09:42, Tetsuo Handa wrote: > > OK if below change is acceptable. > > --- a/include/linux/fs.h > +++ b/include/linux/fs.h > @@ -1012,7 +1012,7 @@ struct file { > struct file_ra_state f_ra; > struct path f_path; > struct inode *f_inode; /* cached value */ > - const struct file_operations *f_op; > + const __data_racy struct file_operations *f_op; No, this is very wrong. It's not the *pointer* that is __data_racy. It's the structure *fied*. So that should be const struct file_operations *__data_racy f_op; which is very different. > 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. It's not that the _result_ of reading filp->f_op is racy. It's the read of filp->f_op itself that is. Yes, this is unusual. The *common* thing is to mark pointers as being volatile. But this really is something entirely different from that. Linus