Received: by 10.192.165.148 with SMTP id m20csp808402imm; Wed, 25 Apr 2018 08:01:09 -0700 (PDT) X-Google-Smtp-Source: AIpwx49Gkn1T+EeZ/irRiLEYQhHB7RKBwpu2QxK25/QvDmKHxHmfCsiVZtUtWCgt4h62Sr/f7789 X-Received: by 10.101.90.129 with SMTP id c1mr24188573pgt.20.1524668469277; Wed, 25 Apr 2018 08:01:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524668469; cv=none; d=google.com; s=arc-20160816; b=oxyZ1PMBjOdjhVWbY3YYd/cDK/QUGSXA3ivzAZp/M8hEWGqGFG7mJPnL4VAnIB8/xe XUD4ukEEgACljB/Y6ttsyeLgNVaigIyEpE6TC0y6E/Itzp7/ov49e6eKL6hB37qdkAHp 7g6S/N1zD2ijOMuPww8x5Z4naE1IduxdWNRr2gWbdSEQLvwPrmZmCjCDxOKh7NL4E0qi kNWCiemD7+jEkcqXlhcLBkKWqCh8S+bSP9qNy6GgyA+hbHun8QqkN4QpVIUpyQzn+TE9 WBqbN3gr3moObKhdAJwXykBLNhIj8QNAv/tcruDsbnxRzkROVq6YunuvFMDhldkIY9P/ 3r9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:arc-authentication-results; bh=I4RDPjqxe/eoIegxRKduRul/QwAHixAHc8TPyMtAhGc=; b=0gZU4ODZsQHZXVAYIXiPeZteG8e/6hY+fH3YsfQ84BzduoKqszbxUCSyfyELXrsiwD dRSsW54MAIixpGDVVUVOaXOtn+8utMh8/1rvJu3S1p/JBRGDyRiYV7bPvsO0QRG3azr7 k1+IdvRVSiJ5+Os6fFbP8T4HZYrlklzJN0r3jscIR3EM77o7FVaeKMgMA/75dXMuWOpJ Pb/9ncDj/gSsv7yvzH4phq4biAxwxU2nyZdf9tsTowZo+9RmvUEDi4+SA+v+AYnI78N+ z/Hyz3EXxt7RiAjL79TQ992UB+Z8SP1e/GCbBXEEnK3l7h+10ATrWE8EaxwvBnbVirGC CCNA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a5-v6si15902040pla.117.2018.04.25.08.00.55; Wed, 25 Apr 2018 08:01:09 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754874AbeDYO7D (ORCPT + 99 others); Wed, 25 Apr 2018 10:59:03 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:60796 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754400AbeDYO7A (ORCPT ); Wed, 25 Apr 2018 10:59:00 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 883CDEC014; Wed, 25 Apr 2018 14:58:59 +0000 (UTC) Received: from epycfail (ovpn-112-23.ams2.redhat.com [10.36.112.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A7DFF2023239; Wed, 25 Apr 2018 14:58:56 +0000 (UTC) Date: Wed, 25 Apr 2018 16:58:52 +0200 From: Stefano Brivio To: Kees Cook Cc: Andreas Christoforou , kernel-hardening@lists.openwall.com, Steffen Klassert , Herbert Xu , "David S. Miller" , Alexey Kuznetsov , Hideaki YOSHIFUJI , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 ipsec-next] xfrm: remove VLA usage in __xfrm6_sort() Message-ID: <20180425165852.6c7460c2@epycfail> In-Reply-To: <20180425144639.GA38350@beast> References: <20180425144639.GA38350@beast> Organization: Red Hat MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 25 Apr 2018 14:58:59 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Wed, 25 Apr 2018 14:58:59 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'sbrivio@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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