Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1055507ybg; Wed, 3 Jun 2020 23:03:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwszRFrPxmUJQaF4KLhYoKGJ+EiJeAJ5+zLE4T02JVWMbPcxL+ONOMV3ayGwmcVuVetyZMP X-Received: by 2002:aa7:d717:: with SMTP id t23mr2705479edq.304.1591250587722; Wed, 03 Jun 2020 23:03:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591250587; cv=none; d=google.com; s=arc-20160816; b=zLIZT5SzMV0tgzb2J+nGZ2lmoauw9nFV+jjeNN+kJu3QlEB5BYjNiHFZZmqMrVRDQT SW0WuHhLChkcF84TjIQn54LuXggkGKTg0rleTu9t2L112CKLfPYXPP+y0psPS6lOIJBL VeR3sAfrJAKEtol6YliwQdI8DtbcFwqGV/jSOyVdhBrtZooM8eqoQVos/0ji4jpEewKi a01NEtYmyOWD+k0SbzW2kLR2ZIkidxrcrgqs4FWgRM/p3GB2NfF3m9WfZaMfGiQ0SqCf AK4NW4ABK3vMkOFeYOw0UVSAkjhZhu1kKl1HUQzFdO4QSNGnCZakY1en2w40M3vdpCpv AJGw== 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=rSb0nNv2rpcsYD2Qo3eCh6ya1OcS6/RmNcjB/qUbXrc=; b=EEEpnZrOVleZ/kQgwEo7kkGRwMSoSNbuEwIRttTFaKNrxRUWUtSrxUKKP0QLOIicAB AhcueNKxN3PnKP2g0sl7ot/kwJa0pqW9Qh5+nNilWGsolMyqPV9Zq8W4oF1BwdGyb6hv KRpHWbAOytq4H7SgFxGjppLa1w++8dMyKLgvRgjes/f1rflov38jwDm5Le2jEpMutQ63 ru9nGCsMNlFPJzEany8Hsx2Oinv7fwXaERwW68f7RcsW9a1dO9H3XbgA+CnTe9957u0g M25FWc4lP7sBNE78W88C1uQobXbincczZnrtOi1VG89bBdMQJLD6kZGvCJ4pD8dZxNDN ab3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=SVZ0fEb+; 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 oz26si1143711ejb.252.2020.06.03.23.02.44; Wed, 03 Jun 2020 23:03:07 -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=SVZ0fEb+; 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 S1726987AbgFDGAn (ORCPT + 99 others); Thu, 4 Jun 2020 02:00:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726244AbgFDGAn (ORCPT ); Thu, 4 Jun 2020 02:00:43 -0400 Received: from mail-ot1-x341.google.com (mail-ot1-x341.google.com [IPv6:2607:f8b0:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 291BEC05BD43 for ; Wed, 3 Jun 2020 23:00:43 -0700 (PDT) Received: by mail-ot1-x341.google.com with SMTP id o13so3879361otl.5 for ; Wed, 03 Jun 2020 23:00:43 -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=rSb0nNv2rpcsYD2Qo3eCh6ya1OcS6/RmNcjB/qUbXrc=; b=SVZ0fEb+aKif+jSSPjT2nFzAVhEJUIuByGQGfv4qlmc+WB9pSASxF/gwGh/M7R0va9 JIqFMQPWLUmJcXuXo43nukVeTpaleXauned+5wlySa9/aTnL+zQX9DYh0z4U9FVfzFxz lWgRYdhd7+VQdlL+p47DScW5f9rlHQfBTP+UfGQBzmKrddeu6vgmt1wgfoPYJiREDkkP xuzUfW7mM9AThUGQHYl59KDE+OmD+eWvEe4W19f3PTgyuleeysn5B3Wtd0/tkt44jenH O/Ho3vCohBrbjyUO5NxtffJ/fiO+2rzjNkwVOcljB6Sla9z+LKGa1sfB5L5zM7Zbwy1A //Sw== 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=rSb0nNv2rpcsYD2Qo3eCh6ya1OcS6/RmNcjB/qUbXrc=; b=L9NdIfg4r++bLJ7VcEM88/CJdifi56MN++6X658SQBEOhLunzpg1axX+KaavA+TzR2 skdUrzU3uJfoxpbHensmCCh5kx9SkScX1bpyuC/DV/NLPrWqJod/NPPjuELKt9fnOGWH ac1vL/2GOTI5j1OE/34AAvIeP+tT1ue+X8W8Po13qgvBesfQcm/HuNc+F8aisCYVnr0T CbFKF424Fu/qb2dUIh4i83Ojz6sAtjWcJof6RLsZaHaTLfmCRnHg+hg4rzcBiZRII6DR eIztS405WW8WjwdLwFh9x6Kc8u6KF3vin/oGf6qEuuvN/h5z7IGzepPgy24QswIfnZy/ gIlw== X-Gm-Message-State: AOAM5312VHOA+HyC1kSrZBgcpfeZaJe03dC4pVdvh7w0dfYUu3sk+wxg AP2E5+hHl1vFd8Mh6BxsONlRQb6qHIVrG+xacbhF/w== X-Received: by 2002:a9d:7dc4:: with SMTP id k4mr2386984otn.251.1591250442319; Wed, 03 Jun 2020 23:00:42 -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 08:00:30 +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 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 Thanks, -- Marco