Re: [BUG] kernel stack corruption during/after Netlabel error

2017-11-30 Thread James Morris
On Thu, 30 Nov 2017, Eric Dumazet wrote: > On Wed, 2017-11-29 at 19:16 -0800, Casey Schaufler wrote: > > On 11/29/2017 4:31 PM, James Morris wrote: > > > On Wed, 29 Nov 2017, Casey Schaufler wrote: > > > > > > > I see that there is a proposed fix later in the thread, but I > > > > don't see > >

Re: [BUG] kernel stack corruption during/after Netlabel error

2017-11-30 Thread Casey Schaufler
On 11/30/2017 9:57 AM, Eric Dumazet wrote: > On Thu, 2017-11-30 at 10:30 -0700, David Ahern wrote: >> On 11/30/17 8:44 AM, David Ahern wrote: >>> On 11/30/17 3:50 AM, Eric Dumazet wrote: @@ -1631,24 +1659,6 @@ int tcp_v4_rcv(struct sk_buff *skb)     th = (const struct tcphdr

Re: [BUG] kernel stack corruption during/after Netlabel error

2017-11-30 Thread David Ahern
On 11/30/17 10:57 AM, Eric Dumazet wrote: > I wonder if this should not be in a separate patch ? > > Bug was added in 971f10eca186cab238c49daa91f703c5a001b0b1 ("tcp: better > TCP_SKB_CB layout to reduce cache line misses") in linux 3.18 > > While VRF was added later. > > If you agree, I will

Re: [BUG] kernel stack corruption during/after Netlabel error

2017-11-30 Thread Eric Dumazet
On Thu, 2017-11-30 at 10:30 -0700, David Ahern wrote: > On 11/30/17 8:44 AM, David Ahern wrote: > > On 11/30/17 3:50 AM, Eric Dumazet wrote: > > > @@ -1631,24 +1659,6 @@ int tcp_v4_rcv(struct sk_buff *skb) > > >   > > >   th = (const struct tcphdr *)skb->data; > > >   iph = ip_hdr(skb); > > > - /*

Re: [BUG] kernel stack corruption during/after Netlabel error

2017-11-30 Thread David Ahern
On 11/30/17 8:44 AM, David Ahern wrote: > On 11/30/17 3:50 AM, Eric Dumazet wrote: >> @@ -1631,24 +1659,6 @@ int tcp_v4_rcv(struct sk_buff *skb) >> >> th = (const struct tcphdr *)skb->data; >> iph = ip_hdr(skb); >> -/* This is tricky : We move IPCB at its correct location into >>

Re: [BUG] kernel stack corruption during/after Netlabel error

2017-11-30 Thread Paul Moore
On Thu, Nov 30, 2017 at 7:47 AM, Paul Moore wrote: > On Thu, Nov 30, 2017 at 5:50 AM, Eric Dumazet wrote: >> On Wed, 2017-11-29 at 19:16 -0800, Casey Schaufler wrote: >>> On 11/29/2017 4:31 PM, James Morris wrote: >>> > On Wed, 29 Nov 2017, Casey

Re: [BUG] kernel stack corruption during/after Netlabel error

2017-11-30 Thread David Ahern
On 11/30/17 3:50 AM, Eric Dumazet wrote: > @@ -1631,24 +1659,6 @@ int tcp_v4_rcv(struct sk_buff *skb) > > th = (const struct tcphdr *)skb->data; > iph = ip_hdr(skb); > - /* This is tricky : We move IPCB at its correct location into > TCP_SKB_CB() > - * barrier() makes sure

Re: [BUG] kernel stack corruption during/after Netlabel error

2017-11-30 Thread Casey Schaufler
On 11/30/2017 2:50 AM, Eric Dumazet wrote: > On Wed, 2017-11-29 at 19:16 -0800, Casey Schaufler wrote: >> On 11/29/2017 4:31 PM, James Morris wrote: >>> On Wed, 29 Nov 2017, Casey Schaufler wrote: >>> I see that there is a proposed fix later in the thread, but I don't see the patch.

Re: [BUG] kernel stack corruption during/after Netlabel error

2017-11-30 Thread Casey Schaufler
On 11/30/2017 2:50 AM, Eric Dumazet wrote: > On Wed, 2017-11-29 at 19:16 -0800, Casey Schaufler wrote: >> On 11/29/2017 4:31 PM, James Morris wrote: >>> On Wed, 29 Nov 2017, Casey Schaufler wrote: >>> I see that there is a proposed fix later in the thread, but I don't see the patch.

Re: [BUG] kernel stack corruption during/after Netlabel error

2017-11-30 Thread Paul Moore
On Thu, Nov 30, 2017 at 5:50 AM, Eric Dumazet wrote: > On Wed, 2017-11-29 at 19:16 -0800, Casey Schaufler wrote: >> On 11/29/2017 4:31 PM, James Morris wrote: >> > On Wed, 29 Nov 2017, Casey Schaufler wrote: >> > >> > > I see that there is a proposed fix later in the

Re: [BUG] kernel stack corruption during/after Netlabel error

2017-11-30 Thread Eric Dumazet
On Wed, 2017-11-29 at 19:16 -0800, Casey Schaufler wrote: > On 11/29/2017 4:31 PM, James Morris wrote: > > On Wed, 29 Nov 2017, Casey Schaufler wrote: > > > > > I see that there is a proposed fix later in the thread, but I > > > don't see > > > the patch. Could you send it to me, so I can try it

Re: [BUG] kernel stack corruption during/after Netlabel error

2017-11-29 Thread Casey Schaufler
On 11/29/2017 4:31 PM, James Morris wrote: > On Wed, 29 Nov 2017, Casey Schaufler wrote: > >> I see that there is a proposed fix later in the thread, but I don't see >> the patch. Could you send it to me, so I can try it on my problem? > Forwarded off-list. The patch does fix the problem I was

Re: [BUG] kernel stack corruption during/after Netlabel error

2017-11-29 Thread James Morris
On Wed, 29 Nov 2017, Casey Schaufler wrote: > I see that there is a proposed fix later in the thread, but I don't see > the patch. Could you send it to me, so I can try it on my problem? Forwarded off-list. Interestingly, I didn't see the KASAN output email from Stephen here. -- James Morris

Re: [BUG] kernel stack corruption during/after Netlabel error

2017-11-29 Thread Casey Schaufler
On 11/29/2017 2:26 AM, James Morris wrote: > I'm seeing a kernel stack corruption bug (detected via gcc) when running > the SELinux testsuite on a 4.15-rc1 kernel, in the 2nd inet_socket test: > > https://github.com/SELinuxProject/selinux-testsuite/blob/master/tests/inet_socket/test > > #

Re: [BUG] kernel stack corruption during/after Netlabel error

2017-11-29 Thread James Morris
On Wed, 29 Nov 2017, Eric Dumazet wrote: > On Wed, 2017-11-29 at 12:23 -0800, Eric Dumazet wrote: > > > > I suspect this exposes an ancient bug, caused by fact that TCP moves > > IP[6]CB in skb->cb[] > > > > Basically the 2nd tcp_filter() added in commit > >

Re: [BUG] kernel stack corruption during/after Netlabel error

2017-11-29 Thread Eric Dumazet
On Wed, 2017-11-29 at 12:23 -0800, Eric Dumazet wrote: > > I suspect this exposes an ancient bug, caused by fact that TCP moves > IP[6]CB in skb->cb[] > > Basically the 2nd tcp_filter() added in commit > 8fac365f63c866a00015fa13932d8ffc584518b8 > ("tcp: Add a tcp_filter hook before handle ack

Re: [BUG] kernel stack corruption during/after Netlabel error

2017-11-29 Thread Eric Dumazet
On Wed, Nov 29, 2017 at 11:59 AM, Stephen Smalley wrote: > On Wed, 2017-11-29 at 09:34 -0800, Eric Dumazet wrote: >> On Wed, Nov 29, 2017 at 9:31 AM, Stephen Smalley >> wrote: >> > On Wed, 2017-11-29 at 21:26 +1100, James Morris wrote: >> > > I'm seeing a

Re: [BUG] kernel stack corruption during/after Netlabel error

2017-11-29 Thread Stephen Smalley
On Wed, 2017-11-29 at 09:34 -0800, Eric Dumazet wrote: > On Wed, Nov 29, 2017 at 9:31 AM, Stephen Smalley > wrote: > > On Wed, 2017-11-29 at 21:26 +1100, James Morris wrote: > > > I'm seeing a kernel stack corruption bug (detected via gcc) when > > > running > > > the SELinux

Re: [BUG] kernel stack corruption during/after Netlabel error

2017-11-29 Thread Paul Moore
On Wed, Nov 29, 2017 at 12:34 PM, Eric Dumazet wrote: > On Wed, Nov 29, 2017 at 9:31 AM, Stephen Smalley wrote: >> On Wed, 2017-11-29 at 21:26 +1100, James Morris wrote: >>> I'm seeing a kernel stack corruption bug (detected via gcc) when >>> running >>>

Re: [BUG] kernel stack corruption during/after Netlabel error

2017-11-29 Thread Eric Dumazet
On Wed, Nov 29, 2017 at 9:31 AM, Stephen Smalley wrote: > On Wed, 2017-11-29 at 21:26 +1100, James Morris wrote: >> I'm seeing a kernel stack corruption bug (detected via gcc) when >> running >> the SELinux testsuite on a 4.15-rc1 kernel, in the 2nd inet_socket >> test: >> >>

Re: [BUG] kernel stack corruption during/after Netlabel error

2017-11-29 Thread Stephen Smalley
On Wed, 2017-11-29 at 21:26 +1100, James Morris wrote: > I'm seeing a kernel stack corruption bug (detected via gcc) when > running  > the SELinux testsuite on a 4.15-rc1 kernel, in the 2nd inet_socket > test: > > https://github.com/SELinuxProject/selinux-testsuite/blob/master/tests >

Re: [BUG] kernel stack corruption during/after Netlabel error

2017-11-29 Thread Eric Dumazet
On Wed, Nov 29, 2017 at 2:26 AM, James Morris wrote: > I'm seeing a kernel stack corruption bug (detected via gcc) when running > the SELinux testsuite on a 4.15-rc1 kernel, in the 2nd inet_socket test: > >

[BUG] kernel stack corruption during/after Netlabel error

2017-11-29 Thread James Morris
I'm seeing a kernel stack corruption bug (detected via gcc) when running the SELinux testsuite on a 4.15-rc1 kernel, in the 2nd inet_socket test: https://github.com/SELinuxProject/selinux-testsuite/blob/master/tests/inet_socket/test # Verify that unauthorized client cannot communicate with