Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1394400ybk; Thu, 14 May 2020 07:59:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnml/4NROX4uSXCLZn8QUqvx7dtiNlSgcQGvi2ukncMVyehXPZ5sn9ArdNvyYEyzEcZDps X-Received: by 2002:a50:9312:: with SMTP id m18mr4204971eda.252.1589468375431; Thu, 14 May 2020 07:59:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589468375; cv=none; d=google.com; s=arc-20160816; b=ci98bVsAAyR9Y7MRas2e8rGtg5R5G1d4OXx/4ea9zCAUaIyeZHDUkkqK/VlnsQJeaZ x1ObjTB0fS17aZVeUGxVXnoVysPgYut3ZHcOFHNeowdvURVY6+7LRHxYA5plWdHW+Fev a0DAmfWUMTMYEQFF+5/sOS63av/P2qVQFmVoaynqaaMQNh9YIEm7uVCcJHSjRbvpbKu5 4n96z7MqaMAMe3iY1QWvRynjFgZRoPvA7BMRO9fdqKeJT30z1gh4OncjRDXlfeXKBpp3 HUU7Ve0R0uZD7a80Lyk9O70KN4G8VbjdR33hHRgWFZtfGfqo+YWnXY+7Xe9DEgaepwU3 82LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:in-reply-to:cc:references:message-id :date:subject:mime-version:from:content-transfer-encoding :dkim-signature; bh=9HjMnwIKxpe2uw0fQ8jjAuZF11Ao8ED5SVrgc8CsCDU=; b=LvDr+W3YNYZ4CuEtwnE9DGcIQ51qmixi2JSjz0I9iYJc+oZeeCsbXKWyT71XdkjkcY czl2vuLzMyLs5Agz+bx/YmmdpDeT0xMXY1VkNW9o597aVtJtr+yLzByEkDGA8IqQ1anK uJMsHdfOQqh0Hbgi92T4pehby2ltDoIrdLpuONQvdTmZBylveouUCnT7TUXznLY+AfLf TaP4p5jdgJfrwYo6AyNTK2hu7W093S7ZgObdpdXkoNj7YoGwCiZl69LtLT4XN2L3hptG 9VTWfAczQZ/aCP/xY9QffE1kqYTTqCePRSmC92qOzkgmEkilb5TC08oWlNQMXfoa81MP cgtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=JJOGiHxd; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y89si2021912edy.357.2020.05.14.07.59.12; Thu, 14 May 2020 07:59:35 -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=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=JJOGiHxd; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727909AbgENOzH (ORCPT + 99 others); Thu, 14 May 2020 10:55:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727885AbgENOzG (ORCPT ); Thu, 14 May 2020 10:55:06 -0400 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 763FBC061A0C for ; Thu, 14 May 2020 07:55:06 -0700 (PDT) Received: by mail-pf1-x430.google.com with SMTP id n18so1420859pfa.2 for ; Thu, 14 May 2020 07:55:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=9HjMnwIKxpe2uw0fQ8jjAuZF11Ao8ED5SVrgc8CsCDU=; b=JJOGiHxd0wdf2wJI5MuPpFjPtxQ7336AKRPSLZeicJkX+D3PP8scBGIsBz7GD3QQvY xiDcWzNAzUxhW5hIUcxoleTzO8oAEVfftJFQNoolwWfsMx2PiEagXOnbpeVhC6GGnS9l rCpsi9hHJ5auXSrHEZxRh3PXFSWNGOSSSXWNEWF9OCfE1HfQFB9QuHvo0E/SlgF2pCZX MZr/D/ye5y3KRfgmGbeVwwineXkE5b65/rb6DPIGi60rhr1wVF5JSJUmpqM7ec8xveV9 nqwa8FaksRAXyjj1qSAteUzrVwMtvw6/Dk+GCTMAbo2XbFa0SvjyzQAK6HWKZAdgC+2r c60w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=9HjMnwIKxpe2uw0fQ8jjAuZF11Ao8ED5SVrgc8CsCDU=; b=TEfMFj1QteCAZb9dBWe3JqDAWJElw4jtpZwAgn5BLOTOzmFZIBd8Wh+fKoza8hO8ba ZDWfonrCGv+u4wLWJYlPiPSwbDp/OfmdYnK8KoeiUwqTJIZ1vcnnbfT24NHcExqew8lh gHEqUf2ctvNwEEgWO7dL/lIBBhcle+TpJZmZTYxg3qnkg+ac48dhWDykYO14VYksRuEO kuBsKqE9xOMeutfAJEAilNI0s3nMxi+Z6TOmXiy2UIYehXUkcennhvP6s79HHma3eZaU 62e72EWj4oqNRNI6Hqp3Qi16uYI+iAq8OZC2BXUiqT9HvPGfgSxhuKCVG/g6bhkR5waU Kgtw== X-Gm-Message-State: AOAM5321j0kwWA6jHRx0sdK4Q8JNjoy04zSJcy9EMqo678bZ5hxxKa7w mYFCbiSzHz+yl+5/J2QHqpwyHA== X-Received: by 2002:a65:480c:: with SMTP id h12mr4478831pgs.106.1589468105764; Thu, 14 May 2020 07:55:05 -0700 (PDT) Received: from ?IPv6:2600:1010:b044:c0a6:fc3e:abd:d4e0:e1e4? ([2600:1010:b044:c0a6:fc3e:abd:d4e0:e1e4]) by smtp.gmail.com with ESMTPSA id nm6sm6815276pjb.34.2020.05.14.07.55.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 14 May 2020 07:55:05 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Andy Lutomirski Mime-Version: 1.0 (1.0) Subject: Re: [patch V4 part 4 02/24] x86/int3: Avoid atomic instrumentation Date: Thu, 14 May 2020 07:55:02 -0700 Message-Id: <9DBF3103-4D31-41AA-AC02-9A6F1849AA00@amacapital.net> References: <20200514131530.GQ2957@hirez.programming.kicks-ass.net> Cc: Thomas Gleixner , Andy Lutomirski , LKML , X86 ML , "Paul E. McKenney" , Alexandre Chartre , Frederic Weisbecker , Paolo Bonzini , Sean Christopherson , Masami Hiramatsu , Petr Mladek , Steven Rostedt , Joel Fernandes , Boris Ostrovsky , Juergen Gross , Brian Gerst , Mathieu Desnoyers , Josh Poimboeuf , Will Deacon In-Reply-To: <20200514131530.GQ2957@hirez.programming.kicks-ass.net> To: Peter Zijlstra X-Mailer: iPhone Mail (17E262) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On May 14, 2020, at 6:15 AM, Peter Zijlstra wrote: >=20 > =EF=BB=BFOn Thu, May 14, 2020 at 02:51:32PM +0200, Thomas Gleixner wrote: >> Peter Zijlstra writes: >>> On Wed, May 13, 2020 at 09:57:52PM -0700, Andy Lutomirski wrote: >>>>> On Tue, May 5, 2020 at 7:15 AM Thomas Gleixner wr= ote: >>>>>>=20 >>>>>> From: Peter Zijlstra >>>>>>=20 >>>>>> Use arch_atomic_*() and READ_ONCE_NOCHECK() to ensure nothing untowar= d >>>>>> creeps in and ruins things. >>>>>>=20 >>>>>> That is; this is the INT3 text poke handler, strictly limit the code >>>>>> that runs in it, lest it inadvertenly hits yet another INT3. >>>>>=20 >>>>>=20 >>>>> Acked-by: Andy Lutomirski >>>>>=20 >>>>> Does objtool catch this error? >>>=20 >>> It does not. I'll put it on the (endless) todo list.. >>=20 >> Well, at least it detects when that code calls out into something which >> is not in the non-instrumentable section. >=20 > True, but the more specific problem is that noinstr code can use > jump_label/static_call just fine. >=20 > So a more specific test is validating none of that happens in the INT3 > handler before poke_int3_handler(). Which is what I think Andy was > after. Exactly. I admit that sleep-deprived Andy was actually thinking =E2=80=9Ctg= lx and/or PeterZ found this by inspection, and somewhere it escaped objtool=E2= =80=99s notice,=E2=80=9D which is sort of the same thing :)=