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] [thread-next>] [day] [month] [year] [list]
Message-ID: <76db0c51-15be-2d27-00a7-c9f8dc234816@linaro.org>
Date:   Thu, 22 Apr 2021 13:29:20 -0500
From:   Alex Elder <elder@...aro.org>
To:     Bjorn Andersson <bjorn.andersson@...aro.org>,
        Subash Abhinov Kasiviswanathan <subashab@...eaurora.org>,
        Sean Tranchetti <stranche@...eaurora.org>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>
Cc:     netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        Daniele Palmas <dnlplm@...il.com>,
        Aleksander Morgado <aleksander@...ksander.es>,
        Loic Poulain <loic.poulain@...aro.org>
Subject: Re: [PATCH] net: qualcomm: rmnet: Allow partial updates of IFLA_FLAGS

On 4/22/21 1:20 PM, Bjorn Andersson wrote:
> The idiomatic way to handle the changelink flags/mask pair seems to be
> allow partial updates of the driver's link flags. In contrast the rmnet
> driver masks the incoming flags and then use that as the new flags.
> 
> Change the rmnet driver to follow the common scheme, before the
> introduction of IFLA_RMNET_FLAGS handling in iproute2 et al.

I like this a lot.  It should have been implemented this way
to begin with; there's not much point to have the mask if
it's only applied to the passed-in value.

KS, are you aware of *any* existing user space code that
would not work correctly if this were accepted?

I.e., the way it was (is), the value passed in *assigns*
the data format flags.  But with Bjorn's changes, the
data format flags would be *updated* (i.e., any bits not
set in the mask field would remain with their previous
value).

Reviewed-by: Alex Elder <elder@...aro.org>

> Signed-off-by: Bjorn Andersson <bjorn.andersson@...aro.org>
> ---
>   drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c
> index 8d51b0cb545c..2c8db2fcc53d 100644
> --- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c
> +++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c
> @@ -336,7 +336,8 @@ static int rmnet_changelink(struct net_device *dev, struct nlattr *tb[],
>   
>   		old_data_format = port->data_format;
>   		flags = nla_data(data[IFLA_RMNET_FLAGS]);
> -		port->data_format = flags->flags & flags->mask;
> +		port->data_format &= ~flags->mask;
> +		port->data_format |= flags->flags & flags->mask;
>   
>   		if (rmnet_vnd_update_dev_mtu(port, real_dev)) {
>   			port->data_format = old_data_format;
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ