From: Nikolay Aleksandrov <nikolay@nvidia.com>
To: Ido Schimmel <idosch@idosch.org>, netdev@vger.kernel.org
Cc: davem@davemloft.net, kuba@kernel.org, roopa@nvidia.com,
bernard@vivo.com, David.Laight@ACULAB.COM, mlxsw@nvidia.com,
Ido Schimmel <idosch@nvidia.com>
Subject: Re: [PATCH net-next] net: bridge: Allow base 16 inputs in sysfs
Date: Wed, 24 Nov 2021 12:17:43 +0200 [thread overview]
Message-ID: <5701e4f9-8a0b-56f6-3741-48d8bb9e1b7c@nvidia.com> (raw)
In-Reply-To: <20211124101122.3321496-1-idosch@idosch.org>
On 24/11/2021 12:11, Ido Schimmel wrote:
> From: Ido Schimmel <idosch@nvidia.com>
>
> Cited commit converted simple_strtoul() to kstrtoul() as suggested by
> the former's documentation. However, it also forced all the inputs to be
> decimal resulting in user space breakage.
>
> Fix by setting the base to '0' so that the base is automatically
> detected.
>
> Before:
>
> # ip link add name br0 type bridge vlan_filtering 1
> # echo "0x88a8" > /sys/class/net/br0/bridge/vlan_protocol
> bash: echo: write error: Invalid argument
>
> After:
>
> # ip link add name br0 type bridge vlan_filtering 1
> # echo "0x88a8" > /sys/class/net/br0/bridge/vlan_protocol
> # echo $?
> 0
>
> Fixes: 520fbdf7fb19 ("net/bridge: replace simple_strtoul to kstrtol")
> Signed-off-by: Ido Schimmel <idosch@nvidia.com>
> ---
Thank you for taking care of this.
Acked-by: Nikolay Aleksandrov <nikolay@nvidia.com>
> net/bridge/br_sysfs_br.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/bridge/br_sysfs_br.c b/net/bridge/br_sysfs_br.c
> index 11c490694296..159590d5c2af 100644
> --- a/net/bridge/br_sysfs_br.c
> +++ b/net/bridge/br_sysfs_br.c
> @@ -41,7 +41,7 @@ static ssize_t store_bridge_parm(struct device *d,
> if (!ns_capable(dev_net(br->dev)->user_ns, CAP_NET_ADMIN))
> return -EPERM;
>
> - err = kstrtoul(buf, 10, &val);
> + err = kstrtoul(buf, 0, &val);
> if (err != 0)
> return err;
>
>
next prev parent reply other threads:[~2021-11-24 10:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-24 10:11 [PATCH net-next] net: bridge: Allow base 16 inputs in sysfs Ido Schimmel
2021-11-24 10:17 ` Nikolay Aleksandrov [this message]
2021-11-24 12:55 ` David Laight
2021-11-24 13:16 ` Ido Schimmel
2021-11-25 1:30 ` 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=5701e4f9-8a0b-56f6-3741-48d8bb9e1b7c@nvidia.com \
--to=nikolay@nvidia.com \
--cc=David.Laight@ACULAB.COM \
--cc=bernard@vivo.com \
--cc=davem@davemloft.net \
--cc=idosch@idosch.org \
--cc=idosch@nvidia.com \
--cc=kuba@kernel.org \
--cc=mlxsw@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=roopa@nvidia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.