mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nikolay Aleksandrov <razor@blackwall.org>
To: "Thomas Weißschuh" <linux@weissschuh.net>,
	"Roopa Prabhu" <roopa@nvidia.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Simon Horman" <horms@kernel.org>, "Andrew Lunn" <andrew@lunn.ch>,
	"Heiner Kallweit" <hkallweit1@gmail.com>,
	"Russell King" <linux@armlinux.org.uk>,
	"Kalle Valo" <kvalo@kernel.org>,
	"Manish Chopra" <manishc@marvell.com>,
	"Rahul Verma" <rahulv@marvell.com>,
	GR-Linux-NIC-Dev@marvell.com,
	"Andrew Lunn" <andrew+netdev@lunn.ch>,
	"Shahed Shaikh" <shshaikh@marvell.com>
Cc: bridge@lists.linux.dev, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org
Subject: Re: [PATCH net-next 1/5] net: bridge: constify 'struct bin_attribute'
Date: Tue, 17 Dec 2024 12:43:05 +0200	[thread overview]
Message-ID: <66adcd4a-d4ae-4dc6-a706-2761efd5084a@blackwall.org> (raw)
In-Reply-To: <20241216-sysfs-const-bin_attr-net-v1-1-ec460b91f274@weissschuh.net>

On 12/16/24 13:30, Thomas Weißschuh wrote:
> The sysfs core now allows instances of 'struct bin_attribute' to be
> moved into read-only memory. Make use of that to protect them against
> accidental or malicious modifications.
> 
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
> ---
>  net/bridge/br_sysfs_br.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/net/bridge/br_sysfs_br.c b/net/bridge/br_sysfs_br.c
> index ea733542244c7e7feeffef3c993404529ba88559..c1176a5e02c43ce32cb3dc152e9aa08eb535a419 100644
> --- a/net/bridge/br_sysfs_br.c
> +++ b/net/bridge/br_sysfs_br.c
> @@ -1002,7 +1002,7 @@ static const struct attribute_group bridge_group = {
>   * Returns the number of bytes read.
>   */
>  static ssize_t brforward_read(struct file *filp, struct kobject *kobj,
> -			      struct bin_attribute *bin_attr,
> +			      const struct bin_attribute *bin_attr,
>  			      char *buf, loff_t off, size_t count)
>  {
>  	struct device *dev = kobj_to_dev(kobj);
> @@ -1023,10 +1023,10 @@ static ssize_t brforward_read(struct file *filp, struct kobject *kobj,
>  	return n;
>  }
>  
> -static struct bin_attribute bridge_forward = {
> +static const struct bin_attribute bridge_forward = {
>  	.attr = { .name = SYSFS_BRIDGE_FDB,
>  		  .mode = 0444, },
> -	.read = brforward_read,
> +	.read_new = brforward_read,
>  };
>  
>  /*
> 

Acked-by: Nikolay Aleksandrov <razor@blackwall.org>


  parent reply	other threads:[~2024-12-17 10:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-16 11:30 [PATCH net-next 0/5] net: " Thomas Weißschuh
2024-12-16 11:30 ` [PATCH net-next 1/5] net: bridge: " Thomas Weißschuh
2024-12-17 10:27   ` Simon Horman
2024-12-17 10:43   ` Nikolay Aleksandrov [this message]
2024-12-16 11:30 ` [PATCH net-next 2/5] net: phy: ks8995: " Thomas Weißschuh
2024-12-16 15:40   ` Andrew Lunn
2024-12-16 11:30 ` [PATCH net-next 3/5] wlcore: sysfs: " Thomas Weißschuh
2024-12-16 12:46   ` Kalle Valo
2024-12-18 18:05   ` [net-next,3/5] wifi: " Kalle Valo
2024-12-16 11:30 ` [PATCH net-next 4/5] netxen_nic: " Thomas Weißschuh
2024-12-17 10:28   ` Simon Horman
2024-12-16 11:30 ` [PATCH net-next 5/5] qlcnic: " Thomas Weißschuh
2024-12-17 10:28   ` Simon Horman
2024-12-18  3:03   ` Jakub Kicinski
2024-12-18  3:10 ` [PATCH net-next 0/5] net: " patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=66adcd4a-d4ae-4dc6-a706-2761efd5084a@blackwall.org \
    --to=razor@blackwall.org \
    --cc=GR-Linux-NIC-Dev@marvell.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=bridge@lists.linux.dev \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=linux@weissschuh.net \
    --cc=manishc@marvell.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rahulv@marvell.com \
    --cc=roopa@nvidia.com \
    --cc=shshaikh@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®