From patchwork Sat Sep 30 05:00:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wedson Almeida Filho X-Patchwork-Id: 146881 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2a8e:b0:403:3b70:6f57 with SMTP id in14csp210024vqb; Fri, 29 Sep 2023 22:36:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGbcMxlSzSgMgqtwWcizA7W3tEtOrf/YUMyDXdPkCWb1RjDUFF4y5jnbrLk/2BFJ40Ly4c4 X-Received: by 2002:a05:620a:4486:b0:770:96a1:5580 with SMTP id x6-20020a05620a448600b0077096a15580mr6633961qkp.14.1696052201587; Fri, 29 Sep 2023 22:36:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696052201; cv=none; d=google.com; s=arc-20160816; b=dwkEMfhTk14RKxxP+Yq51Ipl+Z697Z0JmDbJD3MfFBa9M0C3EaFrkKDSpSFRDxeE9p t6BgBraP5Y6kE4wZsl55iCpUmkajL8GC4NPUDW3lIGoMhPBuyDyOsVScaX6V0GBAepJb 8uVgikP86hbKonb5mVkU8IcqqivKQAFgUkwgC+OpHjiDrciE7jCln+hxN/Tl6lUEkcXk UjcDisAscIwvojWFBK/RfNRqZb5MHVRUxSCQtbwqdoLR4smqJYGTrNQ0xoQSCrNnvCNH WKgv71YxuOH6Gzo8DTlVDeSMRA+1dgbJf42dGeTmFCaCNBiHHlUz/CgbcuSJNKLSKrTc /Ujg== 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=YvbnXtkeP9vLNSIc1O3qas9xHaLQIqu8ISSeZ0t4O0M=; fh=SK2xQ5WvE6tbwSQN9TMkRjbkm0hotbQhx6y1kSOUb0Q=; b=bo5QFYUG+/+N6evYRoQWV+KQaI4EUCRQQtMKIh7TtjOToavKCphTcfE0PQU0QOCFxo bDEfpvUsyq7npdTlyPDCz8ussGhcAzL83Epd9NHFj5KPwLXRrmxzOV/K9WMBXOgu2Ls6 UmTzkmD5CAQsb+w2gM1PzNuEvHGr4FEgYcye0DC/Alss7iVI2T64FrMuYXNmteenefZt ZqC2QxmVzG7+miolBBDSXDx36s4AieIijsXgdrmVWIYl45+l95/52t/w0Px4AH2W1/E5 6Elq8Vw2w2rkxFXH92cZkdB1+NS1xFQvR0/zFTrSBgcdPZpVKqfxnAGM2I3Dv8kUUf+P n9EA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=WR4dBCwq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id m21-20020a656a15000000b00578b9fb24f6si25248032pgu.616.2023.09.29.22.36.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 22:36:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=WR4dBCwq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 804398319230; Fri, 29 Sep 2023 22:03:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234167AbjI3FCt (ORCPT + 19 others); Sat, 30 Sep 2023 01:02:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234171AbjI3FBx (ORCPT ); Sat, 30 Sep 2023 01:01:53 -0400 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D6E2CE6; Fri, 29 Sep 2023 22:01:43 -0700 (PDT) Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1c61bde0b4bso90823145ad.3; Fri, 29 Sep 2023 22:01:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696050103; x=1696654903; 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=YvbnXtkeP9vLNSIc1O3qas9xHaLQIqu8ISSeZ0t4O0M=; b=WR4dBCwqwdsx8Zi6fJhEwjZBXszFELf+jxpKQoDJlszfZ1N+ref7hEoS/7yiUtSdCJ KZKZsenU9t7s1aYxZWobCH83vle/GqEaJpxGpwB4NHMOlGdqP6Xnm9RDrrDMjIHOMNYh kRWX4It7l7W+aQ0f9UQhzzRm4x1e3oAR+tRnZoDuNuCwWeVgOpWSe6y1I+oqdQaHD2RE lA9IMNa1NImMxs6PrwIk1IZJNNgrnccjEYPvq8DBzGWp4geffLNzJ2lCYEbPq43gK80T x0t4AZDZ3hBo4PQvuTvokTYV2wbhrX6j/qAgJ45a5Cw3EMKkwiNcGw1Vy+Oa/zIcCXuL 4aZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696050103; x=1696654903; 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=YvbnXtkeP9vLNSIc1O3qas9xHaLQIqu8ISSeZ0t4O0M=; b=BNbj2At8ThQDsZ6tWha3lWGxrgddodErKLy8a38TRbRF9ZK/dv4hhNyg+W907xT0wM hkm2mgYJQ+vqPkr8CRRGLsiXvWE7N+Ygb3/+yKkV0xG/cS8dVTIAoi+zpzBpnnBQobWX 6i3UVrG/YyqFkgbOHdTVRO9B9Q0ivHy5Pz/HUwzPvMPADy9HYEzig+4+M7vLweN42Avu 4aWKN5l4VpImQJSAOw4HEOFT1tJBvMigzwCLogYTpNdKMAAoiekgcjPio1FsGs88tJmr XmH/Aeq1kP4Hw5Rgu16mP+wmuKaZhSQLIVkWEmrZZrQPB6msuNnbqXr3/jrwvUlXkqth 4Dzg== X-Gm-Message-State: AOJu0Yzhzl2zXhk3V71+dwCYf2C2slWxeAEwEJFQ5k8ZUnCZDGZIVStF DbJSX8vG1a+ocq/DBgh55eg= X-Received: by 2002:a17:902:7445:b0:1c5:ce3c:c399 with SMTP id e5-20020a170902744500b001c5ce3cc399mr6626185plt.39.1696050102764; Fri, 29 Sep 2023 22:01:42 -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.01.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 22:01:42 -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 Subject: [PATCH 14/29] hfsplus: move hfsplus_xattr_handlers to .rodata Date: Sat, 30 Sep 2023 02:00:18 -0300 Message-Id: <20230930050033.41174-15-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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Fri, 29 Sep 2023 22:03:08 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778439633561311022 X-GMAIL-MSGID: 1778439633561311022 From: Wedson Almeida Filho This makes it harder for accidental or malicious changes to hfsplus_xattr_handlers at runtime. Signed-off-by: Wedson Almeida Filho --- fs/hfsplus/xattr.c | 2 +- fs/hfsplus/xattr.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/hfsplus/xattr.c b/fs/hfsplus/xattr.c index 58021e73c00b..9c9ff6b8c6f7 100644 --- a/fs/hfsplus/xattr.c +++ b/fs/hfsplus/xattr.c @@ -13,7 +13,7 @@ static int hfsplus_removexattr(struct inode *inode, const char *name); -const struct xattr_handler *hfsplus_xattr_handlers[] = { +const struct xattr_handler * const hfsplus_xattr_handlers[] = { &hfsplus_xattr_osx_handler, &hfsplus_xattr_user_handler, &hfsplus_xattr_trusted_handler, diff --git a/fs/hfsplus/xattr.h b/fs/hfsplus/xattr.h index d14e362b3eba..15cc55e41410 100644 --- a/fs/hfsplus/xattr.h +++ b/fs/hfsplus/xattr.h @@ -17,7 +17,7 @@ extern const struct xattr_handler hfsplus_xattr_user_handler; extern const struct xattr_handler hfsplus_xattr_trusted_handler; extern const struct xattr_handler hfsplus_xattr_security_handler; -extern const struct xattr_handler *hfsplus_xattr_handlers[]; +extern const struct xattr_handler * const hfsplus_xattr_handlers[]; int __hfsplus_setxattr(struct inode *inode, const char *name, const void *value, size_t size, int flags);