Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3253581imu; Sun, 13 Jan 2019 22:49:09 -0800 (PST) X-Google-Smtp-Source: ALg8bN7K1Xqqss6MbuE3zZ4g+miMiWsDrHdPln0MwxRjFjIw9okKpTht6upyXwzihzwujZYQF50u X-Received: by 2002:a62:c28e:: with SMTP id w14mr24071244pfk.115.1547448549614; Sun, 13 Jan 2019 22:49:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547448549; cv=none; d=google.com; s=arc-20160816; b=rAIuCMP3VKVgzdLHGMRbIaazjZ8HTZQskLrN5PtITB9ZZSjYrt81N4EMPmQqBfb+Qy q6677tBeWj1QOHkUeBBHOi9W+vY/gAcnEbiZB21a+/YsLfBGyJnJyn4+tgqw/SUQfQL2 MSepe9zxKasWG8CwTLPnfDN6WX48f5BL0G4mowj7oe9CKUdetp3RW0XxGssSi+kc0yzc dy36vY0l/OhIhhc7Tj3JXVQQmr3a5rvfC7mdKAi5LBXolKtjhUIxoVLIXllBLeDGaDgP T/TwCM+BVv5GyNzTNH44fJ4q1egGxTeLCSPDEkXr85JxukeaL9YR28INhj5t8DNeVihR Zldw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=uMekQMBAQWpdU2bS28MdxystdPXbINwR2JAQC7wgnRE=; b=kPmQANL9rB32NX20J4iXMvOuaX/R4JjYyuAWpyq2t0I927F1lrl5FHUdf22YFvNlsA QA2rEM4gdaLH4yFNRuZ+zVlib+L5Quejr7JvTnzZGXzwx27xduiuFBbGI0kkv76sDokW E/g5T2Ttluj5awcPmjyiOzOI+uzCgBDu5dVGM2d4YXJQAGMIahCauLbV/ShQ29Jk2Ajx hhAZPuKVO8b8kPz9eZCcDjCOz+gRNE4N0RN+uBBgsKfhHfcFnYE1mCYgzcNOGr/FM13A cHCa8vh+aIgh3G4N/NrWmFgbk16Mna4OMsIDmofCteIQau/S3IJ04kUcT8brP2/pQeTP /6Xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=cNTExYEW; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a34si32918012pgm.427.2019.01.13.22.48.51; Sun, 13 Jan 2019 22:49:09 -0800 (PST) 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=@google.com header.s=20161025 header.b=cNTExYEW; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726516AbfANGrl (ORCPT + 99 others); Mon, 14 Jan 2019 01:47:41 -0500 Received: from mail-io1-f67.google.com ([209.85.166.67]:43098 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726067AbfANGrl (ORCPT ); Mon, 14 Jan 2019 01:47:41 -0500 Received: by mail-io1-f67.google.com with SMTP id b23so16796349ios.10 for ; Sun, 13 Jan 2019 22:47:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=uMekQMBAQWpdU2bS28MdxystdPXbINwR2JAQC7wgnRE=; b=cNTExYEWiVE0K8MJW4WXhqhvJg/eyhvKOZhHjI1iD42e0hiIxnzoiqAycvHgJzbG37 hBFTNy8gZyXr5whzBqd80ZZJzlD6UScstKVwiudNRTmEDQt9DJCPP8m68HiwoWD7QhOn GpcrRa90LhG/QcormFoYSr7Zakd0A4twlv6Pp2vAb3brqBunLIfsSxL0oXsCsLHuZ/9Q /OLcm+spRwWS1iN4fxc6d67qLx+UJJkWWN8p100l3iH8IMtly/grbrMWX8lDmne6neBa grIdtvnw+rhThZpJg4hlkw4d3/ffcUoAJB+Zzke/kZJQOf2Vj+5gd1wIRhqQD/2ZRlHT 3uiQ== 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=uMekQMBAQWpdU2bS28MdxystdPXbINwR2JAQC7wgnRE=; b=S6eaUz+W5USTTNRXJirRZO9Iehq4SQxivYFPqKJYMz5L90s36fozLnKN622y4fSZ2H FJN37058qMIN5hwjrJpgAc4jAgrT6vSbxMRQxfhKJbTDEW28TcEJHcIOCi9+7AnfzvsQ +G9GYeqM8+AB5Q6BgyqAm5cXaOaWqYNnzG590w/qcZifYKxJI4E7HuybTlIO5heeutr+ 6dDyj1xvEorMycWvsgNOeQygmDS/6vjnJGiGuOHniViQC6zJw/uTApneYeaN89C5sDrl sf2giVRCOvTRLjDp7kK2kEBmDj0gY4dG36RnMquwHRkKKc0V6TpSHeht93htd5UZscML 3C3Q== X-Gm-Message-State: AJcUukeIBFaaaEYnt7uE1t7SRGjj7867ku1iN5Tliff0ZlPWurY9XGTX ZIz8wZ0pcJoaB70haHggWiIOSWyL4WHHqmOrajAg2w== X-Received: by 2002:a6b:fa01:: with SMTP id p1mr9233738ioh.271.1547448459984; Sun, 13 Jan 2019 22:47:39 -0800 (PST) MIME-Version: 1.0 References: <20190113183210.56154-1-olof@lixom.net> In-Reply-To: <20190113183210.56154-1-olof@lixom.net> From: Dmitry Vyukov Date: Mon, 14 Jan 2019 07:47:28 +0100 Message-ID: Subject: Re: [PATCH] lib: test_ubsan: VLA no longer used in kernel To: Olof Johansson Cc: Andrew Morton , Jinbum Park , Colin King , LKML , Andrey Ryabinin , Kees Cook Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jan 13, 2019 at 7:32 PM Olof Johansson wrote: > > Since we now build with -Wvla, any use of VLA throws a warning. > Including this test, so... maybe we should just remove the test? > > lib/test_ubsan.c: In function 'test_ubsan_vla_bound_not_positive': > lib/test_ubsan.c:48:2: warning: ISO C90 forbids variable length array 'buf' [-Wvla] > > For the out-of-bounds test, switch to non-VLA setup. > > lib/test_ubsan.c: In function 'test_ubsan_out_of_bounds': > lib/test_ubsan.c:64:2: warning: ISO C90 forbids variable length array 'arr' [-Wvla] > > Cc: Colin Ian King > Cc: Jinbum Park > Cc: Andrey Ryabinin > Cc: Dmitry Vyukov > Cc: Kees Cook > Signed-off-by: Olof Johansson Acked-by: Dmitry Vyukov > --- > lib/test_ubsan.c | 11 +---------- > 1 file changed, 1 insertion(+), 10 deletions(-) > > diff --git a/lib/test_ubsan.c b/lib/test_ubsan.c > index 280f4979d00ed..9ea10adf7a66f 100644 > --- a/lib/test_ubsan.c > +++ b/lib/test_ubsan.c > @@ -42,14 +42,6 @@ static void test_ubsan_divrem_overflow(void) > val /= val2; > } > > -static void test_ubsan_vla_bound_not_positive(void) > -{ > - volatile int size = -1; > - char buf[size]; > - > - (void)buf; > -} > - > static void test_ubsan_shift_out_of_bounds(void) > { > volatile int val = -1; > @@ -61,7 +53,7 @@ static void test_ubsan_shift_out_of_bounds(void) > static void test_ubsan_out_of_bounds(void) > { > volatile int i = 4, j = 5; > - volatile int arr[i]; > + volatile int arr[4]; > > arr[j] = i; > } > @@ -113,7 +105,6 @@ static const test_ubsan_fp test_ubsan_array[] = { > test_ubsan_mul_overflow, > test_ubsan_negate_overflow, > test_ubsan_divrem_overflow, > - test_ubsan_vla_bound_not_positive, > test_ubsan_shift_out_of_bounds, > test_ubsan_out_of_bounds, > test_ubsan_load_invalid_value, > -- > 2.11.0 >