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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200504085556.rzkvn47q2k5iqyap@pengutronix.de>
Date:   Mon, 4 May 2020 10:55:56 +0200
From:   Oleksij Rempel <o.rempel@...gutronix.de>
To:     Michal Kubecek <mkubecek@...e.cz>
Cc:     Marek Vasut <marex@...x.de>, Andrew Lunn <andrew@...n.ch>,
        Florian Fainelli <f.fainelli@...il.com>,
        Jonathan Corbet <corbet@....net>, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org, Russell King <linux@...linux.org.uk>,
        mkl@...gutronix.de, kernel@...gutronix.de,
        David Jander <david@...tonic.nl>,
        Jakub Kicinski <kuba@...nel.org>,
        Christian Herber <christian.herber@....com>,
        "David S. Miller" <davem@...emloft.net>,
        Heiner Kallweit <hkallweit1@...il.com>
Subject: Re: [PATCH v5 1/2] ethtool: provide UAPI for PHY master/slave
 configuration.

On Mon, May 04, 2020 at 10:37:34AM +0200, Michal Kubecek wrote:
> On Mon, May 04, 2020 at 10:04:17AM +0200, Oleksij Rempel wrote:
> > @Michal,
> > 
> > i noticed that linkmodes_fill_reply() some times get not enough
> > tailroom.
> > if data->peer_empty == 0
> > linkmodes_reply_size() size: 476
> > linkmodes_fill_reply() skb tailroom: 724
> > 
> > 
> > if data->peer_empty == 1
> > linkmodes_reply_size() size: 216                                      
> > linkmodes_fill_reply() skb tailroom: 212
> > 
> > In the last case i won't be able to attach master_lave state and cfg
> > fields.
> > 
> > It looks like this issue was not introduced by my patches. May be you
> > have idea, what is missing?
> 
> It's my mistake, I'm just not sure why I never ran into this while
> testing. Please try the patch below.

thx! it works now:
[   82.754019] linkmodes_reply_size:103 size: 216
[   82.758523] linkmodes_fill_reply:117 skb tailroom: 724

[  126.781892] linkmodes_reply_size:103 size: 476
[  126.786464] linkmodes_fill_reply:117 skb tailroom: 724


> Michal
> 
> diff --git a/net/ethtool/netlink.c b/net/ethtool/netlink.c
> index 0c772318c023..ed5357210193 100644
> --- a/net/ethtool/netlink.c
> +++ b/net/ethtool/netlink.c
> @@ -342,7 +342,7 @@ static int ethnl_default_doit(struct sk_buff *skb, struct genl_info *info)
>  	ret = ops->reply_size(req_info, reply_data);
>  	if (ret < 0)
>  		goto err_cleanup;
> -	reply_len = ret;
> +	reply_len = ret + ethnl_reply_header_size();
>  	ret = -ENOMEM;
>  	rskb = ethnl_reply_init(reply_len, req_info->dev, ops->reply_cmd,
>  				ops->hdr_attr, info, &reply_payload);
> @@ -588,7 +588,7 @@ static void ethnl_default_notify(struct net_device *dev, unsigned int cmd,
>  	ret = ops->reply_size(req_info, reply_data);
>  	if (ret < 0)
>  		goto err_cleanup;
> -	reply_len = ret;
> +	reply_len = ret + ethnl_reply_header_size();
>  	ret = -ENOMEM;
>  	skb = genlmsg_new(reply_len, GFP_KERNEL);
>  	if (!skb)
> diff --git a/net/ethtool/strset.c b/net/ethtool/strset.c
> index 95eae5c68a52..0eed4e4909ab 100644
> --- a/net/ethtool/strset.c
> +++ b/net/ethtool/strset.c
> @@ -324,7 +324,6 @@ static int strset_reply_size(const struct ethnl_req_info *req_base,
>  	int len = 0;
>  	int ret;
>  
> -	len += ethnl_reply_header_size();
>  	for (i = 0; i < ETH_SS_COUNT; i++) {
>  		const struct strset_info *set_info = &data->sets[i];
>  
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ