From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932850Ab1KBSKw (ORCPT ); Wed, 2 Nov 2011 14:10:52 -0400 Received: from mail-wy0-f174.google.com ([74.125.82.174]:34409 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752249Ab1KBSKt (ORCPT ); Wed, 2 Nov 2011 14:10:49 -0400 MIME-Version: 1.0 In-Reply-To: <1320257141.2292.24.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC> References: <1318874090.4172.84.camel@twins> <1318879396.4172.92.camel@twins> <1318928713.21167.4.camel@twins> <20111018182046.GF1309@hostway.ca> <20111024190203.GA24410@hostway.ca> <20111025202049.GB25043@hostway.ca> <20111031173246.GA10614@hostway.ca> <1320254854.2292.14.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC> <1320256412.2292.17.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC> <1320257141.2292.24.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC> From: Linus Torvalds Date: Wed, 2 Nov 2011 11:10:27 -0700 X-Google-Sender-Auth: F7FSRtCTTn8vIqTzeJOep_uMULA Message-ID: Subject: Re: Linux 3.1-rc9 To: Eric Dumazet Cc: Thomas Gleixner , Simon Kirby , David Miller , Peter Zijlstra , Linux Kernel Mailing List , Dave Jones , Martin Schwidefsky , Ingo Molnar , Network Development Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 2, 2011 at 11:05 AM, Eric Dumazet wrote: > > Yes, but only when tproxy is used, and in some obscure error > conditions... Probably nobody ever hit them or complained. Yes, I'm not disputing that. However, it does show how incredibly fragile that code is. May I suggest renaming those "clone_sk()" kinds of functions "clone_sk_lock()" or something? So that you *see* that it's locked as it is cloned. That might have made the bug not happen in the first place.. Of course, maybe it's obvious to most net people - just not me looking at the code - that the new socket ended up being locked at allocation. But considering the bug happened twice, that "obvious" part is clearly debatable.. Linus