From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933750AbcFQPs5 (ORCPT ); Fri, 17 Jun 2016 11:48:57 -0400 Received: from foss.arm.com ([217.140.101.70]:51413 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752796AbcFQPso (ORCPT ); Fri, 17 Jun 2016 11:48:44 -0400 Date: Fri, 17 Jun 2016 16:48:16 +0100 From: Mark Rutland To: Kees Cook , Alexander Potapenko , Dmitry Vyukov Cc: LKML , Andrew Morton , James Morse , Michal Marek Subject: Re: [PATCHv3] kcov: reject open when kernel not instrumented Message-ID: <20160617154816.GB32754@leverpostej> References: <1466156354-21609-1-git-send-email-mark.rutland@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 17, 2016 at 08:42:28AM -0700, Kees Cook wrote: > On Fri, Jun 17, 2016 at 2:39 AM, Mark Rutland wrote: > > If the toolchain does not support -fsanitize-coverage=trace-pc, we blat > > this option from CFLAGS_KCOV, and build the kernel without > > instrumentation, even if CONFIG_KCOV was selected. However, we still > > build the rest of the kcov infrastructure, and expose a kcov file under > > debugfs. This can be confusing, as the kernel will appear to support > > kcov, yet will never manage to sample any trace PC values. While we do > > note this fact at build time, this may be missed, and a user may not > > have access to build logs. > > Do you want to refuse to build if the compiler doesn't support the > flag? I would also be happy with that, so it's up to Alexander and Dmitry. > I finally figured out how to do this, I think, for > -fstack-protector: > > http://git.kernel.org/cgit/linux/kernel/git/kees/linux.git/commit/?h=kbuild/stackprotector&id=600c1bd5f8647a8470dc2fc5a8697e3eafb5fd52 > > If you wanted, the CONFIG_KCOV test could live under the same > prepare-compiler-check target. Alexander, Dmitry, thoughts? Thanks, Mark.