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]
Date:	Thu, 29 Nov 2007 16:35:43 +0000
From:	Steven Whitehouse <steve@...gwyn.com>
To:	Pavel Emelyanov <xemul@...nvz.org>
Cc:	Herbert Xu <herbert@...dor.apana.org.au>,
	Patrick Caulfield <patrick@...epenguin.com>,
	Linux Netdev List <netdev@...r.kernel.org>, devel@...nvz.org,
	linux-decnet-user@...ts.sourceforge.net
Subject: Re: [PATCH][DECNET] dn_nl_deladdr() almost always returns no error

Hi,

On Thu, Nov 29, 2007 at 07:29:20PM +0300, Pavel Emelyanov wrote:
> As far as I see from the err variable initialization
> the dn_nl_deladdr() routine was designed to report errors
> like "EADDRNOTAVAIL" and probaby "ENODEV".
> 
> But the code sets this err to 0 after the first nlmsg_parse
> and goes on, returning this 0 in any case.
> 
> Is this made deliberately, or the patch below is correct?
>
The patch looks good to me.
 
> Signed-off-by: Pavel Emelyanov <xemul@...nvz.org>
Acked-by: Steven Whitehouse <swhiteho@...hat.com>

Steve.

> 
> ---
> 
> diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c
> index 66e266f..3bc82dc 100644
> --- a/net/decnet/dn_dev.c
> +++ b/net/decnet/dn_dev.c
> @@ -651,16 +651,18 @@ static int dn_nl_deladdr(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
>  	struct dn_dev *dn_db;
>  	struct ifaddrmsg *ifm;
>  	struct dn_ifaddr *ifa, **ifap;
> -	int err = -EADDRNOTAVAIL;
> +	int err;
>  
>  	err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFA_MAX, dn_ifa_policy);
>  	if (err < 0)
>  		goto errout;
>  
> +	err = -ENODEV;
>  	ifm = nlmsg_data(nlh);
>  	if ((dn_db = dn_dev_by_index(ifm->ifa_index)) == NULL)
>  		goto errout;
>  
> +	err = -EADDRNOTAVAIL;
>  	for (ifap = &dn_db->ifa_list; (ifa = *ifap); ifap = &ifa->ifa_next) {
>  		if (tb[IFA_LOCAL] &&
>  		    nla_memcmp(tb[IFA_LOCAL], &ifa->ifa_local, 2))
> -
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ