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:	Wed, 27 Jul 2016 09:28:29 -0700
From:	Cong Wang <xiyou.wangcong@...il.com>
To:	Phil Turnbull <phil.turnbull@...cle.com>
Cc:	Linux Kernel Network Developers <netdev@...r.kernel.org>,
	"David S. Miller" <davem@...emloft.net>,
	Alexey Kuznetsov <kuznet@....inr.ac.ru>,
	James Morris <jmorris@...ei.org>,
	Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
	Patrick McHardy <kaber@...sh.net>
Subject: Re: [PATCH net] sit: Correctly return -ENOMEM from SIOCGETPRL ioctl.

On Wed, Jul 27, 2016 at 6:57 AM, Phil Turnbull <phil.turnbull@...cle.com> wrote:
> -ENOMEM is never returned because the 'out' path unconditionally sets
> 'ret' to zero. Remove the 'out' path and return directly when the
> allocation fails.
>
> Fixes: 300aaeeaab5f ("[IPV6] SIT: Add SIOCGETPRL ioctl to get/dump PRL.")
> Signed-off-by: Phil Turnbull <phil.turnbull@...cle.com>
> ---
>  net/ipv6/sit.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
> index 0619ac70836d..a71514040bb4 100644
> --- a/net/ipv6/sit.c
> +++ b/net/ipv6/sit.c
> @@ -320,8 +320,8 @@ static int ipip6_tunnel_get_prl(struct ip_tunnel *t,
>                  */
>                 kp = kcalloc(ca, sizeof(*kp), GFP_ATOMIC);
>                 if (!kp) {
> -                       ret = -ENOMEM;
> -                       goto out;
> +                       rcu_read_unlock();
> +                       return -ENOMEM;
>                 }

Or even better: we don't have to do the second kcalloc()
within rcu read lock, we can move it before rcu_read_lock()?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ