Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1642867pxk; Fri, 2 Oct 2020 15:17:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3hPZnKv9v/zCCUJQYK7ozfVLVbekhiQNF+AUII32bokeeGpV62kA76+rstfK7pv86vT30 X-Received: by 2002:a50:fe0f:: with SMTP id f15mr4858379edt.235.1601677074160; Fri, 02 Oct 2020 15:17:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601677074; cv=none; d=google.com; s=arc-20160816; b=XHuuTaUEyNvmwcmiAQWxLvtjHmZ3FiY08czPO8b4KXTzDOJS3R5RJEv7F9JJusF/nP gvmMLmp/3OPbVWzl305tNd4S7boGuHCX+PbGMzPtAYFMRqe0i5cDVXbkPFmvhA2YKNo2 oaqKb/MR5QMfS4GFg0PCuADUqTVaHa/qSamNfbo8uTxnI6e3sVg+W2Z9ppjZuX1KaMcB faa5aco7hC5W2zZabreKHRq+Q50Vbgry8gvIHC0rrY1hBErcj279Gf+p1KQ7AbRuID/o d5dlhLmc6x9MaqktLnVV1ax/t+yYEVfag6ebgfgs9OaFwYbsLzYGa9nJfFnepxcUOhk+ vd7g== 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=V0SUsmWACvD3dNMBDG6SPv9xQ8I4+FrehwcPDr9x9nQ=; b=rBaOe8a52Qq/j/r4otFYkGib7Ow09Y78sOscOTFKhLP2V7AtTEjuqH/Xh79RjtBws/ ygcsPe90KgwpdDRlPoC2GmjiSFk7nasHsgtEzsaIb27CDMPDvkpQa0QLF9jMmd0EQCbK oqrXdya2axcWyUVVExKuG0B0NDxoPY9yDjeUBqCJMFrFgC2OY1g/fryFY2q4Pohb6owg UHFHV76yt4FL1+zd29ciSKpT5qFTlzXhtiDx0HEHu/7wlcBTQGX3ZK7FVzXJI5CrE6OR ZHpkd+rqnDT+ykiUcNfZ4uQ059hSFWvZLucXbKGGktqEcepE5DzcUd6qdekz9hEImcQ1 fdIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=NspRsNBo; 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 fi11si1978480ejb.741.2020.10.02.15.17.31; Fri, 02 Oct 2020 15:17:54 -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=NspRsNBo; 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 S1725796AbgJBWPo (ORCPT + 99 others); Fri, 2 Oct 2020 18:15:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725601AbgJBWPc (ORCPT ); Fri, 2 Oct 2020 18:15:32 -0400 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FFA8C0613E3 for ; Fri, 2 Oct 2020 15:15:32 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id f18so2290805pfa.10 for ; Fri, 02 Oct 2020 15:15: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=V0SUsmWACvD3dNMBDG6SPv9xQ8I4+FrehwcPDr9x9nQ=; b=NspRsNBoQmAwlT7ORJjoYtbzCkS8Mem1PHd5ELyCp11qlcVrFG/e9NIs9mzirqBWRb sy2KeczTIFS+05DESF5CXcTDsPhucuYeI88jXAgsYuq8GCfBtZ3/bX0BRQ7aw9M6uYNy uz+algmJ3/4kBFBTVxv4JjL7VqNnzzFzjRQ0w= 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=V0SUsmWACvD3dNMBDG6SPv9xQ8I4+FrehwcPDr9x9nQ=; b=Yh+duj3E6OEscBKzoWQcxiNACFa3qfDr3GeRam7zKD0bxAY5+aMPonFxKmIrN48gWA 5EEdwTiIr6csJbA61GZtw8oaigv/QcKDyYRTytDdww43NojILM4N5JCbM//rAzwFGpBh VYN4TEem0fb98mtoo0xULAV0hxOWw5MfMsoVpELdJqEjX2Rel4lUFgokDohjF+KiPFZj cjI3wScRkfSBtMhoStgj+olWxgiFVddYZTaxUtYlFNWFij7GqS38LOe+kfLKhrOEyois idNnNiJWHO1DQaO3cGT7drMlPH6aFiuOqfIE8DbxtuCi1BjDb4Ys5gvDFZoUZuHeuNoC 6mfg== X-Gm-Message-State: AOAM533uAA3aHTOm4sO01rWAVKieadLAJwXCvyzQzDxZ/4nWFCDUuHdS X8KYxAHVxWzg0O63CusEw/qRew== X-Received: by 2002:a63:794e:: with SMTP id u75mr4097073pgc.233.1601676931560; Fri, 02 Oct 2020 15:15:31 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id k4sm3349568pfp.189.2020.10.02.15.15.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Oct 2020 15:15:29 -0700 (PDT) From: Kees Cook To: Andrew Morton Cc: Kees Cook , Linus Torvalds , Ard Biesheuvel , Arnd Bergmann , Masahiro Yamada , Michal Marek , Nathan Chancellor , Nick Desaulniers , Marco Elver , Randy Dunlap , Dmitry Vyukov , George Popescu , Herbert Xu , Peter Oberparleiter , Andrey Ryabinin , clang-built-linux@googlegroups.com, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/4] ubsan: Disable object-size sanitizer under GCC Date: Fri, 2 Oct 2020 15:15:25 -0700 Message-Id: <20201002221527.177500-3-keescook@chromium.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201002221527.177500-1-keescook@chromium.org> References: <20201002221527.177500-1-keescook@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org GCC's -fsanitize=object-size (as part of CONFIG_UBSAN_MISC) greatly increases stack utilization. Do not allow this under GCC. Suggested-by: Linus Torvalds Link: https://lore.kernel.org/lkml/CAHk-=wjPasyJrDuwDnpHJS2TuQfExwe=px-SzLeN8GFMAQJPmQ@mail.gmail.com/ Signed-off-by: Kees Cook --- lib/Kconfig.ubsan | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/Kconfig.ubsan b/lib/Kconfig.ubsan index c0b801871e0b..aeb2cdea0b94 100644 --- a/lib/Kconfig.ubsan +++ b/lib/Kconfig.ubsan @@ -104,6 +104,9 @@ config UBSAN_UNSIGNED_OVERFLOW config UBSAN_OBJECT_SIZE def_bool UBSAN_MISC + # gcc hugely expands stack usage with -fsanitize=object-size + # https://lore.kernel.org/lkml/CAHk-=wjPasyJrDuwDnpHJS2TuQfExwe=px-SzLeN8GFMAQJPmQ@mail.gmail.com/ + depends on !CC_IS_GCC depends on $(cc-option,-fsanitize=object-size) config UBSAN_BOOL -- 2.25.1