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: <20181005174152.ktj5cha4zjmxyhcz@brauner.io>
Date:   Fri, 5 Oct 2018 19:41:52 +0200
From:   Christian Brauner <christian@...uner.io>
To:     David Ahern <dsahern@...nel.org>
Cc:     netdev@...r.kernel.org, davem@...emloft.net, jbenc@...hat.com,
        stephen@...workplumber.org, David Ahern <dsahern@...il.com>
Subject: Re: [PATCH net-next 02/20] netlink: Add extack message to
 nlmsg_parse for invalid header length

On Thu, Oct 04, 2018 at 02:33:37PM -0700, David Ahern wrote:
> From: David Ahern <dsahern@...il.com>
> 
> Give a user a reason why EINVAL is returned in nlmsg_parse.
> 
> Signed-off-by: David Ahern <dsahern@...il.com>

Acked-by: Christian Brauner <christian@...uner.io>

> ---
>  include/net/netlink.h | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/include/net/netlink.h b/include/net/netlink.h
> index 589683091f16..9522a0bf1f3a 100644
> --- a/include/net/netlink.h
> +++ b/include/net/netlink.h
> @@ -516,8 +516,10 @@ static inline int nlmsg_parse(const struct nlmsghdr *nlh, int hdrlen,
>  			      const struct nla_policy *policy,
>  			      struct netlink_ext_ack *extack)
>  {
> -	if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen))
> +	if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen)) {
> +		NL_SET_ERR_MSG(extack, "Invalid header length");
>  		return -EINVAL;
> +	}
>  
>  	return nla_parse(tb, maxtype, nlmsg_attrdata(nlh, hdrlen),
>  			 nlmsg_attrlen(nlh, hdrlen), policy, extack);
> -- 
> 2.11.0
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ