From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-f65.google.com (mail-ed1-f65.google.com [209.85.208.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.bufferbloat.net (Postfix) with ESMTPS id 0774D3B29E for ; Thu, 4 Apr 2019 17:55:40 -0400 (EDT) Received: by mail-ed1-f65.google.com with SMTP id x14so3687205eds.1 for ; Thu, 04 Apr 2019 14:55:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=o/AsyPSEHBhYxv/8jgpLRvg1kW+khQoaWJkppf+/ucA=; b=PUFsJeFKCg1Wr/jsthG9pG3Qh5hj/NxCn0xiguAKW13LgjhXeqCQqbmkKs8a/DdR/R nufknldzeOgd786gAS7tGrTfV+XWWoErbQEzvjsBlH2bCNzM6yIlS+pQc4Popk4wXqxp yYoLQLN6N/ac839tLRkoah41VsKog0SnBRMYgr6RGaJH3wJESeW8+wobwmD7i0V2LUmO lXUkLr0OKKAgQJiwzX1vn5vI+wOfYCmhqFZsRV4WmBq1B/LjjiSxPLiQ8rsZ6/HYYa5S aRCxOmxqV/FNroqIb4uN1jRcpWhZNjcPwVfzeREbhCxf0qk4cCBdXwJ6Q+AeGnDtw1x+ 4cMA== X-Gm-Message-State: APjAAAWSmL0BdbL/RsdcnNvWmFWRReaguajks+lg1LvQuMLobxQ9OBy2 qBiN8WrG29fsC5hKdtAhOx/0KQ== X-Google-Smtp-Source: APXvYqwOJ9xaLzTXnZci7k/bXvCtusOjGmfqcG7c+U1DYI7NHXqWREdW59kcbNnmHQnoWLYu4Qh9hw== X-Received: by 2002:aa7:cb57:: with SMTP id w23mr5485796edt.264.1554414939194; Thu, 04 Apr 2019 14:55:39 -0700 (PDT) Received: from alrua-x1.borgediget.toke.dk (borgediget.toke.dk. [85.204.121.218]) by smtp.gmail.com with ESMTPSA id y4sm5872710edq.53.2019.04.04.14.55.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 04 Apr 2019 14:55:38 -0700 (PDT) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id DFE5B1804A5; Thu, 4 Apr 2019 23:55:37 +0200 (CEST) From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= To: Stephen Hemminger Cc: David Miller , netdev@vger.kernel.org, cake@lists.bufferbloat.net In-Reply-To: <20190404144007.7ac9bfe0@shemminger-XPS-13-9360> References: <155438289359.18760.18027832614176337074.stgit@alrua-x1> <155438289374.18760.4278774647362746152.stgit@alrua-x1> <20190404123536.3c966937@shemminger-XPS-13-9360> <87y34p1owe.fsf@toke.dk> <20190404144007.7ac9bfe0@shemminger-XPS-13-9360> X-Clacks-Overhead: GNU Terry Pratchett Date: Thu, 04 Apr 2019 23:55:37 +0200 Message-ID: <87v9zt1lly.fsf@toke.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Cake] [PATCH net 2/2] sch_cake: Make sure we can write the IP header before changing DSCP bits X-BeenThere: cake@lists.bufferbloat.net X-Mailman-Version: 2.1.20 Precedence: list List-Id: Cake - FQ_codel the next generation List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Apr 2019 21:55:40 -0000 Stephen Hemminger writes: > On Thu, 04 Apr 2019 22:44:33 +0200 > Toke H=C3=B8iland-J=C3=B8rgensen wrote: > >> Stephen Hemminger writes: >>=20 >> > On Thu, 04 Apr 2019 15:01:33 +0200 >> > Toke H=C3=B8iland-J=C3=B8rgensen wrote: >> >=20=20 >> >> static u8 cake_handle_diffserv(struct sk_buff *skb, u16 wash) >> >> { >> >> + int wlen =3D skb_network_offset(skb);=20=20 >> > >> > In theory this could be negative, you should handle that? >> > Rather than calling may_pull() with a huge unsigned value.=20=20 >>=20 >> Huh, that would imply that skb->network_header points to before >> skb->head; when does that happen? >>=20 >> Also, pskb_may_pull() does check for len > skb->len, so I guess a >> follow-up question would be, "does it happen often enough to warrant >> handling at this level"? >>=20 >> Also, I copied that bit from sch_dsmark, so if you really thing it needs >> to be fixed, I guess we should fix both... >>=20 >> -Toke > > It should never happen just paranoid Ah, right. Well in that case I think any overflow is handled fine inside pskb_may_pull(): if (unlikely(len > skb->len)) return 0; -Toke