From patchwork Sat Sep 30 05:00:28 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: 146934 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2a8e:b0:403:3b70:6f57 with SMTP id in14csp375285vqb; Sat, 30 Sep 2023 06:07:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEQh6Ng3mc9YICuZ50Y8SBvuRJUngjQfcoPntumgwQoVFgaKFDyHij5fxQbmwWxHVvg/B5m X-Received: by 2002:a17:90b:fce:b0:26d:17da:5e9f with SMTP id gd14-20020a17090b0fce00b0026d17da5e9fmr5957768pjb.1.1696079244147; Sat, 30 Sep 2023 06:07:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696079244; cv=none; d=google.com; s=arc-20160816; b=PXzkf+WlCNB5yGAoTowJGeUtNkL/3xISTqpDtWkKNCxuogGJuxlrk6LXo0j7Jo28mR 0boQFwaeC/v12k24v7kznCOOKLOKrH/FIae9UMFGUtt0EDy0E/cQ6zvATBpVK9vD4pTb DS/rezwpkJuD4wjYuMKatYg5xl6GmyJCeBUAxRzdo7doakkDvov1Im7mE2jrlHldPphv XKDAdZ3XB1lLCPT3k/uSIQaxK+ghEa6MiJ1lZVn01O1X6Y8nRn8xeZ6QY7xxrPmgJQpE qYFv3CwpiQVI9DRZeSnttZ/dnsVDBzT/xDmjQ1vZ5el8a9JxkU3kkrMtSBtS9gsODjJT klmQ== 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=SX/rjYIK1IVXt18htg+5KG/0YnvzJQn6149rPJUtUFI=; fh=Z91GUZQ42Z8DM2LjLXsJSm9LFLCfvdSGp/HZ6eC4xUU=; b=na7yAQ2lqA9pLAIWKbg9qyMJcDN0YhcXxkVGENxhQcpsEVAhZOy5z8ZXl9m+vPoHzx O5qqhV5LTHj2Iv0RRgSeyJdfgZ3HRlHgB8MD08LSwqaoQa7TFPDB2MIHhRbPH7HKxWg1 sx3ClUii8JE73oLw/FMALkHvpZOSNe1A5qb8+AxEb6pMdRLsPX1Jkztafs2TGUjTfmTw DhJgypTgEbaFZgLQego2dS4MaSdyrzCSc22jG8cvORmjTTUyNgsXdwJ35eFPpf93CkVh xkNA3Ll3s1RHwvI5pGpiCkEibS4SFeHeSQPn/riKiXz4PcBN5s+72hTtUKEEPz9kHeKY 8I3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=TeVKZ34X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id z19-20020a63e113000000b0057d7cff25besi20743653pgh.829.2023.09.30.06.07.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Sep 2023 06:07:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=TeVKZ34X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id 438998325EB7; Fri, 29 Sep 2023 22:04:48 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234105AbjI3FEI (ORCPT + 19 others); Sat, 30 Sep 2023 01:04:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234177AbjI3FDc (ORCPT ); Sat, 30 Sep 2023 01:03:32 -0400 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0870F1BE8; Fri, 29 Sep 2023 22:02:18 -0700 (PDT) Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1c434c33ec0so114735915ad.3; Fri, 29 Sep 2023 22:02:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696050138; x=1696654938; 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=SX/rjYIK1IVXt18htg+5KG/0YnvzJQn6149rPJUtUFI=; b=TeVKZ34XN5rX3Hx21ON03LJGgRAhkcRlmI2N8tObLN/sZzXd7tVkFKxCp/feNKnGR3 FDqDYyhf3tKepS8X5KCynb4FI+iiBz244RTrlq9bod7w94a3vJ2Oc1/1BqQHz5Fl6VUY 9VAFcwU+VcpQkTWl9rDXWdPxNiG20/pz8YvFyOgjxTF5zEEMdaCrW76+w1mFvLlA1KcU a8V2rmfGYWJxkSdKOO+vT3CoT4Ii4NxqUfpHfJzHZhXVFmxb3P2iYhAJ6MEwuhTv5tMd 7yP20zzflSp9D+b2U/ZG5BElCjkrBZWNYjrZz4an1GmsxiGl4oTRVPUuBUijTJpfvtHG hRww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696050138; x=1696654938; 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=SX/rjYIK1IVXt18htg+5KG/0YnvzJQn6149rPJUtUFI=; b=oymItOY+KxmND7jSOnyI0kUZ3cLR1169zN0vzQgbR80jFKRv1mCvIKYK9ibATXqa5X Z8K10BaKfM1teKnZyhNbZ0h111QQbC11tOL2pWg0EAafncTcyFpvW25wjoDxyzAMmEJG NDbm51F7CBY0XtUkIYXVej5QLjH6T7N1254Wh7PP5t2Pla/iVjHMoe3bfSmG9icnhr1j qCgUHz0cC89rxFcpju+Tlv6J/jzHLypEWBwyBq5ZPYzbCGs3+AW3DFSNIUjuHEtgh9l/ GrmqXLoYbpvF3Ccif8VhNuAX7JFTtLLof4u4bL8kykAWJT0go8PzfxyI/OYBVIsVreRG Tv9A== X-Gm-Message-State: AOJu0YyOgIXCaaFyL2fRa02MQueSCSWipvVGFTEy8wqrE6i+T2gEZ0ET geRTavc/c8XZY9ZiWUjbxq8= X-Received: by 2002:a17:902:c255:b0:1bb:c64f:9a5e with SMTP id 21-20020a170902c25500b001bbc64f9a5emr5364333plg.5.1696050138126; Fri, 29 Sep 2023 22:02:18 -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.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 22:02:17 -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 , Phillip Lougher Subject: [PATCH 24/29] squashfs: move squashfs_xattr_handlers to .rodata Date: Sat, 30 Sep 2023 02:00:28 -0300 Message-Id: <20230930050033.41174-25-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=-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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Fri, 29 Sep 2023 22:04:48 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778467989517573905 X-GMAIL-MSGID: 1778467989517573905 From: Wedson Almeida Filho This makes it harder for accidental or malicious changes to squashfs_xattr_handlers at runtime. Cc: Phillip Lougher Signed-off-by: Wedson Almeida Filho --- fs/squashfs/squashfs.h | 2 +- fs/squashfs/xattr.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/squashfs/squashfs.h b/fs/squashfs/squashfs.h index a6164fdf9435..5a756e6790b5 100644 --- a/fs/squashfs/squashfs.h +++ b/fs/squashfs/squashfs.h @@ -111,4 +111,4 @@ extern const struct address_space_operations squashfs_symlink_aops; extern const struct inode_operations squashfs_symlink_inode_ops; /* xattr.c */ -extern const struct xattr_handler *squashfs_xattr_handlers[]; +extern const struct xattr_handler * const squashfs_xattr_handlers[]; diff --git a/fs/squashfs/xattr.c b/fs/squashfs/xattr.c index e1e3f3dd5a06..ce6608cabd49 100644 --- a/fs/squashfs/xattr.c +++ b/fs/squashfs/xattr.c @@ -262,7 +262,7 @@ static const struct xattr_handler *squashfs_xattr_handler(int type) } } -const struct xattr_handler *squashfs_xattr_handlers[] = { +const struct xattr_handler * const squashfs_xattr_handlers[] = { &squashfs_xattr_user_handler, &squashfs_xattr_trusted_handler, &squashfs_xattr_security_handler,