Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2883166imu; Sun, 13 Jan 2019 12:22:36 -0800 (PST) X-Google-Smtp-Source: ALg8bN7uOI4I1TFh3tvthgcBZDyTure8ebZGR2+e3PcKGMlTHC4QogafXO+eCL1Du62COqC6HgnO X-Received: by 2002:a65:6645:: with SMTP id z5mr20851208pgv.351.1547410956310; Sun, 13 Jan 2019 12:22:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547410956; cv=none; d=google.com; s=arc-20160816; b=F4NpNZ9zVdkM5pozW7g9eIII3mDLSiuE4EwnVWjkP7uu2rpX83wF+c2dWJgzhNebnr sXIstEep0WQcqBX3B7SyP+XVdIFdSooKoq0pVx3vAbHiuuXdJ3JOo4d4cwgL/OYPJs89 +62l1lKJfPYDmHwEj6yr+6fHXo41+BCMjT4NmZaIoBUwSq0Fwg5ek5jEPcTL5sE2AHsN FoOYZUkGpruQdMXWH248lwJggb2MZIRgdAtea1VkEOc5nqFEns76rjcpNj/C6OeNoFkv 6CRLlis+MWyBfXNYBQxhlHp0hYkxeJZ8iql8NB6X1Idsy7cBVNsGCHw98MXFDhAPFtoq iwXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=SZMXyt3fuC9QgBICnVxppk8SU2DS4LuGTafrd6+uVBA=; b=hYx0Rur/Fn/P7QqLvK3rZuwWn3dzurZi9N2v9WOvgGSyNZz+QPevzfo8FqrUi0yahf xF3QbbhVwsC11QlJoca/Imm8GOvM+laWvzkhf51zg7HFzEqAOUkPyiPI3QIqhIsHU5Zz yYwidNG00AsNWXSxd+jE16fH9z84n0C3cts6RQYicMi0vemg7g6KalgVm2rZMAzUzpsP 7QMWCRxlk+V4ehIKocRvMOtc4TeHlq5HkHZIpULpXZUQdx1kkhWKetlmkfdLKwCZgGK/ 3Z5TR6vwYz5MwHLWY4ypSyjiMNOh6JaI/F8COxr1mMCCeYiKvGjeKYDzZRHEzu5Mfas7 ESEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lixom-net.20150623.gappssmtp.com header.s=20150623 header.b=NSlR07vN; 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 e7si5275142pgv.499.2019.01.13.12.22.18; Sun, 13 Jan 2019 12:22:36 -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=@lixom-net.20150623.gappssmtp.com header.s=20150623 header.b=NSlR07vN; 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 S1726545AbfAMUVJ (ORCPT + 99 others); Sun, 13 Jan 2019 15:21:09 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:38211 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726428AbfAMUVI (ORCPT ); Sun, 13 Jan 2019 15:21:08 -0500 Received: by mail-pg1-f195.google.com with SMTP id g189so8552481pgc.5 for ; Sun, 13 Jan 2019 12:21:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lixom-net.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=SZMXyt3fuC9QgBICnVxppk8SU2DS4LuGTafrd6+uVBA=; b=NSlR07vNw7hCKkP4Dm1iEyvlHGEFbw/HNpJ9p6WA66QsItXmm6/NeaUgdaRbedBQpc 5mSJ1ccEyL7yka8bFXv65GIWc7FDflr0G4JyUPQ01K2w7m3BymE3or5oUt+VG8IeMYQk oGvu8kZ5A0TW+IN7uWddkgZz+HP2Spfd0ptnDNwvOxkqp9HMp9Gq4NL/A8gtH/Nhpmua lQm5zJ9F6AA8I9zaIxpwdeIhGpAE3h/NAXS9BEjzMVxOc+0oEJgYtb5mNdpM3H+YMdnB cikkotyUiFR0RqpcGrovh9bjd4S/DqCLUAHeAe6uEPivcV9Mvm0Hf38zs9h02YZ11TQF uMng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=SZMXyt3fuC9QgBICnVxppk8SU2DS4LuGTafrd6+uVBA=; b=cKAUp7QFbT2jFNLZ/9grHPOdZesXwrzKGr271pEZLr05pv4nwQ4MNzBX5xPXicHybN AX762y4mWCz2FaB9wrpwcyNq6wRRy0arPe6gjQNb/B3n7+lUaP23lfyLt/hfseHSKCUv 8ron38X/Yu/vUkRRJJlig+Wt3K/SP9dz1yrw3409FNCWmkAczdOKZjldJzVHSCPCcUA2 T+BMTq7Pz6FaxnWBlqhpjXPQIOXMglP0KDMthCAbn8XZWFq2h/K3g9wp5QZITeNfEhK5 827N/k04i8Uuo/wqmU5/YSdFzjga8MiqbaZFc/Da/6mFq+5GRDx9iHBNq8ZQiIgLu5b4 iD+g== X-Gm-Message-State: AJcUukd3tS3LUbLJOwqlAJ4bOJR9JfHK9pSOb/8uSsxI3rLd03m0IUK2 yzI3muX3FfvSb0dANLGIIPOyUXT114THpg== X-Received: by 2002:a63:e051:: with SMTP id n17mr10258933pgj.258.1547404361662; Sun, 13 Jan 2019 10:32:41 -0800 (PST) Received: from rip.lixom.net (99-152-116-91.lightspeed.sntcca.sbcglobal.net. [99.152.116.91]) by smtp.gmail.com with ESMTPSA id b4sm96702992pgq.65.2019.01.13.10.32.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 13 Jan 2019 10:32:39 -0800 (PST) From: Olof Johansson To: akpm@linux-foundation.org Cc: jinb.park7@gmail.com, colin.king@canonical.com, linux-kernel@vger.kernel.org, Olof Johansson , Andrey Ryabinin , Dmitry Vyukov , Kees Cook Subject: [PATCH] lib: test_ubsan: VLA no longer used in kernel Date: Sun, 13 Jan 2019 10:32:10 -0800 Message-Id: <20190113183210.56154-1-olof@lixom.net> X-Mailer: git-send-email 2.11.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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