Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1170495ybg; Thu, 4 Jun 2020 02:56:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHzCkOtHTJg1rqXSLbJXU5JqjTSyErOxJRx2F6MmvXiMk4y4AwJwD5FAWBxuEiFOKj45Nx X-Received: by 2002:a17:906:4b50:: with SMTP id j16mr3389121ejv.415.1591264607788; Thu, 04 Jun 2020 02:56:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591264607; cv=none; d=google.com; s=arc-20160816; b=c+Uoah9EGOIP5pcJWboM204hZa5gXtF+nky1zVulJLuhbVZ1Ux5MVb/GmIagpG6Su7 zymAGQEcMev6VI3ySwTOT0GzYZz3MWp2zrxp+3LFiJAmKPL5VxzfXaw1m/pZlxqLNx1N a2KJs6a3wJJ+Id8hINoYY4UDlB31WgsL75+rsz9INnlIFjT5aDF4a0Bj98KgzMdZqQzs QtEUYTIoOKI+dLgiUFpLgYmg5tSEQs02i2I6iGMFAN/kJHezH/YWWHGlGo8ZNkDg4Yq3 QRUWL49OKG3gne3m9dmBR3bPYslPwuTX2pJ4a4KxeDjf34YPuPEfz3yQ3pfklYVitExr q7lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=dmgCAZztkKponFlSOj9eb5gBCC+mYH067uJY2h6tIxo=; b=yRMJsY+NnBN4ZhnieKVGshXT2hbN4zP7cRlFqqz5Qg6oWxxPtzqZajRGGkAPXonn/B Nu17Pfu4my6cml3uPOiN9U+EfOyDtv08OMSd/1BjiPw1WFhV6OryMX6Ya1pKq+WKWH9Z /TvtI1ZcWjggJCtVfPdib3xtwGM7i1Z3inXfbz9DDW7/o/8urTPfF3RUYoHOc8qDt1Xz ub2OvozC0o0LmyJe67crkgPQ2CRx847/p2cZJpKXXc6sJwkzT/FMwDShKTPCbqAvV2uE psaQ05Y9OgSV1wfrRpBv5yS4qrnGcUnxeCBYl/M4ja0zjml75SoFsV51reAK+Izf3ZYw 9cPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=E03wrYq2; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y10si1464352edp.3.2020.06.04.02.56.24; Thu, 04 Jun 2020 02:56:47 -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=@google.com header.s=20161025 header.b=E03wrYq2; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728385AbgFDJwe (ORCPT + 99 others); Thu, 4 Jun 2020 05:52:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726711AbgFDJwd (ORCPT ); Thu, 4 Jun 2020 05:52:33 -0400 Received: from mail-oo1-xc44.google.com (mail-oo1-xc44.google.com [IPv6:2607:f8b0:4864:20::c44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88D44C03E96D for ; Thu, 4 Jun 2020 02:52:33 -0700 (PDT) Received: by mail-oo1-xc44.google.com with SMTP id z145so1112506ooa.13 for ; Thu, 04 Jun 2020 02:52:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=dmgCAZztkKponFlSOj9eb5gBCC+mYH067uJY2h6tIxo=; b=E03wrYq2qk/9Su1JbFTFYDDuOW7iHKPMLOx8+W7pS1jZqglh47WBhkKee9QC2VSjEM tvIE+XYqvmo7ESzqR6LVCkHmsd7lNeDiAhYoceTkkuEcgiMKR/9EjPSBxfE1TEpFmiEh bzoaOdFGTAK8+KqrMBwRAIGnAfvFPWkb7OjHd9duKelNwV3gJylT3glftJR/PklCsgWu SACOQ0ZBL47eO0ziL5uk4GtCoozRHtEI5bApsN6wDR6QK3SR2znFluHgB4UIOVCbbOKV vqHVa12JrWiQ/Nv5jd740PBsu3jMVVDZgShkBmSuN/vh30Na+kBpDrHHAI+8TVj3nxax gdWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=dmgCAZztkKponFlSOj9eb5gBCC+mYH067uJY2h6tIxo=; b=oKv1WxfWAS9qCx8M2JInpWcV9MyOepPn07f5GFXi8chqvcOiLcQeNUB1YU5aLKdqE8 aNxprCJPU5uj2N2YzCshFi0Hqv4p1cl5PzRlJSG6MR9fqaXHb3NPpIMOrqPLOCuCtyro hK2p0C2O0tPxSLmOjNI9kbE18vDjoLV3+bmu4ICkOOD0bZlS/3KPVf15ifZwqNHtJ6Hj wpaC05+/8JC/qtG1Qe+gLoKXWnzZoaJ5s4c+bvBdkL2kjCeCyC+LmT12axBILmRxGMAu ygoNKQrAZHt2w6vLCT6gK1RIycO4d8g5RmQpYJcsKz4BRrQnyWxr6Ul/3CRQxL5we37W yEeA== X-Gm-Message-State: AOAM530tx3GSCHLrkhlNvv8zcknOch4h5yHfIRpvQQ9egfOKf1cOJdUq tAvg0mCZxGe+n7Ab8ZJoP30h6cDdTkmjXMM9PJdnQg== X-Received: by 2002:a4a:b54b:: with SMTP id s11mr3156030ooo.14.1591264352701; Thu, 04 Jun 2020 02:52:32 -0700 (PDT) MIME-Version: 1.0 References: <20200603114014.152292216@infradead.org> <20200603120037.GA2570@hirez.programming.kicks-ass.net> <20200603120818.GC2627@hirez.programming.kicks-ass.net> <20200603121815.GC2570@hirez.programming.kicks-ass.net> <20200603160722.GD2570@hirez.programming.kicks-ass.net> <20200603181638.GD2627@hirez.programming.kicks-ass.net> In-Reply-To: From: Marco Elver Date: Thu, 4 Jun 2020 11:52:18 +0200 Message-ID: Subject: Re: [PATCH 0/9] x86/entry fixes To: Peter Zijlstra Cc: Thomas Gleixner , "the arch/x86 maintainers" , "Paul E. McKenney" , kasan-dev , LKML , Will Deacon , Dmitry Vyukov , Alexander Potapenko , Andrey Konovalov Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 4 Jun 2020 at 08:00, Marco Elver wrote: > > On Wed, 3 Jun 2020 at 21:10, Marco Elver wrote: > > > > On Wed, 3 Jun 2020 at 20:16, Peter Zijlstra wrote: > > > > > > On Wed, Jun 03, 2020 at 06:07:22PM +0200, Peter Zijlstra wrote: > > > > On Wed, Jun 03, 2020 at 04:47:54PM +0200, Marco Elver wrote: > > > > > > > > With that in mind, you could whitelist "__ubsan_handle"-prefixed > > > > > functions in objtool. Given the __always_inline+noinstr+__ubsan_handle > > > > > case is quite rare, it might be reasonable. > > > > > > > > Yes, I think so. Let me go have dinner and then I'll try and do a patch > > > > to that effect. > > > > > > Here's a slightly more radical patch, it unconditionally allows UBSAN. > > > > > > I've not actually boot tested this.. yet. > > > > > > --- > > > Subject: x86/entry, ubsan, objtool: Whitelist __ubsan_handle_*() > > > From: Peter Zijlstra > > > Date: Wed Jun 3 20:09:06 CEST 2020 > > > > > > The UBSAN instrumentation only inserts external CALLs when things go > > > 'BAD', much like WARN(). So treat them similar to WARN()s for noinstr, > > > that is: allow them, at the risk of taking the machine down, to get > > > their message out. > > > > > > Suggested-by: Marco Elver > > > Signed-off-by: Peter Zijlstra (Intel) > > > > This is much cleaner, as it gets us UBSAN coverage back. Seems to work > > fine for me (only lightly tested), so > > > > Acked-by: Marco Elver > > > > Thanks! > > I was thinking that if we remove __no_sanitize_undefined from noinstr, > we can lift the hard compiler restriction for UBSAN because > __no_sanitize_undefined isn't used anywhere. Turns out, that attribute > isn't broken on GCC <= 7, so I've sent v2 of my series: > https://lkml.kernel.org/r/20200604055811.247298-1-elver@google.com Now that hopefully KASAN/KCSAN/UBSAN are fine, I'm looking at adding a patch for KCOV: https://lkml.kernel.org/r/20200604095057.259452-1-elver@google.com Will that work? Thanks, -- Marco