From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Ahern Subject: Re: [BUG] kernel stack corruption during/after Netlabel error Date: Thu, 30 Nov 2017 08:44:18 -0700 Message-ID: References: <4d73f839-7a86-6edc-b44b-e296bd5947c2@schaufler-ca.com> <1512039044.19682.12.camel@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Paul Moore , netdev@vger.kernel.org, Stephen Smalley , selinux@tycho.nsa.gov, LSM To: Eric Dumazet , Casey Schaufler , James Morris Return-path: Received: from mail-pg0-f66.google.com ([74.125.83.66]:33334 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751992AbdK3PoV (ORCPT ); Thu, 30 Nov 2017 10:44:21 -0500 In-Reply-To: <1512039044.19682.12.camel@gmail.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: 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 compiler wont play fool^Waliasing games. > - */ > - memmove(&TCP_SKB_CB(skb)->header.h4, IPCB(skb), > - sizeof(struct inet_skb_parm)); > - barrier(); > - > - TCP_SKB_CB(skb)->seq = ntohl(th->seq); > - TCP_SKB_CB(skb)->end_seq = (TCP_SKB_CB(skb)->seq + th->syn + th->fin + > - skb->len - th->doff * 4); > - TCP_SKB_CB(skb)->ack_seq = ntohl(th->ack_seq); > - TCP_SKB_CB(skb)->tcp_flags = tcp_flag_byte(th); > - TCP_SKB_CB(skb)->tcp_tw_isn = 0; > - TCP_SKB_CB(skb)->ip_dsfield = ipv4_get_dsfield(iph); > - TCP_SKB_CB(skb)->sacked = 0; > - TCP_SKB_CB(skb)->has_rxtstamp = > - skb->tstamp || skb_hwtstamps(skb)->hwtstamp; > - > lookup: > sk = __inet_lookup_skb(&tcp_hashinfo, skb, __tcp_hdrlen(th), th->source, > th->dest, sdif, &refcounted); I believe moving the above is going to affect lookups with VRF. Let me take a look before this gets committed.