Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp13466imm; Tue, 24 Jul 2018 13:04:04 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeeIFK4l+cZOak08Ss/ItiP9Ra7ZCT+wE5seeT535AAfg+77LgQcORM+f2f9DtjpPoHgWW5 X-Received: by 2002:a62:e18:: with SMTP id w24-v6mr19145476pfi.145.1532462644937; Tue, 24 Jul 2018 13:04:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532462644; cv=none; d=google.com; s=arc-20160816; b=akLSn1+LQnZRgNRed7Avmv3Cg2D9wNAl8AVs8HOHT7NtUL8mWfJHVZ/2apn9dM8f57 Yn6N5sF76pWWcW3gbhhuMfe8deDUzVoL5YY2fDlCQF/Jbue7cGwIvvF0QS8I/dewL9sJ FakFLJzlWC2QOVPsdF4xGDitgECAIW5nZfkJtn7cJ/QhMTFQi+EYIFEAVzi0ywu+cMJx fEjD5cJFS+pvCcWRoc/KXkP0s4aXBxp3R8bfPyNAiW8jO05UonnTPaoa7NxyDEYIP9R5 mp07HtAZQyK/Iuylv3k+HUSZlK0DowmZHXw6VwkLN3AgBCkjtUedOgaPxTC8Jc8aOXWI U7Fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=fxyppTkMfFGXpvvAHvd5Vl07SMUO+rXqR7ekmXh1EDI=; b=NrRv4pfi6NRh5XuNwV2EjCX7CdOpRBJV+EIz73yoC+Mp2RVh9FfrIwTKpFZjUxSvFa iOmhiC8Qy9ceLpbXf67NSXl/kL4CobLHGc7bTpexAU6bHxki4yUgvHbHV+DdTZwTErGt wtkqoKjQ13SQbTiC9pTEa79bUGtPTWWoC1sXJpq+DkzDD3h6TXNCHnPo1xMpJFj2zUwC rCVB9heUVa8I+E7ZtGsr3R67/VaMR2lq0t1q83+LlXNZeJZ4GbosJq4/5N7p2P3OcIYz AXO5nPqsn4GjzhlIfYToM5JVs4t6g/5YokpPCp+w7b5lx8BsClpk9xmPfYGQ2rAiZofW 6luw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=SVsdpxZb; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y186-v6si12106197pgb.395.2018.07.24.13.03.48; Tue, 24 Jul 2018 13:04:04 -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; dkim=pass header.i=@chromium.org header.s=google header.b=SVsdpxZb; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388651AbeGXVKe (ORCPT + 99 others); Tue, 24 Jul 2018 17:10:34 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:43086 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388587AbeGXVKe (ORCPT ); Tue, 24 Jul 2018 17:10:34 -0400 Received: by mail-pl0-f66.google.com with SMTP id x6-v6so540364plv.10 for ; Tue, 24 Jul 2018 13:02:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=fxyppTkMfFGXpvvAHvd5Vl07SMUO+rXqR7ekmXh1EDI=; b=SVsdpxZbj1xpQ0UXU1GE9rGZycYrRiCsUcBGcqe/L9YfYjqYJA9wLZYLhJBLeD6R9b oeY+2d2I8u86DD1pWGxfASTBP/naBlowKSBAhzq9GoGhKr8M1xTQ48GX+GGBD0cHOHJF EaUdoqVsFwR86MczKwN+jwW5ctEEBXRXlH9HM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=fxyppTkMfFGXpvvAHvd5Vl07SMUO+rXqR7ekmXh1EDI=; b=Z3cc5Wd6H/2t5r3GdEpQNcSb6QsYnaDyJIgWlwutNoirZr+2WgLT6S1zBqOrQ17c8Q Gm8n2DlKgs1ADIKb5meSrZej/xD1tWcBazNoAr+NkwMcNQ2B52h/Wjr8CjSocUf9+iDl 8mxZ424BOFaMbUExcR7t1rGfvaV2llC2gsF1qxaOq9vuIBujTTSy38UXZcKM4u2kx6Xk OqCvLsfbFntHqvehdAjXJFanKjm5nwZrfdRfDWK8oAvLMOWrB3AWPVl81SX1IESpUmvK EIZMd05UwVeSur8e8GbzJOgZ82VjHvsOJEspKHLXvIvWtd/9X5GU80XRdUqxC8Q49aIN QSAw== X-Gm-Message-State: AOUpUlHjNsaBTQZew4TFKdAqAJGugewYoygAHax1pfvGGE+iBz6+LTru e8oMKkYUEmhb7RtW2D12Daujo3B+w0w= X-Received: by 2002:a17:902:7106:: with SMTP id a6-v6mr18707542pll.28.1532462549831; Tue, 24 Jul 2018 13:02:29 -0700 (PDT) Received: from zsmcros.c.googlers.com.com (235.153.227.35.bc.googleusercontent.com. [35.227.153.235]) by smtp.googlemail.com with ESMTPSA id y3-v6sm22429009pfi.24.2018.07.24.13.02.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Jul 2018 13:02:28 -0700 (PDT) From: Zubin Mithra To: linux-kernel@vger.kernel.org Cc: keescook@chromium.org, groeck@chromium.org, zsm@chromium.org Subject: [PATCH] tracefs: Annotate tracefs_ops with __ro_after_init Date: Tue, 24 Jul 2018 16:02:14 -0400 Message-Id: <20180724200214.95975-1-zsm@chromium.org> X-Mailer: git-send-email 2.18.0.233.g985f88cf7e-goog Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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). Signed-off-by: Zubin Mithra Reviewed-by: Kees Cook --- 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