Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1086560rdb; Sun, 1 Oct 2023 20:25:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGNwlkGuaH4F/ztDwZMDtYVjspoYXytcMIityupq8GRAlbSg86uAtU4ynjcd1aePhEXheh0 X-Received: by 2002:a05:6808:2d9:b0:3a7:250a:7948 with SMTP id a25-20020a05680802d900b003a7250a7948mr10257675oid.13.1696217136783; Sun, 01 Oct 2023 20:25:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696217136; cv=none; d=google.com; s=arc-20160816; b=GN+fZOE9wIfrVjU3ZM0NQtPdNZ0cX+twbaWb26wUss9RZ6tXQL0D7h2wklo6OVzo9X J8yg5hLvy0M7t1cavz2jbfmRqQnJa/rp5Me+k7wm26xR+1qrPcEsPjqk0OSYSq+MZ4EG o+giV5bR6AuP5l5FHMP49gUbQQWfLREMDLNoU0g1amCb1/AYC/4NiwV72GCKs034hS5t AANVPq5RxZOMTQjBRiieXEOfJB9SkdD5GGPFFn8/jIfym5AdPncUwpnw49WTqYYVA1cF vZR8MbqWuCBGPN/pyzJSs8Ju59/Elml8AzZWxtoY5nlbPx+UZkbL/cBqV8sq2zZRDN1Y X83A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=G6wnHTgTcw37XCFqdNoUwceIprHkHSWJNKSBsu0v9k0=; fh=Z0uvceUrHZ52Vya29myrkuyVLJfafc9TJmxw2LuaoBg=; b=Bh5yXq+wd7hS0vZGZ7RQf4ZbKf9GqzSl8CGGooNLhsytmFb3JxURQyVwtACWCG6vE/ c8xhRPB9fQUAcclzHxSmLuUY3L0PX5ap2XCUsbEP1w9UxgKBmcu8opv6rDnyy1I2tJRp bLq0OPNYSAmA7H4yk7S7/3orut4ykLS2wJTx8X/0IiGm9qRhZEe67s8Ub+aA6TzG5AcA 88tHuojvjea1AXtn7mrXr95SS8D8vDXkZhryU8VGBTUGWKEtGzxUu4jTWbB5PAiKySs2 gTCC7TPVaXbYKLnaBjSsft461FIWdxi5b7TntLezad8SWDw/z1qOhvEFbTz5WHqNKnSE fnWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=b2AEyb7D; 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 e60-20020a17090a6fc200b002777ca0d151si6788437pjk.165.2023.10.01.20.25.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Oct 2023 20:25:36 -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=b2AEyb7D; 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 465658026DA0; Sun, 1 Oct 2023 12:59:45 -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 S235363AbjJAT7S (ORCPT + 99 others); Sun, 1 Oct 2023 15:59:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235346AbjJAT7S (ORCPT ); Sun, 1 Oct 2023 15:59:18 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 102A1C6; Sun, 1 Oct 2023 12:59:15 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-50437c618b4so21997095e87.2; Sun, 01 Oct 2023 12:59:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696190353; x=1696795153; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=G6wnHTgTcw37XCFqdNoUwceIprHkHSWJNKSBsu0v9k0=; b=b2AEyb7Djs2XMEk+JHtlUbo1horar/QONrxDjtDnk1u9DLZStteMueb+jehXQ4tzCv u/TT/E9B+SKGVVB9yZe10ba5ZLUynWE7igNL/5PicEs+hfaYf40YJkBYcZ6a5xsA2QT3 2ydNf1Aqi9x7rIj5NGpV5dhU5D1iKGTfAdI4U8CuwUffd28W4Au2MbsAKlgFw1JBAGSG xFVKm9l4w9u9TQR1aQpr/amhO2DB0i9oHFoLhwCIKHl5LK3w08+BBAPwH606+En6J4Mc mt8U2jQZpR3wy13/CUP/ovU0Pv6f7EDfQ2Dru55giuCAucaKIRf7Ya0kop0kW/3b0acH xCGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696190353; x=1696795153; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=G6wnHTgTcw37XCFqdNoUwceIprHkHSWJNKSBsu0v9k0=; b=pDlfZ5ZNniBheiNG+f7//LQt8xFM1Ky1CoaHoU4vPBp+ri5FVY6ipYLi356JA+UPQH Zt1fp0GW8zhS8xmJsEVOk4tzV1kjLvPSe+Tdcy+PFjh/52gB4bnEPLNfhgR44KeLcD/d o1t/zkA2Awd3dU1qYYG2jOq7XatQNl6wfbibnDx8R3lPwFccjuV0Smb2RaZ09moLJ3rZ aQHc2BSDFejMZI5ks/CyWy8h0oHioC/P5Z/VGge8FSTZcmj9wQsDbb3cC0owJnswqiMo nj2W/ZyP2vZkA04fOjVdKwah51vN5TuaaFuznSJqsNQlhS+2L17cF+Sil7O2yqhnhLSa a54w== X-Gm-Message-State: AOJu0Yy/oPTkgTgGU+s7Lx7ut55kJsD8v4HrC5DHk5K+gvmHKsGhNASy 2wZtincn9qUOkmk492y0NKIV7qvjmymEex6NN+Q= X-Received: by 2002:ac2:58db:0:b0:505:6fed:33a0 with SMTP id u27-20020ac258db000000b005056fed33a0mr5768211lfo.34.1696190353001; Sun, 01 Oct 2023 12:59:13 -0700 (PDT) MIME-Version: 1.0 References: <20230930050033.41174-1-wedsonaf@gmail.com> <20230930050033.41174-24-wedsonaf@gmail.com> In-Reply-To: <20230930050033.41174-24-wedsonaf@gmail.com> From: Steve French Date: Sun, 1 Oct 2023 14:59:01 -0500 Message-ID: Subject: Re: [PATCH 23/29] smb: move cifs_xattr_handlers to .rodata To: Wedson Almeida Filho Cc: Alexander Viro , Christian Brauner , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Wedson Almeida Filho , Steve French , Paulo Alcantara , Ronnie Sahlberg , Shyam Prasad N , Tom Talpey , linux-cifs@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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]); Sun, 01 Oct 2023 12:59:45 -0700 (PDT) Reviewed-by: Steve French On Sat, Sep 30, 2023 at 6:27=E2=80=AFAM Wedson Almeida Filho wrote: > > From: Wedson Almeida Filho > > This makes it harder for accidental or malicious changes to > cifs_xattr_handlers at runtime. > > Cc: Steve French > Cc: Paulo Alcantara > Cc: Ronnie Sahlberg > Cc: Shyam Prasad N > Cc: Tom Talpey > Cc: linux-cifs@vger.kernel.org > Signed-off-by: Wedson Almeida Filho > --- > fs/smb/client/cifsfs.h | 2 +- > fs/smb/client/xattr.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/fs/smb/client/cifsfs.h b/fs/smb/client/cifsfs.h > index 15c8cc4b6680..a0472b539567 100644 > --- a/fs/smb/client/cifsfs.h > +++ b/fs/smb/client/cifsfs.h > @@ -134,7 +134,7 @@ extern int cifs_symlink(struct mnt_idmap *idmap, stru= ct inode *inode, > struct dentry *direntry, const char *symname); > > #ifdef CONFIG_CIFS_XATTR > -extern const struct xattr_handler *cifs_xattr_handlers[]; > +extern const struct xattr_handler * const cifs_xattr_handlers[]; > extern ssize_t cifs_listxattr(struct dentry *, char *, size_t); > #else > # define cifs_xattr_handlers NULL > diff --git a/fs/smb/client/xattr.c b/fs/smb/client/xattr.c > index 4ad5531686d8..ac199160bce6 100644 > --- a/fs/smb/client/xattr.c > +++ b/fs/smb/client/xattr.c > @@ -478,7 +478,7 @@ static const struct xattr_handler smb3_ntsd_full_xatt= r_handler =3D { > .set =3D cifs_xattr_set, > }; > > -const struct xattr_handler *cifs_xattr_handlers[] =3D { > +const struct xattr_handler * const cifs_xattr_handlers[] =3D { > &cifs_user_xattr_handler, > &cifs_os2_xattr_handler, > &cifs_cifs_acl_xattr_handler, > -- > 2.34.1 > --=20 Thanks, Steve