From patchwork Mon Jan 5 13:52:45 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarek Poplawski X-Patchwork-Id: 16616 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 2221BDE09E for ; Tue, 6 Jan 2009 00:52:59 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753923AbZAENwz (ORCPT ); Mon, 5 Jan 2009 08:52:55 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753771AbZAENwz (ORCPT ); Mon, 5 Jan 2009 08:52:55 -0500 Received: from ug-out-1314.google.com ([66.249.92.174]:38998 "EHLO ug-out-1314.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753057AbZAENwy (ORCPT ); Mon, 5 Jan 2009 08:52:54 -0500 Received: by ug-out-1314.google.com with SMTP id 39so1461134ugf.37 for ; Mon, 05 Jan 2009 05:52:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=drJJLVfRyFSp/Qmg+pnyltDT1RFv7T93hpK6aTgftzU=; b=Kdf/KAXRWiM5OUJemxQKgUMJL2HlKocYVTPeqLZBJICwN/fzNvMnLbgwK2yfpujcrZ j2nFezDxjPHTh7nMp0QMbOt7f/4+C1qv3oBuZ1NmBq1mO4pS/0crDTF6ltAL/1UnfedH FOsvbDY8+qr/YX2jI7kVcMNDPDEO1L0Aj9qXI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=t0uLGmyDd4NbeLgV4Un/A/wjuh+s0/GQUzOdX6XcNmEMMlpVYHNdkTTeJrrQvvmPX3 hbZsXilpL58Ux4TDao7TrXDp8+U6FDeFKneyvyaK4wmGDqABcRwfhvAVioJDKs1bJI0T NATCNPsc6/EVmbV8EACf66velFR9pNV2NMb2I= Received: by 10.67.106.19 with SMTP id i19mr12807407ugm.46.1231163571390; Mon, 05 Jan 2009 05:52:51 -0800 (PST) Received: from ff.dom.local (bv170.internetdsl.tpnet.pl [80.53.205.170]) by mx.google.com with ESMTPS id e5sm25353701ugf.24.2009.01.05.05.52.49 (version=SSLv3 cipher=RC4-MD5); Mon, 05 Jan 2009 05:52:50 -0800 (PST) Date: Mon, 5 Jan 2009 13:52:45 +0000 From: Jarek Poplawski To: David Miller Cc: Andrew Morton , netdev@vger.kernel.org, bugme-daemon@bugzilla.kernel.org Subject: [PATCH] Re: [Bugme-new] [Bug 11571] New: u32_classify Kernel Panic Message-ID: <20090105135245.GC4460@ff.dom.local> References: <20080917193832.GA2623@ami.dom.local> <48D1FDB8.4040805@plotinka.ru> <20080918075351.GA4633@ff.dom.local> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20080918075351.GA4633@ff.dom.local> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org > On Thu, Sep 18, 2008 at 01:05:28PM +0600, m0sia wrote: > ... > >>>> http://bugzilla.kernel.org/show_bug.cgi?id=11571 ... (take 2) It seems there could be a problem with testing if this patch fixes this bug, but IMHO it's quite probable, and needed anyway. Jarek P. -----------------> pkt_sched: cls_u32: Fix locking in u32_change() New nodes are inserted in u32_change() under rtnl_lock() with wmb(), so without tcf_tree_lock() like in other classifiers (e.g. cls_fw). This isn't enough without rmb() on the read side, but on the other hand adding such barriers doesn't give any savings, so the lock is added instead. Reported-by: m0sia Signed-off-by: Jarek Poplawski --- net/sched/cls_u32.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index 05d1780..07372f6 100644 --- a/net/sched/cls_u32.c +++ b/net/sched/cls_u32.c @@ -638,8 +638,9 @@ static int u32_change(struct tcf_proto *tp, unsigned long base, u32 handle, break; n->next = *ins; - wmb(); + tcf_tree_lock(tp); *ins = n; + tcf_tree_unlock(tp); *arg = (unsigned long)n; return 0;