From patchwork Sat Sep 30 05:00:20 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: 146922 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2a8e:b0:403:3b70:6f57 with SMTP id in14csp344844vqb; Sat, 30 Sep 2023 05:05:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFJy1kg08GMByZSPI9xqDZqgkO09drxpInNaAgS52YBPYeW2xmaLkwXg6yVdNutwAnNRCEU X-Received: by 2002:a05:6a20:7fa6:b0:14c:daa9:5e22 with SMTP id d38-20020a056a207fa600b0014cdaa95e22mr8532819pzj.45.1696075530377; Sat, 30 Sep 2023 05:05:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696075530; cv=none; d=google.com; s=arc-20160816; b=n7yRhUNLH83vDuoUmK26rO0GvDM2Igtj33Uvt2ZqYpA0MHbk2hFwzvUAyYcccvwdwl mDgS0B3twX6yz9/BakEIYtbUGMyRCvRQst+WAvTVigwG76wcEWy9UDIShKfZlOz5oRJH 3YpPSTb9H3fMK4lzXdyHQKW6DqiV1ltbhuKZEw0fa1tOUXr4zpXX6lo08MxbWtf4UazO gfwcbWjWsbsQarR/0CDEzi4bVR4g+9y0hZrEYf4pi5x53BRQmAWbXD2HeISqh7Kk47U+ ve8RFv8aOSp8I4jhUFvkWWDizWXx8xWh7lOtnOw2QWHarS9IB2Glin8YVZRY9zwZrjlU FAow== 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=CvbjOndp8aI/Ez6XwF4rShTXeRhZbI/GoEOOUYLU6ao=; fh=NidycG2IFYun+KyQEsQuKH+t8S2GIrMh9KoY5qJjESs=; b=x9XfF9q6Fs/NgpPOWTbDNphWXoM2MbH5vOY0PCN6jJqcSkyHB5Ptvo9eX9BqIHAhDh GtQgi2OF1jH9kC1AmdfL3j2/8JQOXG6KTVGtlol/l1/ehou4RvR4DTYYV/FB0EyDrbKA 2dPNsHXvgGpzGmLMD6yYopoa+vXsVIBeKeJmW5NKRWttWJQNE/+9DT/f/mDNyQYVX9hf RMWePVTfXHjJKaz3Z6AUFIRQvpKweLLTxueXNJA2qFt1mEc/mTEOuk+kvUQjTnVH4BW1 epPdvsHRKtIMm4oK2Pl54n89V5BJRlOUsS4PAff0EkkUDVbVEcG4XP8lB3VdeOcWLXmI XAMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=OMsYJ0dj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id l20-20020a17090aec1400b00277816efefasi3404751pjy.106.2023.09.30.05.05.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Sep 2023 05:05:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=OMsYJ0dj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id 2E0868286E88; Fri, 29 Sep 2023 22:03:36 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234015AbjI3FDI (ORCPT + 19 others); Sat, 30 Sep 2023 01:03:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234080AbjI3FCR (ORCPT ); Sat, 30 Sep 2023 01:02:17 -0400 Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 761D010CF; Fri, 29 Sep 2023 22:01:49 -0700 (PDT) Received: by mail-pg1-x52d.google.com with SMTP id 41be03b00d2f7-578d0d94986so10819003a12.2; Fri, 29 Sep 2023 22:01:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696050109; x=1696654909; 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=CvbjOndp8aI/Ez6XwF4rShTXeRhZbI/GoEOOUYLU6ao=; b=OMsYJ0djmL8A6YolidXzOPOh9rwmQaIemhL3oQ0JqpLorfCmOQnJ23DLZau4eyNwwM Ltfs4KuAOsuoZ7s38WmCX4OEgC2Cy11Wl+ko72JFODN6sWSnVEe6FHN+ZWqqVOyKpSkw bH/1h1wOg2mjykd4O8gkYPdPf6+yRZQ+vWnY6rBrC/s3l3YOaIxAie6WqpVm4COa9rCr h5fNAeXGaW9bSpmBJPpRW9NrdeGOJR47X6U7RxbYEEWUmovI6UfmEAgcBqiX7TJwkJq/ FZiVwJAgGO8rNAxuR4xk4FQAh7uaxlrd9tWLKqB6/Q4+s4phrWJEq77JUoowa5XT98mQ Oegw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696050109; x=1696654909; 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=CvbjOndp8aI/Ez6XwF4rShTXeRhZbI/GoEOOUYLU6ao=; b=kJ5K+xlSySNKh1iy+pzccpNrtPoTzRxHM8EzYFyJYubQ848Sn5567Dnzt77/kqNnuR buTWftclkl8hv9uW0/DXGm5o2cXZoUaAqrmznkaPGZIg4ifmpRaFTUWfrJAJxEvkTyjW sJaIY0LTUJFO/zAt4eDGK0/qJ3npD2+BItfk0b0vQIjPi6qsb8D6Et7UAoi4KY3WwzG0 T4hcXqNTZnjEyRAiO0mYFYUK/isFtTkifJyw+qEWbXSu4qQ/y0FbRv1hMcnAGahuzFgj 0EA/iow6rgLlq1fmogEdQfmfOK10JeSp+m2ryjicd/rxd7efoOVv8x9ZzUBZSg8sFdid tOiw== X-Gm-Message-State: AOJu0YzvrlMjx3HQTaJ9/DNw0K3/OmVXwkHNc6m3AVV8k9O6XJa/51YB CobTb8nJYyLnbUJnXCvZQc4= X-Received: by 2002:a05:6a21:4985:b0:160:7679:90 with SMTP id ax5-20020a056a21498500b0016076790090mr6093121pzc.56.1696050108746; Fri, 29 Sep 2023 22:01:48 -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.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 22:01:48 -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 , Dave Kleikamp , jfs-discussion@lists.sourceforge.net Subject: [PATCH 16/29] jfs: move jfs_xattr_handlers to .rodata Date: Sat, 30 Sep 2023 02:00:20 -0300 Message-Id: <20230930050033.41174-17-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 (howler.vger.email [0.0.0.0]); Fri, 29 Sep 2023 22:03:36 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778464095514010400 X-GMAIL-MSGID: 1778464095514010400 From: Wedson Almeida Filho This makes it harder for accidental or malicious changes to jfs_xattr_handlers at runtime. Cc: Dave Kleikamp Cc: jfs-discussion@lists.sourceforge.net Signed-off-by: Wedson Almeida Filho Reviewed-by: Dave Kleikamp --- fs/jfs/jfs_xattr.h | 2 +- fs/jfs/xattr.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/jfs/jfs_xattr.h b/fs/jfs/jfs_xattr.h index 0d33816d251d..ec67d8554d2c 100644 --- a/fs/jfs/jfs_xattr.h +++ b/fs/jfs/jfs_xattr.h @@ -46,7 +46,7 @@ extern int __jfs_setxattr(tid_t, struct inode *, const char *, const void *, extern ssize_t __jfs_getxattr(struct inode *, const char *, void *, size_t); extern ssize_t jfs_listxattr(struct dentry *, char *, size_t); -extern const struct xattr_handler *jfs_xattr_handlers[]; +extern const struct xattr_handler * const jfs_xattr_handlers[]; #ifdef CONFIG_JFS_SECURITY extern int jfs_init_security(tid_t, struct inode *, struct inode *, diff --git a/fs/jfs/xattr.c b/fs/jfs/xattr.c index 931e50018f88..001c900a2b4d 100644 --- a/fs/jfs/xattr.c +++ b/fs/jfs/xattr.c @@ -985,7 +985,7 @@ static const struct xattr_handler jfs_trusted_xattr_handler = { .set = jfs_xattr_set, }; -const struct xattr_handler *jfs_xattr_handlers[] = { +const struct xattr_handler * const jfs_xattr_handlers[] = { &jfs_os2_xattr_handler, &jfs_user_xattr_handler, &jfs_security_xattr_handler,