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] [day] [month] [year] [list]
Message-Id: <1447166012.759777.434994833.3D15D18F@webmail.messagingengine.com>
Date:	Tue, 10 Nov 2015 15:33:32 +0100
From:	Hannes Frederic Sowa <hannes@...essinduktion.org>
To:	Hannes Frederic Sowa <hannes@...essinduktion.org>,
	netdev@...r.kernel.org
Cc:	Dmitry Vyukov <dvyukov@...gle.com>,
	Eric Dumazet <eric.dumazet@...il.com>
Subject: Re: [PATCH net] af-unix: fix use-after-free with concurrent readers
 while splicing

On Tue, Nov 10, 2015, at 15:26, Hannes Frederic Sowa wrote:
>  net/unix/af_unix.c | 18 +++++++++++++++++-
>  1 file changed, 17 insertions(+), 1 deletion(-)
> 
> diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
> index aaa0b58..b2c4131 100644
> --- a/net/unix/af_unix.c
> +++ b/net/unix/af_unix.c
> @@ -441,6 +441,7 @@ static void unix_release_sock(struct sock *sk, int
> embrion)
>  		if (state == TCP_LISTEN)
>  			unix_release_sock(skb->sk, 1);
>  		/* passed fds are erased in the kfree_skb hook	      */
> +               UNIXCB(skb).consumed = skb->len;
>  		kfree_skb(skb);
>  	}
>  
> @@ -2152,7 +2153,7 @@ unlock:
>  		}
>  
>  		chunk = min_t(unsigned int, unix_skb_len(skb) - skip, size);
> -               chunk = state->recv_actor(skb, skip, chunk, state);
> +               chunk = state->recv_actor(skb_get(skb), skip, chunk,
> state);
>  		if (chunk < 0) {
>  			if (copied == 0)
>  				copied = -EFAULT;

I forgot a consume_skb here. Will send v2. Seems like I can review
patches much better in a mail client. :}

Bye,
Hannes
--
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