Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3642244ybi; Mon, 29 Jul 2019 10:00:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqxGBxOkFvLL2QCQU5VJNNIT47NsbRILoBUaeNHdW1csBkUv5trU7BKb2KWL9Snwfwkj/lDa X-Received: by 2002:a63:e610:: with SMTP id g16mr102513474pgh.392.1564419628762; Mon, 29 Jul 2019 10:00:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564419628; cv=none; d=google.com; s=arc-20160816; b=Pr8dnJvbsqT40AHe8O44hoPXq9QeN19QoGkWcBC5NnbeSxEYAg1/y/W+Pg/dzVs/3H wturWN8Ld2X8JHSMEJi0UGEGxuKS9L3x2gUEaNBgLhyphuoUgE3ahyzIKzcFQIylXwhO Hwy3wmqpDNpnIJVXxxI2SJS2fKcuvw5eB5thBEtMAym1TGWwX0mMSkB/n8HNEZKlJfIh qr7/Zf08ArZB3Yie6Dx4vkzRXQ/QnyHreTpb7+UfpC+wlKqHt/Nk89VFR223Jj6fcpfH aM6DWkGLAmx4pj6HNeW5dXfPCtgctImM42v3tQ3e6vTCuee7Km86GRb/78aa/fSP2uOq oVYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=S4pwKeoQicc3ftusZNjIShoEobFjK89jvTQ7X+wMP+E=; b=CimuSZAQ/0wNlZvl3VaFX50xn0HUXcifpUXQokvWP7HzmDaMa5VBfsZP4D+bHVZSOs dO6QF33c/kF+eJMXC8IGAu08wvlCiLATPLikIwc+kIBUzecDyKMFYvHUjx12bMUBetTv aVlydxLxk3n4jccmCMERzKKKmQYCyh3ckCA2AynPBVHiB+0FnLwrFQGjhGng4uYuFpsQ eaWKs+xUN0qz2pRVIerBrx/uufnyYHYoUmh8GvF3Mo/PHzrnAd5frdzs79MH8ci+yCON PqEhdQsudd9xLSm7ukuMzMZJtUN0cMPQMc3EWMliRhFkXgMx6dwl2+NacOlCftlkFHB8 owGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bh8si25100574plb.175.2019.07.29.10.00.13; Mon, 29 Jul 2019 10:00:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728398AbfG2Qrn (ORCPT + 99 others); Mon, 29 Jul 2019 12:47:43 -0400 Received: from shards.monkeyblade.net ([23.128.96.9]:35768 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726828AbfG2Qrn (ORCPT ); Mon, 29 Jul 2019 12:47:43 -0400 Received: from localhost (unknown [IPv6:2601:601:9f80:35cd::d71]) (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 D72281266535A; Mon, 29 Jul 2019 09:47:42 -0700 (PDT) Date: Mon, 29 Jul 2019 09:47:42 -0700 (PDT) Message-Id: <20190729.094742.1840605528000035808.davem@davemloft.net> To: baijiaju1990@gmail.com Cc: jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] net: sched: Fix a possible null-pointer dereference in dequeue_func() From: David Miller In-Reply-To: <20190729082433.28981-1-baijiaju1990@gmail.com> References: <20190729082433.28981-1-baijiaju1990@gmail.com> X-Mailer: Mew version 6.8 on Emacs 26.1 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]); Mon, 29 Jul 2019 09:47:43 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jia-Ju Bai Date: Mon, 29 Jul 2019 16:24:33 +0800 > In dequeue_func(), there is an if statement on line 74 to check whether > skb is NULL: > if (skb) > > When skb is NULL, it is used on line 77: > prefetch(&skb->end); > > Thus, a possible null-pointer dereference may occur. > > To fix this bug, skb->end is used when skb is not NULL. > > This bug is found by a static analysis tool STCheck written by us. > > Fixes: 76e3cc126bb2 ("codel: Controlled Delay AQM") > Signed-off-by: Jia-Ju Bai Applied and queued up for -stable.