From patchwork Fri Aug 6 10:22:35 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarek Poplawski X-Patchwork-Id: 61095 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.180.67]) by ozlabs.org (Postfix) with ESMTP id 76FB6B6F0E for ; Fri, 6 Aug 2010 20:23:00 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761197Ab0HFKWw (ORCPT ); Fri, 6 Aug 2010 06:22:52 -0400 Received: from mail-fx0-f46.google.com ([209.85.161.46]:35343 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761158Ab0HFKWu (ORCPT ); Fri, 6 Aug 2010 06:22:50 -0400 Received: by fxm14 with SMTP id 14so3706896fxm.19 for ; Fri, 06 Aug 2010 03:22:39 -0700 (PDT) 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:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=ZKf14yXy6knNgIvuj6Eyx4q83jU3tICckQgzaj3UMUw=; b=imBKVdmBPvgP5T7mKAbKmfqLFof9nFX1tnG9062CHLdX0s47jRp3eFr3qAR7ui2FNO UhDiY4HeYtWOInVNiOeR+JSxm0h2r9rLvvGeBtEXyHdJQ6oYyitHyiy+arj2SJ0fZRdq gSyilF7qfgd1LaPTyqIrkNBkUWgGydnFOnLrk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:in-reply-to:user-agent; b=W1Nphe51I2X1RjLB48aswWNTi4VKx9EKMsaJ7rbBMF2phyA0/7rZXVulo+E+Gi/1mF capl1a7+i0sDVLH2/L1Kzo2GDHeu2KrC+PUlkFN8YB0N3UHMhpwcajRal2ueug6g4lRS 4/Waul6yVe3zxHF9WhrdBHpwmm33E5SdXUwjY= Received: by 10.223.121.4 with SMTP id f4mr12508189far.71.1281090159728; Fri, 06 Aug 2010 03:22:39 -0700 (PDT) Received: from ff.dom.local (bv170.internetdsl.tpnet.pl [80.53.205.170]) by mx.google.com with ESMTPS id r10sm555526faq.5.2010.08.06.03.22.37 (version=SSLv3 cipher=RC4-MD5); Fri, 06 Aug 2010 03:22:38 -0700 (PDT) Date: Fri, 6 Aug 2010 10:22:35 +0000 From: Jarek Poplawski To: Franchoze Eric Cc: netdev@vger.kernel.org, David Miller , Patrick McHardy Subject: [PATCH] pkt_sched: Fix sch_sfq vs tcf_bind_filter oops Message-ID: <20100806102235.GA19305@ff.dom.local> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <282881281036255@web101.yandex.ru> 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 Franchoze Eric wrote: > Hello, can somebody follow up with approriate fix for that bug? It's reproducible on the latest 2.6.32.17 kernel with Centos5 user land. > Script to reproduce is bellow. I did quick fix for that to show where is the issue. I can't test it with 2.6.32 now but it seems the patch below should help. Please send your "Tested-by" if so. Thanks, Jarek P. ------------> Since there was added ->tcf_chain() method without ->bind_tcf() to sch_sfq class options, there is oops when a filter is added with the classid parameter. Fixes commit 7d2681a6ff4f9ab5e48d02550b4c6338f1638998 netdev thread: null pointer at cls_api.c Signed-off-by: Jarek Poplawski Reported-by: Franchoze Eric --- -- 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/sch_sfq.c b/net/sched/sch_sfq.c index e85352b..534f332 100644 --- a/net/sched/sch_sfq.c +++ b/net/sched/sch_sfq.c @@ -513,6 +513,12 @@ static unsigned long sfq_get(struct Qdisc *sch, u32 classid) return 0; } +static unsigned long sfq_bind(struct Qdisc *sch, unsigned long parent, + u32 classid) +{ + return 0; +} + static struct tcf_proto **sfq_find_tcf(struct Qdisc *sch, unsigned long cl) { struct sfq_sched_data *q = qdisc_priv(sch); @@ -567,6 +573,7 @@ static void sfq_walk(struct Qdisc *sch, struct qdisc_walker *arg) static const struct Qdisc_class_ops sfq_class_ops = { .get = sfq_get, .tcf_chain = sfq_find_tcf, + .bind_tcf = sfq_bind, .dump = sfq_dump_class, .dump_stats = sfq_dump_class_stats, .walk = sfq_walk,