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  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]
Date:   Mon, 27 Jan 2020 01:22:06 +0100
From:   Andrew Lunn <andrew@...n.ch>
To:     Michal Kubecek <mkubecek@...e.cz>
Cc:     David Miller <davem@...emloft.net>, netdev@...r.kernel.org,
        Jakub Kicinski <kuba@...nel.org>,
        Jiri Pirko <jiri@...nulli.us>,
        Florian Fainelli <f.fainelli@...il.com>,
        John Linville <linville@...driver.com>,
        Johannes Berg <johannes@...solutions.net>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next 3/7] ethtool: set message mask with DEBUG_SET
 request

On Sun, Jan 26, 2020 at 11:11:07PM +0100, Michal Kubecek wrote:
> Implement DEBUG_SET netlink request to set debugging settings for a device.
> At the moment, only message mask corresponding to message level as set by
> ETHTOOL_SMSGLVL ioctl request can be set. (It is called message level in
> ioctl interface but almost all drivers interpret it as a bit mask.)
> 
> Signed-off-by: Michal Kubecek <mkubecek@...e.cz>
> +int ethnl_set_debug(struct sk_buff *skb, struct genl_info *info)
> +{
> +	struct nlattr *tb[ETHTOOL_A_DEBUG_MAX + 1];
> +	struct ethnl_req_info req_info = {};
> +	struct net_device *dev;
> +	bool mod = false;
> +	u32 msg_mask;
> +	int ret;
> +
> +	ret = nlmsg_parse(info->nlhdr, GENL_HDRLEN, tb,
> +			  ETHTOOL_A_DEBUG_MAX, debug_set_policy,
> +			  info->extack);
> +	if (ret < 0)
> +		return ret;
> +	ret = ethnl_parse_header(&req_info, tb[ETHTOOL_A_DEBUG_HEADER],
> +				 genl_info_net(info), info->extack, true);
> +	if (ret < 0)
> +		return ret;
> +	dev = req_info.dev;
> +	if (!dev->ethtool_ops->get_msglevel || !dev->ethtool_ops->set_msglevel)
> +		return -EOPNOTSUPP;

This seems like a new requirement, that both get and set callbacks are
implemented. However, A quick look thought the code suggests all
drivers already do have both get and set. So i think this is safe.

Reviewed-by: Andrew Lunn <andrew@...n.ch>

    Andrew

Powered by blists - more mailing lists