From owner-svn-src-head@freebsd.org Fri Aug 31 01:15:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 671F3EFE3CC; Fri, 31 Aug 2018 01:15:57 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: from mail-ed1-f66.google.com (mail-ed1-f66.google.com [209.85.208.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E50607AD30; Fri, 31 Aug 2018 01:15:56 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: by mail-ed1-f66.google.com with SMTP id l5so5230076edw.9; Thu, 30 Aug 2018 18:15:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=FKKPaoiOrduGMd1g27oNpQcTDT0KtUWVDhSFDoS1LsA=; b=t4BMGPvqAPLB5NOEzJBlSVvRuPvgZyRTS01emK/Q/wwouxV6/E1swChehoCKZVmmAx uAQkCjMmc5kV7KDu8eIsF577VYz3wKBkdJD/1SM5qBSCEtlQiITgD3ruqCSmNTH50Lzx uVUrHrCoa9JRgBlCkbG0S+tf2+VUvVjSMf6HGCGqNpaQM+Rng4G9IzNSjF2xgqupha9q PQLkZnLBC4a+eY+PnHfOq9fhs68vF+L/rewTfREDCZEyzWPFOz+xUwWP7KvzEDDhxaup /XtRX6FN7AqnCh1RkSkhQGcEwMtEYJv+wFTOXPLfOBVkU9cyEXYvpwAi8XzWiuC2hyRJ OEIg== X-Gm-Message-State: APzg51BDBnHZzZ/yaA7OTODUMnZvDq5JQkYJJ44pIRKO0sJNrbDag6cr ODYSufFyItvyw2arlfvL+w15yg8M X-Google-Smtp-Source: ANB0Vdb/1sXuxYCEpoVuWyr4ovZty71I9zUAwRhRz1WUi6/PnRac6lPhWWtOZH9wwV0CBmfAjO3C8A== X-Received: by 2002:a50:a5af:: with SMTP id a44-v6mr15435901edc.289.1535678149740; Thu, 30 Aug 2018 18:15:49 -0700 (PDT) Received: from mail-wm0-f44.google.com (mail-wm0-f44.google.com. [74.125.82.44]) by smtp.gmail.com with ESMTPSA id c11-v6sm3865611eda.48.2018.08.30.18.15.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 18:15:49 -0700 (PDT) Received: by mail-wm0-f44.google.com with SMTP id q8-v6so3738745wmq.4; Thu, 30 Aug 2018 18:15:49 -0700 (PDT) X-Received: by 2002:a1c:ac04:: with SMTP id v4-v6mr3417535wme.51.1535678149187; Thu, 30 Aug 2018 18:15:49 -0700 (PDT) MIME-Version: 1.0 References: <201808141717.w7EHHcPf010971@repo.freebsd.org> <7C9F31C2-839C-4537-A43D-F51A54380BDA@FreeBSD.org> In-Reply-To: <7C9F31C2-839C-4537-A43D-F51A54380BDA@FreeBSD.org> From: "Jonathan T. Looney" Date: Thu, 30 Aug 2018 21:15:37 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r337776 - head/sys/netinet6 To: kp@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Aug 2018 01:15:57 -0000 On Thu, Aug 30, 2018 at 6:00 PM Kristof Provost wrote: > On 14 Aug 2018, at 19:17, Jonathan T. Looney wrote: > > + uint32_t hash, hashkey[sizeof(struct in6_addr) * 2 + 1], *hashkeyp; > > I=E2=80=99m pretty sure you didn=E2=80=99t mean for the hashkey to be 102= 8 bytes long. > Yikes. Yep, that's a bug. I originally spelled this as 9; however, decided to rewrite it to avoid "magic numbers". It made it through all my manual testing; but, that makes sense since all my positive functional tests were on an unloaded machine, so the extra stack garbage would be more likely to be consistent. > I=E2=80=99ve done this, which fixes the problem: > > diff --git a/sys/netinet6/frag6.c b/sys/netinet6/frag6.c > index 0f30801540a..e1f2b3f5842 100644 > --- a/sys/netinet6/frag6.c > +++ b/sys/netinet6/frag6.c > @@ -218,7 +218,9 @@ frag6_input(struct mbuf **mp, int *offp, int proto) > int offset =3D *offp, nxt, i, next; > int first_frag =3D 0; > int fragoff, frgpartlen; /* must be larger than u_int16_t = */ > - uint32_t hash, hashkey[sizeof(struct in6_addr) * 2 + 1], *hashkey= p; > + uint32_t hashkey[(sizeof(struct in6_addr) * 2 + sizeof(u_int32_t)= ) / > + sizeof(uint32_t)]; > + uint32_t hash, *hashkeyp; > struct ifnet *dstifp; > u_int8_t ecn, ecn0; > #ifdef RSS > > That looks fine to me, either with or without the followup suggestion of using sizeof(ip6f->ip6f_ident). Feel free to commit this change (after appropriate re@ approval). Or, let me know if you prefer I do it. Either way, I'll wear the pointy hat (sadly, I suspect it is neither the first nor last I will earn). Jonathan