Content-Type: multipart/mixed; boundary="===============3856339903666288497==" MIME-Version: 1.0 From: Jakub Kicinski To: kbuild-all@lists.01.org Subject: Re: [linux-stable-rc:linux-3.16.y 6719/6738] net/sched/sch_netem.c:581 netem_enqueue() error: we previously assumed 'skb' could be null (see line 505) Date: Wed, 09 Oct 2019 09:31:37 -0700 Message-ID: <20191009093137.4aa4fe87@cakuba.netronome.com> In-Reply-To: List-Id: --===============3856339903666288497== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On Wed, 09 Oct 2019 16:05:44 +0100, Ben Hutchings wrote: > On Wed, 2019-10-09 at 11:12 +0300, Dan Carpenter wrote: > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-st= able-rc.git linux-3.16.y > > head: c508a924ddd1119a8037c1ec23f560eade0444c6 > > commit: 61763432af929bd3d091a18469c130719f00c6de [6719/6738] net: netem= : fix backlog accounting for corrupted GSO frames > > = > > If you fix the issue, kindly add following tag > > Reported-by: kbuild test robot > > Reported-by: Dan Carpenter > > = > > smatch warnings: > > net/sched/sch_netem.c:581 netem_enqueue() error: we previously assumed = 'skb' could be null (see line 505) > > net/sched/sch_netem.c:581 netem_enqueue() error: dereferencing freed me= mory 'skb' = > = > It seems like the same (or similar) bugs are introduced by the upstream > version. Indeed, we need something like: diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c index b17f2ed970e2..3ff7cffd5bc2 100644 --- a/net/sched/sch_netem.c +++ b/net/sched/sch_netem.c @@ -509,6 +509,7 @@ static int netem_enqueue(struct sk_buff *skb, struct Qd= isc *sch, if (skb->ip_summed =3D=3D CHECKSUM_PARTIAL && skb_checksum_help(skb)) { qdisc_drop(skb, sch, to_free); + skb =3D NULL; goto finish_segs; } = @@ -595,7 +596,7 @@ static int netem_enqueue(struct sk_buff *skb, struct Qd= isc *sch, unsigned int len, last_len; int nb =3D 0; = - len =3D skb->len; + len =3D skb ? skb->len : 0; = while (segs) { skb2 =3D segs->next; I'll test and send out, thanks for the report! --===============3856339903666288497==--