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=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham 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 80D8DC4360F for ; Thu, 4 Apr 2019 20:44:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5A431206C0 for ; Thu, 4 Apr 2019 20:44:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731188AbfDDUog convert rfc822-to-8bit (ORCPT ); Thu, 4 Apr 2019 16:44:36 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:46300 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727398AbfDDUog (ORCPT ); Thu, 4 Apr 2019 16:44:36 -0400 Received: by mail-ed1-f66.google.com with SMTP id d1so3469548edd.13 for ; Thu, 04 Apr 2019 13:44:34 -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=rp2CWE66yynNMLs69q0UQJwFU5EohJVxumnQH+lf+KanantWEgwg2FeVFBObHfrwLh A8Vvo7LAjCQ91odYAmKImucXVRJvZe1VVLu6EZayIuOlWd5lx8Khkee1tEkLAUo0efYz WSc22Jbb9JHjWptLRexORfPGoq3bRQdF4wRpu6xXmtod0+FL/kOrtoD1v31/n2dfYG0t aLselAvedEg5xkN1q/iL+4LoroUIFLwNRb8QgxjHxON0xTmru3aFFiUlwjOCTGTKr43i qgtK6lU04MM+WTIlyCqDZndUJ6t6lxSvtKfH1ZCR+VFhEPJ1eOVvmzIJ4caMsn57apSx 8ZjQ== X-Gm-Message-State: APjAAAXT+SelgOPKiBUFOZaB0F5ZRwQotWvuok/Clkxplfgznfo3c8aF txOf0so4B4FZ5yKf/QdZgM0n0BkOdK438Q== 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 Subject: Re: [PATCH net 2/2] sch_cake: Make sure we can write the IP header before changing DSCP bits 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: 8BIT Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Stephen Hemminger writes: > On Thu, 04 Apr 2019 15:01:33 +0200 > Toke Høiland-Jørgensen wrote: > >> static u8 cake_handle_diffserv(struct sk_buff *skb, u16 wash) >> { >> + int wlen = 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