Received: by 10.213.65.68 with SMTP id h4csp532299imn; Wed, 4 Apr 2018 02:51:39 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/8aTe31DLcvh29wFppV+qS9qGX8V3tukbyg8E7dbAnZabtrmC+KKhiXSdTACD18Hz7jGWK X-Received: by 2002:a17:902:ab88:: with SMTP id f8-v6mr17819890plr.34.1522835499243; Wed, 04 Apr 2018 02:51:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522835499; cv=none; d=google.com; s=arc-20160816; b=Q/N1M+hFDMXpXJfCdXQGQqPBc1Bw+NVnA96dd88H2X7IMYGNQhc2XUIRvjkUoOr7Mw YIHFmo5AtsC56bOHeg0WDiwFdETDLj17zi8SC5iRYmCVv9kUOzoISLIgpy/N5bLZ11Yf QxGOkdnW704w72jXjORNawFNyAVMHkzxKe9G4rwKJW+Vw6Vc4s93HvcsiekaTmK1j428 oux49xtNlWtvFI+uBcMVOrvaBv/Sarzu3aNtt9WzsYNgAPdI9DytMkRIXbo2lWH7zkMH WvcjzCTkdY9cFejqmvOmnlQjzgaUghCVN6RGF9rueBhSuYeBBTmkdN2mWtyXR+65bDYP 1Z5Q== 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:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:arc-authentication-results; bh=pavmGDLbiwTEpWQLumeXRacdOhIbEYcMEJkKfvGvXW4=; b=yB/Q1Ic1TeoWpcohdNnHvkKgMsbKJSj+hyVdnJud3qmfjCwH7nQFAX6tYLff5h8kLq 3eH/VDbg993r8UYbSJNbAIG2EMgvgG6m6fedBwlNa7jbE3iQOGirMaDLr5HNL6dMs5U3 fK3YcZuDECCC8o1c/fBnhs95tD1Y+4y23sxL4ICCIk5AAU6AhRdb0HBGfnQwZv/KfkbK Zl44HZR2t/3mSEkZ+r4568O9tuBEQVCJfs96FswMG/0os7HcFFOxA1YmxCKiLivL5nEe 0J0/EXoETZOr4GAQmMVWuHi9s7dD5ANInlUzBwp5vVYMgQonTVl91vLWT+z9v9c+nQTT 5Tug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MgWKpnE6; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a17si521805pff.43.2018.04.04.02.51.25; Wed, 04 Apr 2018 02:51:39 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MgWKpnE6; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751280AbeDDJuR (ORCPT + 99 others); Wed, 4 Apr 2018 05:50:17 -0400 Received: from mail-vk0-f67.google.com ([209.85.213.67]:44971 "EHLO mail-vk0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751264AbeDDJuP (ORCPT ); Wed, 4 Apr 2018 05:50:15 -0400 Received: by mail-vk0-f67.google.com with SMTP id r184so11969831vke.11; Wed, 04 Apr 2018 02:50:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=pavmGDLbiwTEpWQLumeXRacdOhIbEYcMEJkKfvGvXW4=; b=MgWKpnE6M6W/xRZnzkcjInoXQTheLiPmT1vE6ntCeXLazGZR3cqjegSC8j2kOUFVlb IILVp2rPIdvKkHfcdcM/z+ymtYdwx8eR5lR4TV7hNvAqaytP2nvMk46IzhGVfbim74Qb Wj7JyKDu5kxPmU0uSVrE+h6V5gwzN7sbn0LKnEzi/TrnPIjZ0HrZlHc8vchGHtvQ2R6j Fuzd1BlMdAHFzkSeLMvITl/yWCRRJscFA5VM1pvRe9dWh16Ry9421rn6lJoUauRwzrty 51AH8esJSemJtUfQZxiq0Iw/Ryfx/KqPzuyrMDVBi4VnzfYqAk57uSGs+P+G5mAn109d 8wgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=pavmGDLbiwTEpWQLumeXRacdOhIbEYcMEJkKfvGvXW4=; b=J8cOZ4WCGXSi+teUPSlutUNdOIBHdU8e8SS7kQQCYg0n8wNYxYJ9FA8xOJbyBcVFIP lT9vFUeH2Rzw05J4v0ZTsjL6PbenRKdBE54UiGCMuHUSF6IY8YH+ic1RJc2w9Q9cBf73 xY6bHZ7wheaw94UpKeF5bDiaSiw/FKGu0tcvAcQmxOVQ1s/6pM2GeclN2m10cYyo5P6V ArBlqot78fxy2uIrva0PBRkwf0boPc9g22NEgn5y8shGOiXPiBIT4pZelLHp9RwViCuY H6N49vqOjeIjNcDMXmP1ggl7uJayH6ODymNiNdjD7DGFZbQ3ZPy22xNA1Ko+UHVzXcQg Bk8w== X-Gm-Message-State: ALQs6tDLUfpn/K7ltpweSucQtT7cRbnsuDgngXjUo9SJ8yoqE5VMUlHs qTiG+NsziR8+dkt3A+gv0FXBM1Vj4jJrSF+a8KI= X-Received: by 10.31.47.147 with SMTP id v141mr10089706vkv.121.1522835415117; Wed, 04 Apr 2018 02:50:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.179.9 with HTTP; Wed, 4 Apr 2018 02:49:54 -0700 (PDT) In-Reply-To: <4e536889-439a-49e6-dd95-2d4286913202@redhat.com> References: <1522400006-8859-1-git-send-email-s.mesoraca16@gmail.com> <4e536889-439a-49e6-dd95-2d4286913202@redhat.com> From: Salvatore Mesoraca Date: Wed, 4 Apr 2018 11:49:54 +0200 Message-ID: Subject: Re: [v3] crypto: ctr - avoid VLA use To: Laura Abbott Cc: linux-kernel@vger.kernel.org, Kernel Hardening , linux-crypto@vger.kernel.org, "David S. Miller" , Herbert Xu , Kees Cook , Eric Biggers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2018-04-03 23:37 GMT+02:00 Laura Abbott : > On 03/30/2018 01:53 AM, Salvatore Mesoraca wrote: >> --- >> crypto/ctr.c | 15 +++++++++++++-- >> 1 file changed, 13 insertions(+), 2 deletions(-) >> >> diff --git a/crypto/ctr.c b/crypto/ctr.c >> index 854d924..49c469d 100644 >> --- a/crypto/ctr.c >> +++ b/crypto/ctr.c >> @@ -21,6 +21,9 @@ >> #include >> #include >> +#define MAX_BLOCKSIZE 16 >> +#define MAX_ALIGNMASK 15 >> + > > > Can we pull this out into a header file, I think this would cover > > crypto/cipher.c: In function =E2=80=98cipher_crypt_unaligned=E2=80=99: > crypto/cipher.c:70:2: warning: ISO C90 forbids variable length array > =E2=80=98buffer=E2=80=99 [-Wvla] > u8 buffer[size + alignmask]; > ^~ Yeah, I'll send a patchset that includes the fix for crypto/cipher.c too. Thank you for the suggestion :) Salvatore