From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752781AbdKGRjI (ORCPT ); Tue, 7 Nov 2017 12:39:08 -0500 Received: from mail-pg0-f54.google.com ([74.125.83.54]:56007 "EHLO mail-pg0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752394AbdKGRi5 (ORCPT ); Tue, 7 Nov 2017 12:38:57 -0500 X-Google-Smtp-Source: ABhQp+SolyZWk3xlUvqIaJgMPJ9r6GyyB33iY6UW8IL5N2G82A6ZylJLm1wfEkwY0ZtgtcxOCwF8CQ== From: Kees Cook To: Andrew Morton Cc: Kees Cook , Masahiro Yamada , Arnd Bergmann , Josh Triplett , Nicholas Piggin , Laura Abbott , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 0/3] Makefile: Introduce CONFIG_CC_STACKPROTECTOR_AUTO Date: Tue, 7 Nov 2017 09:38:37 -0800 Message-Id: <1510076320-69931-1-git-send-email-keescook@chromium.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As described in the final patch: Nearly all modern compilers support a stack-protector option, and nearly all modern distributions enable the kernel stack-protector, so enabling this by default in kernel builds would make sense. However, Kconfig does not have knowledge of available compiler features, so it isn't safe to force on, as this would unconditionally break builds for the compilers or architectures that don't have support. Instead, this introduces a new option, CONFIG_CC_STACKPROTECTOR_AUTO, which attempts to discover the best possible stack-protector available, and will allow builds to proceed even if the compiler doesn't support any stack-protector. This option is made the default so that kernels built with modern compilers will be protected-by-default against stack buffer overflows, avoiding things like the recent BlueBorne attack. Selection of a specific stack-protector option remains available, including disabling it. This has lived over the last several days without any unfixed 0day failures. v2: - under ..._AUTO, warn and continue on _all_ stack protector failure cases - fix 32-bit boot regression due to lazy gz. - set CONFIG_CC_STACKPROTECTOR_NONE for tiny.config. Thanks, -Kees