From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752209AbdJFM6O (ORCPT ); Fri, 6 Oct 2017 08:58:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43711 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751869AbdJFM6M (ORCPT ); Fri, 6 Oct 2017 08:58:12 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9ADBF82102 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=pabeni@redhat.com From: Paolo Abeni To: linux-kernel@vger.kernel.org Cc: "Paul E. McKenney" , Josh Triplett , Steven Rostedt , "David S. Miller" , Eric Dumazet , Hannes Frederic Sowa , netdev@vger.kernel.org Subject: [PATCH 0/4] RCU: introduce noref debug Date: Fri, 6 Oct 2017 14:57:45 +0200 Message-Id: X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 06 Oct 2017 12:58:12 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The networking subsystem is currently using some kind of long-lived RCU-protected, references to avoid the overhead of full book-keeping. Such references - skb_dst() noref - are stored inside the skbs and can be moved across relevant slices of the network stack, with the users being in charge of properly clearing the relevant skb - or properly refcount the related dst references - before the skb escapes the RCU section. We currently don't have any deterministic debug infrastructure to check the dst noref usages - and the introduction of others noref artifact is currently under discussion. This series tries to tackle the above introducing an RCU debug infrastructure aimed at spotting incorrect noref pointer usage, in patch one. The infrastructure is small and must be explicitly enabled via a newly introduced build option. Patch two uses such infrastructure to track dst noref usage in the networking stack. Patch 3 and 4 are bugfixes for small buglet found running this infrastructure on basic scenarios. Paolo Abeni (4): rcu: introduce noref debug net: use RCU noref infrastructure to track dst noref ipv4: drop unneeded and misleading RCU lock in ip_route_input_noref() tcp: avoid noref dst leak on input path include/linux/rcupdate.h | 11 ++++++ include/linux/skbuff.h | 1 + include/net/dst.h | 5 +++ kernel/rcu/Kconfig.debug | 15 ++++++++ kernel/rcu/Makefile | 1 + kernel/rcu/noref_debug.c | 89 ++++++++++++++++++++++++++++++++++++++++++++++++ net/ipv4/route.c | 7 +--- net/ipv4/tcp_input.c | 5 ++- 8 files changed, 127 insertions(+), 7 deletions(-) create mode 100644 kernel/rcu/noref_debug.c -- 2.13.6