Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3420693pxb; Sun, 31 Jan 2021 15:42:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJyAVIUE7DjrNCTLz38+dhrTgM2KnvRK0XlRf1neCl615PJPPdpYBTJYDJdFWBdYk5o7EIqO X-Received: by 2002:a17:906:b219:: with SMTP id p25mr14487822ejz.430.1612136534352; Sun, 31 Jan 2021 15:42:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612136534; cv=none; d=google.com; s=arc-20160816; b=kEFuzfhT39B3q1RLpY5aSyDTEW5SWtLUYEQCDbjYiKX94vYDBvjOy+sQexz71R6K7z UMbbNZmRV9sOLJuBO6KP9b6sVAFlsS9nkeq5tYTk6+XjTCA81wl3+y44PL1r1f7RBLaf FDPL5t4oft98NAG06qPRY1LYpN45Hq4rfV2D57vw15wid8kzgRj0KKVwxESQRMX9st1S 0zZHOTt3d97uTf45K4NCyJI7TzpOJ0/si8EQ6O5EOz6gH8J/+c4YSqd+LJiC5kSz7/Iv asxf+gIAn/eOgFRowJJ59NQ2hUBBNIsHCC9Ft1/T291vNFKQdzAIyTwWbkAu4XQhCIaN 0wjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=GyBu0JZcnq0VY67Dekhkms4BkqM7epUKoJLuU5aP8zA=; b=kADz+SCHbbU3z57b6038ZObnGo1W6FP/1cgmIK45qeSRKZ9wZmmL+uE9kHq8+KwzV7 zQsUk3gnr2yw6gyMmHwWYkcYe8T2lSOyRTsibKClkob5mOtO2YTdkl01P8/pJAZashGe Mocv6EUBXa+t7iJi5qX029skFliG9wmrPKun4gcjFZwHxUmrZymVKIf53FeIA8ssbY0q 6xRN6CJzeu7Pcvj8dA36OzQoiDCrTFsaTPlDOxnYfHiJ6ZV0spAe4cJz9KXVAYOWiCYe slHNoDfc5YppinecMkU/qtBoqjfHno5y//AZkq8i9rf6Vd6DVnolof4s2kS5FzN4+sgt i0Xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kylehuey.com header.s=google header.b=LR0bgNlu; 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 j8si9488461edv.130.2021.01.31.15.41.49; Sun, 31 Jan 2021 15:42:14 -0800 (PST) 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=@kylehuey.com header.s=google header.b=LR0bgNlu; 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 S229813AbhAaXk2 (ORCPT + 99 others); Sun, 31 Jan 2021 18:40:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229677AbhAaXkX (ORCPT ); Sun, 31 Jan 2021 18:40:23 -0500 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D50CCC061573 for ; Sun, 31 Jan 2021 15:39:40 -0800 (PST) Received: by mail-ej1-x633.google.com with SMTP id a9so3141758ejr.2 for ; Sun, 31 Jan 2021 15:39:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kylehuey.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=GyBu0JZcnq0VY67Dekhkms4BkqM7epUKoJLuU5aP8zA=; b=LR0bgNlucGtOGUrKZh3HxAmPoFA3qddXH4x9MIv2gL/0DKzLMepvXXjHsTbJrcgw+d w+Re8IxShUjAYJqIeAvmq3EadsA450V38lKBKEuc7OcJZpbaXBaAHPIE/jXEFzVI2zQ2 yNILImjz4obinmX+/nfOdFS7aOtDieiHDt9TkXyj6PV5eqxV7xV06XPCO4AkyDAh1OZ9 OFro6nV3isxs22zAifAe9Q6hp0lpb0TXrpXaTZqN1GhfLNyHjxt1aJamvKcdKxNMUHCU AKvtQYpN+we++FIYlKHFDAX+78D9hnW1Fgopq59QAQl7GR71JAnYL13lHFtDC6rUGZcC 08lw== 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:content-transfer-encoding; bh=GyBu0JZcnq0VY67Dekhkms4BkqM7epUKoJLuU5aP8zA=; b=ikCiD/yksAws+y20PWs7p5YRfR9iUcLleFMvQ+R8r7B6RPACBwqZstjBMC03zQZTUx 186nPK9v8pIGEzltYufOTij1LgnYFyavgvAIPD6SWqJ7uSknUZAdlYkz7z+Me6PQGZfO yPIP1Z1GkSiP1nrvDZvmvT7RgkFRjF9/jP7zMLTbRJI0Yf8Gu46kK+jEr9veHJi1Sx5L VDn/N39Yc4P9tg7Zvf/JPNfHr4lpB8Si9wjls6oCgSgAexzl5uqTmiAKmAwDZZd+qgnw OB/YzNpAnQPUSqXo3rvp1rN2jT220ApyxVqigCKlZ6wYTnD3L2URpWAR2jP0817nDVBn jDCQ== X-Gm-Message-State: AOAM5331/7C2rmhsajsNOfAgPBPixT3xyuorym5brdcRR0xhWW2/zS/K UPTLiqbZVZKlHPeD92TX6dQY8fSRhfUImB46MQtlHw== X-Received: by 2002:a17:906:e09:: with SMTP id l9mr15274194eji.196.1612136379634; Sun, 31 Jan 2021 15:39:39 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Kyle Huey Date: Sun, 31 Jan 2021 15:39:28 -0800 Message-ID: Subject: Re: [REGRESSION] x86/entry: TIF_SINGLESTEP handling is still broken To: Andy Lutomirski Cc: Linus Torvalds , Thomas Gleixner , Andy Lutomirski , Gabriel Krisman Bertazi , open list , "Robert O'Callahan" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jan 31, 2021 at 3:36 PM Andy Lutomirski wrote= : > > The odd system call tracing part I have no idea who depends on it > > (apparently "rr", which I assume is some replay thing), and I suspect > > our semantics for it has been basically random historical one, and > > it's apparently what changed. > > > > That's the one that we _really_ should have a test-case for, along > > with some documentation and code comment what the actual semantics > > need to be so that we don't break it again. > > This rr thing may be tangled up with the nonsense semantics of SYSRET. I= =E2=80=99ll muck around with Kyle=E2=80=99s test and try to figure out what= broke. > > I=E2=80=99m guessing the issue is that we are correctly setting TF in the= EFLAGS image, but IRET helpfully only traps after the first user insn exec= utes, which isn=E2=80=99t what the tracer is expects. The state of TF shouldn't really matter here. There should be no user space code execution in the example I gave. This behavior all happens in the kernel and not on the silicon. - Kyle