Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp8379315ybc; Fri, 29 Nov 2019 09:33:53 -0800 (PST) X-Google-Smtp-Source: APXvYqy5OlG54+IYOEurkS+ycBL5hYFG0eYEwKoY/851gy3T0f5gJ6WQJw2UpHhkvH3IqX7nW8yN X-Received: by 2002:a17:906:8258:: with SMTP id f24mr36224859ejx.308.1575048833174; Fri, 29 Nov 2019 09:33:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575048833; cv=none; d=google.com; s=arc-20160816; b=I1ExUJlAS4xCqVkmoqJAKBA2nm8u8Pd+k4egyzqQLPfq83+5OjwcEkrLT5VpxKymCg jfO+tSS16ALT9F0GRUA/g/qBhCO9SjYy/YFgnFHWaSARETIHEC3/9YSy+JKxQrSdCFgK 6ddJNjSDBj0ZUbKBaUU/rrCTFBVTBnqDu+wMtsQg0iVhvhpnZilzt9rmznspRkQ/shOF x/Ko7o9mW3W78p2GfLbnwlBLE/M9feUpPoEN9ssUQ8WUWVTURY/G7U+0xXLJBa5rGJuX ftZhRxeJYyAqWBZSsBfDp1Z8Tv2EKFPUAcryczdrOCs8pQcyS7WKBR9fjVhj6QPbBGOs /DtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:user-agent:in-reply-to:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=lu1iN71LokIjGtjpqlGVpx9UlOqCL6Wwu7KcbuyxTxI=; b=j3QHCHUmc/jNb+B8J4XoDfLAda6gpSrl1egxE3QMyk5nxI8ujRMlkUiP6SBh3ftcHS cOZPtj4WSpgUoDWSQh5oC1BDxj83bFxlNMfdbBQIuzRl2adfldZ6r3QQQ0fps0ULJYwo sMqDHrXq3g1MoO5RrvsEiYyj0eHae4ItYZUvWb/PIx+GjWBAKX9lIkkGfoQgwW56YP1h JTtYI0AnI3y4PxpKNrqSW3vngioadQPeqel20RK70+Zb6VdsA4JxR+swxK6KNtqsXD1e QOWc6H41iOmc2rIKsVvvQu7LIacyYZm2HA94lb+n2VWyAW9yAqFcG4maOpUF1y/bBxUg NK/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CSjQyz1v; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dd28si17884955edb.99.2019.11.29.09.33.29; Fri, 29 Nov 2019 09:33:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CSjQyz1v; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727004AbfK2RcY (ORCPT + 99 others); Fri, 29 Nov 2019 12:32:24 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:26078 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726909AbfK2RcX (ORCPT ); Fri, 29 Nov 2019 12:32:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575048742; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lu1iN71LokIjGtjpqlGVpx9UlOqCL6Wwu7KcbuyxTxI=; b=CSjQyz1vUprYkf3yZ0DAXnqetQqzvpxJB4Ge6QQrPLg+pSZb87NQxfPVqBay0OweO8t17q 68acDyPYJhGyB2liSDQD2ranoj5mp1kV7rYjsOYG998gnMATkbPwMkqQSR90Llrm0mvMrM QV+ldLzWCACnA9nd0wPjKEMYcqov2u0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-413-jnDybVVFNViIOLXnnOZleA-1; Fri, 29 Nov 2019 12:32:21 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 511391005502; Fri, 29 Nov 2019 17:32:19 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.43.17.44]) by smtp.corp.redhat.com (Postfix) with SMTP id A26F610013A1; Fri, 29 Nov 2019 17:32:14 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Fri, 29 Nov 2019 18:32:19 +0100 (CET) Date: Fri, 29 Nov 2019 18:32:13 +0100 From: Oleg Nesterov To: Andy Lutomirski Cc: Linus Torvalds , Kees Cook , Andrew Morton , Andy Lutomirski , Borislav Petkov , Ingo Molnar , Jan Kratochvil , Pedro Alves , Peter Anvin , Thomas Gleixner , Linux Kernel Mailing List , the arch/x86 maintainers Subject: Re: [PATCH] ptrace/x86: introduce TS_COMPAT_RESTART to fix get_nr_restart_syscall() Message-ID: <20191129173213.GB3992@redhat.com> References: MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: jnDybVVFNViIOLXnnOZleA-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/28, Andy Lutomirski wrote: > > I think this doesn=E2=80=99t work for x32. Why? get_nr_restart_syscall() can still rely on the "orig_ax & __X32_SYSCAL= L_BIT" check, debugger should restore regs->orig_ax correctly. > Let=E2=80=99s either save the result of syscall_get_arch() We can save the result of syscall_get_arch(), but it doesn't distinguish x32/x86_64 tasks, so it doesn't really differ from TS_COMPAT. > or just actually calculate and save the restart_syscall nr here. sure, we we can do this. > Before we commit to this, Kees, do you think we can manage to just renumb= er > restart_syscall()? That=E2=80=99s a much better solution if we can pull = it off. Agreed. Oleg.