Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp169142pxk; Sat, 29 Aug 2020 21:42:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjPvfUr1eURU9PMkmIkUCV8O97uM//soDiPyhRlUCKDLrs4t7OFHKhcMrho7k1zn9NJuxS X-Received: by 2002:a17:907:7090:: with SMTP id yj16mr5988167ejb.73.1598762530075; Sat, 29 Aug 2020 21:42:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598762530; cv=none; d=google.com; s=arc-20160816; b=B7TpEDdrVBrJKg+hWA7vrZbmgtMZGITtfwmwQpfXMTla1X7/LRIsSqUsfSgEqhI2G/ AoiqcZVQu3Vc4Udx3qsZOq1GWM94w/yLv3aguJqQ+ziyzEaWzFg07iCoXuNz34GGGnjo XcXFj1vyxMAVLc9y9qSgoGSFdOJawOC9zlgXMZMCCErp6WAPbE+4uvah27Ksn2aaUMTY t6zNnAdWUfWle0ooLE1ke1XjSGz2f3UFr+HSHlytFnCOANtA/HS3HwN2TssdyHUBcelv 48S7mX11WkWPpD2S8RqPDaHETr7iAugxNsuyHVyr0+NyQGZqnxg+WUcOCGGbjkaZTOJz 8aVA== 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=HHWDMq/nbO4xHE4a0KqcQiAEa78+4OGfNY+553VihpA=; b=QYE0wbWgW5/mrqFWtLAE5xoQTnD/UYnanjhZqgozTff2TgmpOVWLVsDNd7uuVa0BBc Xnxx9y7kPsmQ5AWHg2CWByG348S4Ju0u+qPNWcViAGyopxx26j0U0R1uR9gvrh+EaJLc 4S+j8eHiBb6AVC9Pi/OhPonuhFPoTU8zGFCjtBT9VBQVxGY4Sye1XvQIFJLjAjsS+qXt PgBsqSd+0Vk47M2LQA/10xwsvK7DZRfxH708pxN9mMAfAHeU2oIDLT5bpJpwpklJQ3uX ENT3EQHTpr+G47ZyrNs1RTDRBkmTzodUF3zGFaXlz96SyEIFxLTmHsXfZAlkgjjQb8N1 8Bxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=oIvGVXCN; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j14si2731320edy.412.2020.08.29.21.41.46; Sat, 29 Aug 2020 21:42:10 -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=@gmail.com header.s=20161025 header.b=oIvGVXCN; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725941AbgH3Ek5 (ORCPT + 99 others); Sun, 30 Aug 2020 00:40:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725815AbgH3Ekz (ORCPT ); Sun, 30 Aug 2020 00:40:55 -0400 Received: from mail-il1-x143.google.com (mail-il1-x143.google.com [IPv6:2607:f8b0:4864:20::143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7059CC061573 for ; Sat, 29 Aug 2020 21:40:55 -0700 (PDT) Received: by mail-il1-x143.google.com with SMTP id q14so3947708ilm.2 for ; Sat, 29 Aug 2020 21:40:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HHWDMq/nbO4xHE4a0KqcQiAEa78+4OGfNY+553VihpA=; b=oIvGVXCNlLGgwIZeCgWK+LINRZM6tE8Fy0EICDHiZqnaqDcBZaxirt4X7zZZzXpN+I m8Iye277Hzg8IzN5WcPFqm8R4U6o2lTwrv3mdi7/6zbfNOjMYPDr5sS7JcFV/Fi1d8W7 mqQY5NKNRemjIm9VF6eEebcNaXWrLLkQuUo2sFAG5ZQn+hGVFpCIvDkIup35FPjeVnb9 paGHyjWKtJeVeEBs8VS0C1x7Y0wo8oAGImx2vzHQM9JrYO8SKn/QNdx+FdJ1DSfqCfFW 1JmSo6quY+Drh2k5ofagjJUCfAzcxBGe5tNyct5JFg5EhiVlgPVNIxQN3m+MFghZ/reK /abg== 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=HHWDMq/nbO4xHE4a0KqcQiAEa78+4OGfNY+553VihpA=; b=JUn8qBEul35RBi69dYhRBhF5erbOwHgHDjl/X4NRueEtuRhpXp8tZzSfNhZ7N9GcV3 Ys44nEGucwVjThUPCK5eS/fLRovQgxFDAz13BpUKZ5HjT4l6E8OanFKXiQJKGpk77k9p j3miePHJ0Kj9w9xIQ/S38UIBWTdhdLDWFtNmkkjwqFv57q5BoUXsHkjVELjTJvPQSCaP GiNilYRXdP+xPYq/hi7Q/NwoW517N1ZBIEJSeGi2fsm5MXGD9PTMTOr8Wng8jWeu971O Bg6G+Rud7MZzx77lyY6oOFpZZ/AgwYy5zzHUECTjTU5tcPqkZDsaqpZnHnVyCRFjLz41 z0rA== X-Gm-Message-State: AOAM532o0WmsbU0Zv1nrZM4G+2pgIVJheF9+NJihkgZP24i/j0x1BB76 dGnxwt86kFqeAwb/PhLtDRe1gkSh4MxHYCERzQ== X-Received: by 2002:a92:6a09:: with SMTP id f9mr4725159ilc.273.1598762453371; Sat, 29 Aug 2020 21:40:53 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Brian Gerst Date: Sun, 30 Aug 2020 00:40:42 -0400 Message-ID: Subject: Re: ptrace_syscall_32 is failing To: Andy Lutomirski Cc: Thomas Gleixner , X86 ML , LKML 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 Sat, Aug 29, 2020 at 12:52 PM Andy Lutomirski wrote: > > Seems to be a recent regression, maybe related to entry/exit work changes. > > # ./tools/testing/selftests/x86/ptrace_syscall_32 > [RUN] Check int80 return regs > [OK] getpid() preserves regs > [OK] kill(getpid(), SIGUSR1) preserves regs > [RUN] Check AT_SYSINFO return regs > [OK] getpid() preserves regs > [OK] kill(getpid(), SIGUSR1) preserves regs > [RUN] ptrace-induced syscall restart > Child will make one syscall > [RUN] SYSEMU > [FAIL] Initial args are wrong (nr=224, args=10 11 12 13 14 4289172732) > [RUN] Restart the syscall (ip = 0xf7f3b549) > [OK] Restarted nr and args are correct > [RUN] Change nr and args and restart the syscall (ip = 0xf7f3b549) > [OK] Replacement nr and args are correct > [OK] Child exited cleanly > [RUN] kernel syscall restart under ptrace > Child will take a nap until signaled > [RUN] SYSCALL > [FAIL] Initial args are wrong (nr=29, args=0 0 0 0 0 4289172732) > [RUN] SYSCALL > [OK] Args after SIGUSR1 are correct (ax = -514) > [OK] Child got SIGUSR1 > [RUN] Step again > [OK] pause(2) restarted correctly Bisected to commit 0b085e68f407 ("x86/entry: Consolidate 32/64 bit syscall entry"). It looks like it is because syscall_enter_from_user_mode() is called before reading the 6th argument from the user stack. -- Brian Gerst