lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251223162222.GA4022020@bhelgaas>
Date: Tue, 23 Dec 2025 10:22:22 -0600
From: Bjorn Helgaas <helgaas@...nel.org>
To: Christophe JAILLET <christophe.jaillet@...adoo.fr>
Cc: Manivannan Sadhasivam <mani@...nel.org>,
	Krzysztof WilczyƄski <kwilczynski@...nel.org>,
	Kishon Vijay Abraham I <kishon@...nel.org>,
	Bjorn Helgaas <bhelgaas@...gle.com>, linux-kernel@...r.kernel.org,
	kernel-janitors@...r.kernel.org, linux-pci@...r.kernel.org
Subject: Re: [PATCH] scsi: target: Constify struct configfs_item_operations
 and configfs_group_operations

On Sun, Dec 14, 2025 at 10:45:29AM +0100, Christophe JAILLET wrote:
> 'struct configfs_item_operations' and 'configfs_group_operations' are not
> modified in this driver.
> 
> Constifying these structures moves some data to a read-only section, so
> increases overall security, especially when the structure holds some
> function pointers.

Sounds plausible, except that there's no apparent connection with scsi
(as suggested by the subject).  Will wait for a revision that matches
history of this file.

> On a x86_64, with allmodconfig:
> Before:
> ======
>    text	   data	    bss	    dec	    hex	filename
>   27503	  12184	    256	  39943	   9c07	drivers/pci/endpoint/pci-ep-cfs.o
> 
> After:
> =====
>    text	   data	    bss	    dec	    hex	filename
>   27855	  11832	    256	  39943	   9c07	drivers/pci/endpoint/pci-ep-cfs.o
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
> ---
> Compile tested only.
> 
> This change is possible since commits f2f36500a63b and f7f78098690d.
> ---
>  drivers/pci/endpoint/pci-ep-cfs.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/pci/endpoint/pci-ep-cfs.c b/drivers/pci/endpoint/pci-ep-cfs.c
> index ef50c82e647f..034a31c341c9 100644
> --- a/drivers/pci/endpoint/pci-ep-cfs.c
> +++ b/drivers/pci/endpoint/pci-ep-cfs.c
> @@ -85,7 +85,7 @@ static void pci_secondary_epc_epf_unlink(struct config_item *epc_item,
>  	pci_epc_remove_epf(epc, epf, SECONDARY_INTERFACE);
>  }
>  
> -static struct configfs_item_operations pci_secondary_epc_item_ops = {
> +static const struct configfs_item_operations pci_secondary_epc_item_ops = {
>  	.allow_link	= pci_secondary_epc_epf_link,
>  	.drop_link	= pci_secondary_epc_epf_unlink,
>  };
> @@ -149,7 +149,7 @@ static void pci_primary_epc_epf_unlink(struct config_item *epc_item,
>  	pci_epc_remove_epf(epc, epf, PRIMARY_INTERFACE);
>  }
>  
> -static struct configfs_item_operations pci_primary_epc_item_ops = {
> +static const struct configfs_item_operations pci_primary_epc_item_ops = {
>  	.allow_link	= pci_primary_epc_epf_link,
>  	.drop_link	= pci_primary_epc_epf_unlink,
>  };
> @@ -257,7 +257,7 @@ static void pci_epc_epf_unlink(struct config_item *epc_item,
>  	pci_epc_remove_epf(epc, epf, PRIMARY_INTERFACE);
>  }
>  
> -static struct configfs_item_operations pci_epc_item_ops = {
> +static const struct configfs_item_operations pci_epc_item_ops = {
>  	.allow_link	= pci_epc_epf_link,
>  	.drop_link	= pci_epc_epf_unlink,
>  };
> @@ -508,7 +508,7 @@ static void pci_epf_release(struct config_item *item)
>  	kfree(epf_group);
>  }
>  
> -static struct configfs_item_operations pci_epf_ops = {
> +static const struct configfs_item_operations pci_epf_ops = {
>  	.allow_link		= pci_epf_vepf_link,
>  	.drop_link		= pci_epf_vepf_unlink,
>  	.release		= pci_epf_release,
> @@ -662,7 +662,7 @@ static void pci_epf_drop(struct config_group *group, struct config_item *item)
>  	config_item_put(item);
>  }
>  
> -static struct configfs_group_operations pci_epf_group_ops = {
> +static const struct configfs_group_operations pci_epf_group_ops = {
>  	.make_group     = &pci_epf_make,
>  	.drop_item      = &pci_epf_drop,
>  };
> -- 
> 2.52.0
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ