Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp215013rdb; Sat, 30 Sep 2023 01:20:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEnMms0Nv9506jL1Rulwt0Ayu2vk3aZG3HDku+yqL+Qb8B6nLSrYhgHNvCqMjon60j+8UY3 X-Received: by 2002:a17:902:ea0a:b0:1bb:598a:14e5 with SMTP id s10-20020a170902ea0a00b001bb598a14e5mr7745234plg.43.1696062044120; Sat, 30 Sep 2023 01:20:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696062044; cv=none; d=google.com; s=arc-20160816; b=taPlbG0445o3Vh6KP79wKjdHQWvnJpPjZuBRN7k9LJ4ShKBF+SvTZSbiVmJB05t5ip 8sr/P3eNQohf6FxTLbgvhgV4NuPeqbq0KsjajRw9+WwFnJvKpUwNhn6u9aCvxOCQM2wx bUpbRtR47vHyPwSWPLlrUM5+d6UbaOpgsN86dz8ag7j3H6dhaEYKeepYGLkE2wTjnyyX 6/3jHEPlRPII+UnDa2GWEaTHbsRjXOCMeZzAOAX5yEyFCCX3vWSXe9m5tD5390AqY+13 Lf40s7lH/QhWleOZV7ghod6XeUX70ODHuWjeu1rphZEOIFssiqnImk++rTgUUiWNe558 J2Og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=sWwX1MjDa5FGmsQKrAkRxhx462UR+5GB5fgvAVZzAwA=; fh=/69G5QMXG6ouAniOSC1WEMRaWJCjt/ndyb8jzlvyocY=; b=uZebLfd3F1xWcatN6GL82EZwvuRTLN74+HtczHf5LRaGlajiGhNQ/4V4TdUPNqB3tI u5iWkkhPTHQx+TzpxZJkTKnKKrURNvVHMVKs+hdbwij45U1+Eal+ud/BAFdAm/ojh7qK 5cdAf8msAI5MeUaZJDIJvNHY+DxZgf0mNXLRsuTuQ3qIboMb1e+aKyBXP4Yet2jIL7Vo SPIUo4x6zowRfgDI9yFVXfu7hgd7/uO72u95jrq4XhAVm6rLKVau1KGnQi9Ac0uvZljS xnYBwO2Ne+yuGdAVBZI6DEi+T5bNdLV8C6EQtke6wPPFnhT9+zmhC2elHPEPZcKXpxIp V+UA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=JVnbZxN4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id j21-20020a170902c3d500b001c72c893ac9si7329054plj.104.2023.09.30.01.20.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Sep 2023 01:20:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=JVnbZxN4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 7BBBB80765FE; Fri, 29 Sep 2023 22:06:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234238AbjI3FER (ORCPT + 99 others); Sat, 30 Sep 2023 01:04:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234206AbjI3FDl (ORCPT ); Sat, 30 Sep 2023 01:03:41 -0400 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 362F1CC3; Fri, 29 Sep 2023 22:02:24 -0700 (PDT) Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1c724577e1fso48053185ad.0; Fri, 29 Sep 2023 22:02:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696050144; x=1696654944; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sWwX1MjDa5FGmsQKrAkRxhx462UR+5GB5fgvAVZzAwA=; b=JVnbZxN4OTRqCD7cNE0PHFfiwZHl6nDh76sQjP5LQ8bvAU/TxOr0svsg8D5uZdsfIJ lI5Sek6rV44djNuSL6c54gHgb5zQsWHsssN+tqOa8+/MzOdf0d4jO0mlcJL9gB2dwj/L hq8yLtd5Y1G7Ww0t9Ni18YTxBEsk8IRMnJwhFHCXkzGAILl4X+bkm70cZGyLX6eKVHcn 7M9n1/utbQ7eFzWRexkIr3vMH5i1p7XApbYteMmrp3wedkc7RsCL+nI4uPE4mW4Uidvs QNa4uiv17c7qnnrqSCDteOSUlkXMZ4yF5r1gkSLC7A1XAOaW7TVkSZqeniKV8re9MR1z AHqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696050144; x=1696654944; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sWwX1MjDa5FGmsQKrAkRxhx462UR+5GB5fgvAVZzAwA=; b=XDVWZGskamCFow1Gfbro9Whu51lwBJRhqMQyW1KBOhGPSAEAhqQaw1nU9/RDWPzaob T1NJ/nyzwAcQ83+PUcSHbIMidvDiRSy4qlKQoebAvZoSHhnY3hiHeC+TZ/sTCjnsD4AB pi1ok7TMFLZqtFZpsf7vSnyV5Z3A/G7ekbitDZr78ByLDtO5FeP9M1tV0WvfXORirYbs 1Hr78niIttFzcn9ccRBDlJsSaLZwC9dIlZGQQeS07Yw8q6hBpMR2p6JPRSniJ2HbkdgE 46VBV3zGiyirCqRm58sJez2LWplSvrwtaXtD+hUbmkem1uKOXnLq40WSncvTflOSpdu4 1gjQ== X-Gm-Message-State: AOJu0YxIEuBe6Q/yfpYxSeXv7I57zN4bCxIWyK8t3/FJrq/uuBP4xeZv a5ZsZDzjJyUbfeqdwnhwzYJtVdsnrdeLfw== X-Received: by 2002:a17:903:25ce:b0:1c6:25c3:13d3 with SMTP id jc14-20020a17090325ce00b001c625c313d3mr5649024plb.6.1696050143991; Fri, 29 Sep 2023 22:02:23 -0700 (PDT) Received: from wedsonaf-dev.home.lan ([189.124.190.154]) by smtp.googlemail.com with ESMTPSA id y10-20020a17090322ca00b001c322a41188sm392136plg.117.2023.09.29.22.02.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 22:02:23 -0700 (PDT) From: Wedson Almeida Filho To: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Wedson Almeida Filho , "Darrick J. Wong" , linux-xfs@vger.kernel.org Subject: [PATCH 26/29] xfs: move xfs_xattr_handlers to .rodata Date: Sat, 30 Sep 2023 02:00:30 -0300 Message-Id: <20230930050033.41174-27-wedsonaf@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230930050033.41174-1-wedsonaf@gmail.com> References: <20230930050033.41174-1-wedsonaf@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Fri, 29 Sep 2023 22:06:06 -0700 (PDT) From: Wedson Almeida Filho This makes it harder for accidental or malicious changes to xfs_xattr_handlers at runtime. Cc: "Darrick J. Wong" Cc: linux-xfs@vger.kernel.org Signed-off-by: Wedson Almeida Filho --- fs/xfs/xfs_xattr.c | 2 +- fs/xfs/xfs_xattr.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/xfs/xfs_xattr.c b/fs/xfs/xfs_xattr.c index 43e5c219aaed..77418bcd6f3a 100644 --- a/fs/xfs/xfs_xattr.c +++ b/fs/xfs/xfs_xattr.c @@ -175,7 +175,7 @@ static const struct xattr_handler xfs_xattr_security_handler = { .set = xfs_xattr_set, }; -const struct xattr_handler *xfs_xattr_handlers[] = { +const struct xattr_handler * const xfs_xattr_handlers[] = { &xfs_xattr_user_handler, &xfs_xattr_trusted_handler, &xfs_xattr_security_handler, diff --git a/fs/xfs/xfs_xattr.h b/fs/xfs/xfs_xattr.h index 2b09133b1b9b..cec766cad26c 100644 --- a/fs/xfs/xfs_xattr.h +++ b/fs/xfs/xfs_xattr.h @@ -8,6 +8,6 @@ int xfs_attr_change(struct xfs_da_args *args); -extern const struct xattr_handler *xfs_xattr_handlers[]; +extern const struct xattr_handler * const xfs_xattr_handlers[]; #endif /* __XFS_XATTR_H__ */ -- 2.34.1