Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp139303imm; Tue, 24 Jul 2018 15:40:47 -0700 (PDT) X-Google-Smtp-Source: AAOMgpehhd7oRIX3Zkerotogpr0LkvvNjwD58Z/a3dMBDjWDf1uRmrACVcPfA1PM+HVSJ4/cMekP X-Received: by 2002:a17:902:7147:: with SMTP id u7-v6mr18371400plm.154.1532472047059; Tue, 24 Jul 2018 15:40:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532472047; cv=none; d=google.com; s=arc-20160816; b=mHIT3FB4fJoyM6WfhbMxPjFpx5+SJ988nUzR5p+1+yJNIcW8sVk8fIQqABFd++Em+0 yKnLlaBBT0/HFseuD2wzLaxhjkPWlt8/PGR/Mkdjw2kIoCUR7GbutJHAqljnwZYJiJS+ iYJKcR1AhBG4NkSXvzgby6TdAz1A64ZNYd2kJSk2FzH9yq1AZwECLrjWbdMf8Rf7Uapx DvscWoOvjf7XW4RKRtX83/n00aiZ/+AbKDTk3hep5VJ2h5nBo5UCmM51/m54gcnEnCAH /G1bI+m1qfqaaJ7x5jGisS4ngIJqG1oSxZ0Kp8UoLrSiS9UyF1r0KvfYz4zXiQ40EnIQ GTFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=unvyCL1cRWQmuDqhM3knyChAglxxwXMSyO6BjjIwdtQ=; b=l1pc9EEpYer9S/nCoy5EaUWj+3drgIxgXdqS+aLLNikAK5Rg96rYQAP1O5Pg2E1hmb A60Wd0FT+I/WV1IPn7sd6lAWCuBrWPcSyfDekbxzU6nwn6hiadJMgceUzqx78ly3APwJ LwON8bwN4ckNxt6WUeyblAVyn0iiZ19ytOfIb3WpYwzgodOdnUh1WOXvgUiG+PpyWfDg JWSMvmf7iAqf75DzPdo1qX1beiSFKn5q3GY4b/px3p8hMUQZMQ5oZKzoYdWcpjZWkyYk kgQSo5UcsJ9KEprEBNM6OlCtHER8L5nH0P7L94rfIQYjcz9ABC1RLcScNJHD/rWFo4Uh AZTg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y5-v6si11832259pgc.493.2018.07.24.15.40.32; Tue, 24 Jul 2018 15:40:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389012AbeGXXsM (ORCPT + 99 others); Tue, 24 Jul 2018 19:48:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:54268 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388945AbeGXXsL (ORCPT ); Tue, 24 Jul 2018 19:48:11 -0400 Received: from gandalf.local.home (cpe-66-24-56-78.stny.res.rr.com [66.24.56.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A9EB220852; Tue, 24 Jul 2018 22:39:31 +0000 (UTC) Date: Tue, 24 Jul 2018 18:39:30 -0400 From: Steven Rostedt To: Kees Cook Cc: Zubin Mithra , LKML , Guenter Roeck , Al Viro Subject: Re: [PATCH] tracefs: Annotate tracefs_ops with __ro_after_init Message-ID: <20180724183930.1ac4bcd0@gandalf.local.home> In-Reply-To: References: <20180724200214.95975-1-zsm@chromium.org> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 24 Jul 2018 15:07:18 -0700 Kees Cook wrote: > Adding Steven (maintainer) and Al (fs) to CC... Thanks, first I've seen of this. > > On Tue, Jul 24, 2018 at 1:02 PM, Zubin Mithra wrote: > > tracefs_ops is initialized inside tracefs_create_instance_dir and not > > modified after. tracefs_create_instance_dir allows for initialization > > only once, and is called from create_trace_instances(marked __init), > > which is called from tracer_init_tracefs(marked __init). Then, especially with this change, we should mark tracefs_create_instance_dir() as init, as it would fail any other time. > > > > Signed-off-by: Zubin Mithra > > Reviewed-by: Kees Cook > > Who's tree should this go through? I can take it or someone else can, and I'll ack it if need be. -- Steve > > Thanks! > > -Kees > > > --- > > fs/tracefs/inode.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/fs/tracefs/inode.c b/fs/tracefs/inode.c > > index bea8ad876bf9..20e965873f27 100644 > > --- a/fs/tracefs/inode.c > > +++ b/fs/tracefs/inode.c > > @@ -53,7 +53,7 @@ static const struct file_operations tracefs_file_operations = { > > static struct tracefs_dir_ops { > > int (*mkdir)(const char *name); > > int (*rmdir)(const char *name); > > -} tracefs_ops; > > +} tracefs_ops __ro_after_init; > > > > static char *get_dname(struct dentry *dentry) > > { > > -- > > 2.18.0.233.g985f88cf7e-goog > > > > >