Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1475260pxb; Fri, 27 Aug 2021 09:36:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZ4O0AdPvMOEsLdA0vYdFh9wPFXCbihXZI3oes/Bg4BD9S+sv6SQvUj5oTyMNFV4/Oi4go X-Received: by 2002:a17:906:edc3:: with SMTP id sb3mr11047770ejb.114.1630082197003; Fri, 27 Aug 2021 09:36:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630082196; cv=none; d=google.com; s=arc-20160816; b=tBbM1L0zQJj0fcufeo050De8mT1b4u89gGwHOeBaZP7A6gu+MAu5w3jSpMAErT2Wn0 ecNtsB+1NwHF8UsGmv3v+hZXyTJUDnz7DmwPbmCGOLvjQAbw15yVNb/UZwwXYGGaGbrW XwEl0qlyBp1BH2HMmwcnVYEZ7sKVO8BQdONmQaE2DhdZAm5IF7AzAVAwzXJd/F9ZQBvH 791aPiJp+N5jRawcGBRiz/R8DtNgSnVdUbv0bFsbM5s+t77cuP4mMtMV3e/4HxC0O8ui OOQGLtz4UGpNyhSnFDBX1meHkrhqCpR9jvcbC6tNpq4fKJxZVUGx9tZeFax4qEcpVF6m s8CQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=wUGiyr3xsPMSx8OhiS6MBjOzSMfwTo6qvLGkcomqylk=; b=GpSk7sh71mBzG8sxNolnveRnr5za4+cSC372gR4c8G9qx2JgJEiBXR5u437RdkLnBK zbQz4L3IIk8rZKqXYYseLMcbdojceJmIFnOdCiMSBK7C4Kn3Jdg9tRzgq/ufwV4C0MvD EOFhkm97x7EUJ8n1rxtCXsai880iRejOGznLsQWGp3IjET1vhxx7fF2h03dHmnVZf/hw BdqeUuc2+km96nGLpFxjx5Na2EgBD2c+1hzX65uuqyrgjo4WUV+cuam8se0TCaOChUqT OF98uDKrs/5JqnYI4IAVp36U4a20+O0r7jDiAg37SgWaHX+0/La2iAcDFnLU2b6gyjf2 Qe3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=fp4bpLYY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id js7si5851455ejc.107.2021.08.27.09.36.11; Fri, 27 Aug 2021 09:36:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=fp4bpLYY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239018AbhH0Qbc (ORCPT + 99 others); Fri, 27 Aug 2021 12:31:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236746AbhH0QbV (ORCPT ); Fri, 27 Aug 2021 12:31:21 -0400 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B041C0613CF for ; Fri, 27 Aug 2021 09:30:32 -0700 (PDT) Received: by mail-pl1-x632.google.com with SMTP id e1so4245242plt.11 for ; Fri, 27 Aug 2021 09:30:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wUGiyr3xsPMSx8OhiS6MBjOzSMfwTo6qvLGkcomqylk=; b=fp4bpLYYPI+3WOpsTvOtEeHprf2IR2AKq6W/3xnQzzVUCltG6pZHvyAJF2Uo4qOQcI AIJzz21a/RRTPLMNI3o6iG17hcRzEjY2LXxBOn9zlXopEM7eZUuDpNawxS7KUhRn4UMS Ngc1Uer/Aq8RxX7P+GLs5CVqdQXE6DzRmBbfw= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=wUGiyr3xsPMSx8OhiS6MBjOzSMfwTo6qvLGkcomqylk=; b=XotnvpIKCbwNqjNvnM1UM/pkaO6I+v32uutc9X/j72S9pX+GlExTL6nmQqIw+X+K3M j8ZG0OLvCKnrhN5uUkxggNFN9N/mzwG8QZz2fqQkqvaMnGhX93EMasHjSxhcgCA51L/R ONYdO1K3u1jiqOW8CKf48opWFJtNH5TmlGTwpHLtee/LbsAe+tEclFdaL/kLfHSIGm3k 95tlVz/lUkdEm2B8s3E425XQHoRPC4XuTPD+ZrgLEdevIbgct0lwtTg8a2OzSIaZteBO axkqCfHxjRxmXQa4KoIJz8O6RFIEvkZi/mIwQ4fbI59SMzym+9xtvfmlkYCTOvlkB7Ff 4VAw== X-Gm-Message-State: AOAM530QgL8eeiDli+q+X5b3dXkSf9QjaRhiLu3xBFa2/BP6bOgnlUbi e2OVDJgDv7vHc3wrqZMQEDXq2Q== X-Received: by 2002:a17:902:744c:b0:136:a8cb:a05 with SMTP id e12-20020a170902744c00b00136a8cb0a05mr9520190plt.72.1630081831590; Fri, 27 Aug 2021 09:30:31 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id x16sm7444696pgc.49.2021.08.27.09.30.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Aug 2021 09:30:29 -0700 (PDT) From: Kees Cook To: linux-kernel@vger.kernel.org Cc: Kees Cook , "Gustavo A. R. Silva" , Arnd Bergmann , Masahiro Yamada , linux-kbuild@vger.kernel.org, Rasmus Villemoes , Keith Packard , Dan Williams , Daniel Vetter , clang-built-linux@googlegroups.com, linux-hardening@vger.kernel.org Subject: [PATCH v3 5/5] Makefile: Enable -Wzero-length-bounds Date: Fri, 27 Aug 2021 09:30:15 -0700 Message-Id: <20210827163015.3141722-6-keescook@chromium.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210827163015.3141722-1-keescook@chromium.org> References: <20210827163015.3141722-1-keescook@chromium.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=996; h=from:subject; bh=/SN5+6T3ztIGtswjzUhGWY/cmKXtgVAB5r1vX4FHhD8=; b=owEBbQKS/ZANAwAKAYly9N/cbcAmAcsmYgBhKRMX4PEFBk7l4lz+prByvaAJlFG/Y2kCmVwrumJm JhcDUiyJAjMEAAEKAB0WIQSlw/aPIp3WD3I+bhOJcvTf3G3AJgUCYSkTFwAKCRCJcvTf3G3AJizPD/ 92QLLpXTpLLRbzzzUB0IeioWQMIASzu0K89wSsZYLn2LG8ukNzwMXgyCoq+RMzJi64FthppGJC4dxn 5waUOlOPI9Ck0FaQ+xaR+apjpwbHPLFUbRDFdyUnKZg7O4l6av1TCIMvNuy6kUvc9DiPPCeRhdJzOt 3PeVgCh/kiVQlZo3Lp/+fypoWYtwJ63sUk8oMYoO84eyPcGo1AxVkUDf7sCBFsSNkwl54aukpDN8hf 3cTSGKtAjZhbGsZWY0Ss/Sgly58d7vt/muhqP+671muebBbWRt/gbKpYVw4kWGFZN4ND71kbpgffG4 Z0Pg6pc8oBC1b7y7RApdPHMWVXidsmJ2gHUd+11zidZZmrrOOkd6eW/RDMh2T5BCmQqm/vy9RJpOOH WPGdPwqHWFpPaLKUpVap6svg3uoGlfiuPWymjuTrHylUYbUGfj8JYlQU6J6Hiwr8uGFKqOF2v0RGeW m12csqq0mPHmmw6HWPatqh5TYvD6135KC6iGIuPJZxXWRhyNjiUw2cTqPG8z77TsYWOYbevTNzx73p 1gqJBbNM+JNygLPWnfYMiFVNAGr4jKs0t0IjRpIfxlS9uJQMuzy7ctEPaGqXsAEIVicVSGVy9BAgJ1 iJCGKyn6DOr+od18DToNiML6X9vAbLBRNDtgSXgqFNXdJYyuU0+Fygr4T43A== X-Developer-Key: i=keescook@chromium.org; a=openpgp; fpr=A5C3F68F229DD60F723E6E138972F4DFDC6DC026 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With all known internal zero-length accesses fixed, it is possible to enable -Wzero-length-bounds globally. Since this is included by default in -Warray-bounds, we just need to stop disabling it. Cc: "Gustavo A. R. Silva" Cc: Arnd Bergmann Cc: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org Signed-off-by: Kees Cook --- Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile b/Makefile index 8e7e73a642e2..8e732e875e78 100644 --- a/Makefile +++ b/Makefile @@ -994,7 +994,6 @@ KBUILD_CFLAGS += -Wno-pointer-sign KBUILD_CFLAGS += $(call cc-disable-warning, stringop-truncation) # We'll want to enable this eventually, but it's not going away for 5.7 at least -KBUILD_CFLAGS += $(call cc-disable-warning, zero-length-bounds) KBUILD_CFLAGS += $(call cc-disable-warning, stringop-overflow) # Another good warning that we'll want to enable eventually -- 2.30.2