From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752255AbbIPLL0 (ORCPT ); Wed, 16 Sep 2015 07:11:26 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:35146 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750989AbbIPLLY (ORCPT ); Wed, 16 Sep 2015 07:11:24 -0400 Message-ID: <1442401882.4116.52.camel@edumazet-glaptop2.roam.corp.google.com> Subject: Re: [PATCH v4] add stealth mode From: Eric Dumazet To: Matteo Croce Cc: David Miller , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 16 Sep 2015 04:11:22 -0700 In-Reply-To: <1442397259-28894-1-git-send-email-matteo@openwrt.org> References: <20150915.120057.1457031142615117336.davem@davemloft.net> <1442397259-28894-1-git-send-email-matteo@openwrt.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2015-09-16 at 11:54 +0200, Matteo Croce wrote: > diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c > index 93898e0..fe62ae0 100644 > --- a/net/ipv4/tcp_ipv4.c > +++ b/net/ipv4/tcp_ipv4.c > @@ -77,6 +77,7 @@ > #include > > #include > +#include > #include > #include > #include > @@ -1652,7 +1653,7 @@ csum_error: > TCP_INC_STATS_BH(net, TCP_MIB_CSUMERRORS); > bad_packet: > TCP_INC_STATS_BH(net, TCP_MIB_INERRS); > - } else { > + } else if (!IN_DEV_STEALTH(skb->dev->ip_ptr)) { > tcp_v4_send_reset(NULL, skb); > } It is illegal to deref skb->dev->ip_ptr without proper accessor / annotations. Check struct in_device *in_dev = __in_dev_get_rcu(skb->dev); (Same remarks in other places of your patch)