From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB08DC4CECD for ; Sun, 15 Sep 2019 18:55:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CB40F214D9 for ; Sun, 15 Sep 2019 18:55:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727129AbfIOSzM (ORCPT ); Sun, 15 Sep 2019 14:55:12 -0400 Received: from shards.monkeyblade.net ([23.128.96.9]:40110 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727039AbfIOSzL (ORCPT ); Sun, 15 Sep 2019 14:55:11 -0400 Received: from localhost (93-63-141-166.ip28.fastwebnet.it [93.63.141.166]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 3796E153ECDA5; Sun, 15 Sep 2019 11:55:10 -0700 (PDT) Date: Sun, 15 Sep 2019 19:55:08 +0100 (WEST) Message-Id: <20190915.195508.57263100187589453.davem@davemloft.net> To: xiyou.wangcong@gmail.com Cc: netdev@vger.kernel.org, syzbot+d5870a903591faaca4ae@syzkaller.appspotmail.com, torvalds@linux-foundation.org, jhs@mojatatu.com, jiri@resnulli.us Subject: Re: [Patch net v2] net_sched: let qdisc_put() accept NULL pointer From: David Miller In-Reply-To: <20190912172230.9635-1-xiyou.wangcong@gmail.com> References: <20190912172230.9635-1-xiyou.wangcong@gmail.com> X-Mailer: Mew version 6.8 on Emacs 26.2 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Sun, 15 Sep 2019 11:55:11 -0700 (PDT) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Cong Wang Date: Thu, 12 Sep 2019 10:22:30 -0700 > When tcf_block_get() fails in sfb_init(), q->qdisc is still a NULL > pointer which leads to a crash in sfb_destroy(). Similar for > sch_dsmark. > > Instead of fixing each separately, Linus suggested to just accept > NULL pointer in qdisc_put(), which would make callers easier. > > (For sch_dsmark, the bug probably exists long before commit > 6529eaba33f0.) > > Fixes: 6529eaba33f0 ("net: sched: introduce tcf block infractructure") > Reported-by: syzbot+d5870a903591faaca4ae@syzkaller.appspotmail.com > Suggested-by: Linus Torvalds > Signed-off-by: Cong Wang Applied and queued up for -stable, thanks.