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 289443B29E for ; Thu, 4 Apr 2019 16:44:35 -0400 (EDT) Received: by mail-ed1-f65.google.com with SMTP id h22so3508838edw.7 for ; Thu, 04 Apr 2019 13:44:35 -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=oGgPZ71B4qZNQRfdAORe7gJVE6n+FyM65Rk+J7Dk/9E=; b=goHpT5QnbtF6UUb4Q4Uxd2W/7piNrjoSYWxIJvV1CARhGAUujiYXfg6FgznXr+A0Vt wBwT8VGqDdk1fv7Rpf/tw/HO/nw+Mlrnj2WJd60Gow/5+d/gnqfCPCSgZRnykdE8K1Qg 3CJELbquti2hg+L3G41drT0IIqe4da8KHMmZypyEHW0XCJg1K/8N8xIodIWO+MxZ4xyO yGezqgPO6T+Rf6r1p/pweVf18P+JKZkoZK3tewgTC3qJ1I9IVz+xyz2Uu4zowUXdx2jq jRS7V0sLnfPp7dqRoxFk7XDs4sE1SPcKpN+Cw/eX03OtJCz+upeZsQkbB/tfs8/Cd/UU hUgA== X-Gm-Message-State: APjAAAVD0NvVQxx1SW9EB7BfYIcBvcDmgJ1g2bOZVe0MwvSteyKnJJu/ WV0vSgOs1ZGAqD3UHO9eQ1PrZA== X-Google-Smtp-Source: APXvYqymoumWz6prZAkhV1s9CkHE/KnHoDmXH+jdqZjvP8QYVW7bZ9/YEKRa+oC0e77WrQn/LDrvGA== X-Received: by 2002:a17:906:583:: with SMTP id 3mr4708676ejn.217.1554410674289; Thu, 04 Apr 2019 13:44:34 -0700 (PDT) Received: from alrua-x1.borgediget.toke.dk (alrua-x1.vpn.toke.dk. [2a00:7660:6da:10::2]) by smtp.gmail.com with ESMTPSA id p1sm5945802eda.29.2019.04.04.13.44.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 04 Apr 2019 13:44:33 -0700 (PDT) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id 443671804A5; Thu, 4 Apr 2019 22:44:33 +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: <20190404123536.3c966937@shemminger-XPS-13-9360> References: <155438289359.18760.18027832614176337074.stgit@alrua-x1> <155438289374.18760.4278774647362746152.stgit@alrua-x1> <20190404123536.3c966937@shemminger-XPS-13-9360> X-Clacks-Overhead: GNU Terry Pratchett Date: Thu, 04 Apr 2019 22:44:33 +0200 Message-ID: <87y34p1owe.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 20:44:35 -0000 Stephen Hemminger writes: > On Thu, 04 Apr 2019 15:01:33 +0200 > Toke H=C3=B8iland-J=C3=B8rgensen wrote: > >> static u8 cake_handle_diffserv(struct sk_buff *skb, u16 wash) >> { >> + int wlen =3D skb_network_offset(skb); > > In theory this could be negative, you should handle that? > Rather than calling may_pull() with a huge unsigned value. Huh, that would imply that skb->network_header points to before skb->head; when does that happen? 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"? Also, I copied that bit from sch_dsmark, so if you really thing it needs to be fixed, I guess we should fix both... -Toke