Received: by 10.192.165.148 with SMTP id m20csp1753719imm; Thu, 26 Apr 2018 01:35:13 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/9I3XwVNrU+aojBYEu7XOg+rcG+7WkDlnt7O/hL0wFJio28qMcn/XjsTeWRK8QlVgqk6yk X-Received: by 10.98.64.130 with SMTP id f2mr25550960pfd.83.1524731713057; Thu, 26 Apr 2018 01:35:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524731713; cv=none; d=google.com; s=arc-20160816; b=URTNTQ54YZHYzfbl5njm7SIIGjH9+GXhuD0sRoE7RBFaq3PgqjvcWJMTGy1IEUqEtg VJp6s8ju2rvN5DMRcLC7MOR2JHstjRgGudrWca/R+TiMk0qJLMqxq010NNWNeEDzjFJo xn9SFV3C3oL22HJ5MsZdu/s/tE1VqMY7V/VEUeXStU1DDAb7TxLqoK3Rt03cJzOVtYuO PilAMsjK/FpyvEtEmiS7VVM+eRxzikL98DoF4q5ssA+fS8EtvnYb17+cOtz8QnxU1Lft FX/OmeEvehFZL+3iZThB6G0qqMK0cQyLu+zC+BqzaOuBIIt0KddpTK9d1pJBIu0BxHxW HBew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=QxMNyEjTtnQf6YfG77i/S89xY7Cp1PIJz27pvZyHDSk=; b=mBOlkM+OZ179jjpLUE6vTCZZQ2ehV6nfqxmsqdjHEFEfqXyjwKXr/LTIVu7qUBnd3a 8AmyMM1cxJ96fvY1ULk49w2ZrHde1CmAQG2uFRq920J86GKKxHMrH41aPZGvGnk2WjmN CoZxJ9pyYtO1yXMsn70nJ5M1ufkiWfz2I7H0mMacumfZyNBYjIGqm6VVnq6yPENP6XNu XR22TWyNsAzHqwPm20wh2NhhyVBXATEUGhsJ57AtJkT4AXACTn2hW7Rh49+QzpBC5g/y Us6T1QZ00D+jngmkAGkxB9J5M61939XGmV6Oq5jLg5ObfKSY+X+YqVuS1f9DbNp2tBfk 6RiA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h12si17128698pfn.300.2018.04.26.01.34.58; Thu, 26 Apr 2018 01:35:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754488AbeDZIdQ (ORCPT + 99 others); Thu, 26 Apr 2018 04:33:16 -0400 Received: from a.mx.secunet.com ([62.96.220.36]:49658 "EHLO a.mx.secunet.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753232AbeDZIdN (ORCPT ); Thu, 26 Apr 2018 04:33:13 -0400 Received: from localhost (localhost [127.0.0.1]) by a.mx.secunet.com (Postfix) with ESMTP id 8AC14201CF; Thu, 26 Apr 2018 10:33:12 +0200 (CEST) X-Virus-Scanned: by secunet Received: from a.mx.secunet.com ([127.0.0.1]) by localhost (a.mx.secunet.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KMPVUTtRSRan; Thu, 26 Apr 2018 10:33:11 +0200 (CEST) Received: from mail-essen-01.secunet.de (mail-essen-01.secunet.de [10.53.40.204]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a.mx.secunet.com (Postfix) with ESMTPS id 56F0C201CA; Thu, 26 Apr 2018 10:33:11 +0200 (CEST) Received: from gauss2.secunet.de (10.182.7.193) by mail-essen-01.secunet.de (10.53.40.204) with Microsoft SMTP Server id 14.3.389.1; Thu, 26 Apr 2018 10:33:06 +0200 Received: by gauss2.secunet.de (Postfix, from userid 1000) id B9A973182478; Thu, 26 Apr 2018 10:33:06 +0200 (CEST) Date: Thu, 26 Apr 2018 10:33:06 +0200 From: Steffen Klassert To: Stefano Brivio CC: Kees Cook , Andreas Christoforou , , "Herbert Xu" , "David S. Miller" , Alexey Kuznetsov , Hideaki YOSHIFUJI , , Subject: Re: [PATCH v4 ipsec-next] xfrm: remove VLA usage in __xfrm6_sort() Message-ID: <20180426083306.uwhew63btnoalbxw@gauss3.secunet.de> References: <20180425144639.GA38350@beast> <20180425165852.6c7460c2@epycfail> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20180425165852.6c7460c2@epycfail> User-Agent: NeoMutt/20170609 (1.8.3) X-G-Data-MailSecurity-for-Exchange-State: 0 X-G-Data-MailSecurity-for-Exchange-Error: 0 X-G-Data-MailSecurity-for-Exchange-Sender: 23 X-G-Data-MailSecurity-for-Exchange-Server: d65e63f7-5c15-413f-8f63-c0d707471c93 X-EXCLAIMER-MD-CONFIG: 2c86f778-e09b-4440-8b15-867914633a10 X-G-Data-MailSecurity-for-Exchange-Guid: FB01D57E-AF57-447D-B396-7247563355AC Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 25, 2018 at 04:58:52PM +0200, Stefano Brivio wrote: > On Wed, 25 Apr 2018 07:46:39 -0700 > Kees Cook wrote: > > > In the quest to remove all stack VLA usage removed from the kernel[1], > > just use XFRM_MAX_DEPTH as already done for the "class" array. In one > > case, it'll do this loop up to 5, the other caller up to 6. > > > > [1] https://lkml.org/lkml/2018/3/7/621 > > > > Co-developed-by: Andreas Christoforou > > Signed-off-by: Kees Cook > > --- > > v4: > > - actually remove memset(). :) > > v3: > > - adjust Subject and commit log (Steffen) > > - use "= { }" instead of memset() (Stefano) > > v2: > > - use XFRM_MAX_DEPTH for "count" array (Steffen and Mathias). > > --- > > Acked-by: Stefano Brivio Applied to ipsec-next, thanks everyone!