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] [day] [month] [year] [list]
Date:   Sun, 19 Nov 2017 09:59:00 +0800
From:   yuan linyu <cugyly@....com>
To:     David Miller <davem@...emloft.net>
Cc:     netdev@...r.kernel.org, Linyu.Yuan@...atel-sbell.com.cn
Subject: Re: [PATCH net-next v3] net: assign err to 0 at begin in
 do_setlink() function

On 五, 2017-11-17 at 15:08 +0900, David Miller wrote:
> From: yuan linyu <cugyly@....com>
> Date: Thu, 16 Nov 2017 19:59:48 +0800
> 
> > From: yuan linyu <Linyu.Yuan@...atel-sbell.com.cn>
> > 
> > each netlink attribute have proper process when error happen,
> > when exit one attribute process, it implies that no error,
> > so err = 0; is useless.
> > 
> > assign err = 0; at beginning if all attributes not set.
> > 
> > v1 -> v2:
> >       fix review comment from David, clear err before
> >       nla_for_each_nested()
> > 
> > v2 -> v3:
> >       maybe wrong understanding of David comment,
> >       provide a new version
> > 
> > Signed-off-by: yuan linyu <Linyu.Yuan@...atel-sbell.com.cn>
> 
> I'm sorry I still find it hard to accept this change.
> 
> What about all of the assignments of 'err' which only branch to
> 'errout' if err is negative?  It is not easy to see that none of those
> case ever result in 'err' holding a positive non-zero value.
yes, i also try to check any function return > 0, but it hard,
maybe some function not follow common rule.
> 
> The code as-is is the easiest to understand, audit and prove correct
> in the error-free case.  And this because of the explicit clearing or
> 'err' to zero late in the function.
yes, but this clearing will do three times every function call,
but it is not big issue 
> 
> Thanks you.

Powered by blists - more mailing lists