Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp7219372ybc; Thu, 28 Nov 2019 13:18:01 -0800 (PST) X-Google-Smtp-Source: APXvYqzPvrDYCpb3SUTP+xjQOPBSg1woxIJow+DPYChlf6ABtc2hb8cg1vYy8cs9JkBD0WeLnBRJ X-Received: by 2002:a05:6402:b15:: with SMTP id bm21mr34252892edb.243.1574975881528; Thu, 28 Nov 2019 13:18:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574975881; cv=none; d=google.com; s=arc-20160816; b=aW1gMkzJH7Ba0gzbD7/FJPh77pAq5Wd3G1lXea15Z+8gS+1AI59ohiHopbmk0aV/xn jVtlRbbuGV7gwU+55h5IKu4BHZF80GYxzFoUUpN/NeFk22N7vVABBWJZ74imWdHiLen3 adzjhs+WW5Ti102TYuzOsKRBA+YsfTmcdecGpzgd3WbR6/fg0Ffq/2CN+0+71LdW0XAn u4SI3a260sqtN9Jl4LAh2KLMBV4+FLD1NoIpFsxszMN8fK+pgR0+r+lylMD2Zt5GoyIP wpn9Fk/VEhyS3rVycmLWt+Ic9NpB8aRcs5DCgIhv2lHVep3sl+YDMsghd7D5ai+UiOvD okxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:references:in-reply-to:subject :message-id:date:mime-version:from:content-transfer-encoding :dkim-signature; bh=FyqTLTv2j4L1gEekoNfzFQVXdnYoPeHw5/qT6TKVOR4=; b=qhN8j0zqmCeqQg4ptQKFQ0hteK+RC11wXvc/VLwz5cLQu3u4310rhJWJvn2Zfi9NNJ /Z9aTcVue2MoOFtJf1mDCYO1qTpeuXQqyrlzMf1+V5c8Hc/2ozJFMh52tEY3n0o7EIgY C0dSO/BXPqoPdn7CMBkhe3QCAePlNLJR0URwxBuXSiUmHCk7HSSyOQDSp4SrqI5BVJ+X sQxXf4Psv7Oa11FJH3rt8kncX8YPwxHM/yewg1DaGy1Znb8ztOAj9ZuqZPeWfl1FEgf/ Z8FjZG76ULaHMWfVjDnmPGh5BjI9ibjbtv7wmrxtWDDCGgVkmtep8iHAfqv1GFGdzb7C Xrqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=GjdCm5Rq; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dd9si15953169edb.226.2019.11.28.13.17.36; Thu, 28 Nov 2019 13:18:01 -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=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=GjdCm5Rq; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726657AbfK1VNi (ORCPT + 99 others); Thu, 28 Nov 2019 16:13:38 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:41865 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726558AbfK1VNi (ORCPT ); Thu, 28 Nov 2019 16:13:38 -0500 Received: by mail-pg1-f196.google.com with SMTP id l26so3239968pgb.8 for ; Thu, 28 Nov 2019 13:13:38 -0800 (PST) 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:date:message-id:subject :in-reply-to:references:to:cc; bh=FyqTLTv2j4L1gEekoNfzFQVXdnYoPeHw5/qT6TKVOR4=; b=GjdCm5RqYEaOwTue8OcdWss1DQlbJTa1gCdFU0KRLokox7XApAh7YFks8mJvKlzdFf o4U4oUZjCCRjNIoiXWZ9kszfM9O4azNctAJKN/sR77q5bHsDZ/h0BGnH/UHtf5WOPtTJ ETgeBQdkzkrRrIH+DKKApqyyJF3D2yldDRY1Y0Md2vw1QMm+Vq9cmsG72EyFZOJdJZbb goAUlF4Yz+mGebcDGydlOl/m+drh4o5xNDJolJ00yKL59gCapwA78uPdoVusRnzM5Pa4 WjtyYzvPERs2s3y3O0+X1D+Kwv8gUXRzmwvYmO7rYB4wqe0YktZodSVaL/QCetxZPGQN 2XEg== 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:date :message-id:subject:in-reply-to:references:to:cc; bh=FyqTLTv2j4L1gEekoNfzFQVXdnYoPeHw5/qT6TKVOR4=; b=pJcYLJz89rcSm2tg2c6EVj2HQgNnStGxjXd2HRJ/nklgmSga/szJQiPhmpl0ru48GD TgOx8Vb+OigaTbOC8KsNFfY9XQ5muawGx5M7/OLP2mJ6CouoLTo243lNUMs18GfvJLfs OztzM83NzDZPtvioW8JiPPvuKEQr5GwdLOLgIWgktj41Rshkjg1jgG+qTbn5LRDb/qOJ jOT4skCoSpJOMC4IGioGPCA/S83ducghuuoA3si9qfgt7HXJzHsS3WraY/OGgDzOTDxL pK5UUhVhB8kch3DXOpsOPomEEYKrFQXX00W37veTeSN46sYc0sxXW7JkKxqB7CwJbSyW NcXQ== X-Gm-Message-State: APjAAAU0/YIQKXTYs+7uWIGAyhF4sdGjFElGtktub2qUpUxxOLscUjqe pcj+TEJA8cNZryPv4TMdA1I2qPPLXzWtJw== X-Received: by 2002:a63:4a1a:: with SMTP id x26mr12206916pga.298.1574975617595; Thu, 28 Nov 2019 13:13:37 -0800 (PST) Received: from ?IPv6:2601:646:c200:1ef2:ac85:b26c:253e:8928? ([2601:646:c200:1ef2:ac85:b26c:253e:8928]) by smtp.gmail.com with ESMTPSA id h5sm11814341pjc.9.2019.11.28.13.13.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 28 Nov 2019 13:13:36 -0800 (PST) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Andy Lutomirski Mime-Version: 1.0 (1.0) Date: Thu, 28 Nov 2019 13:13:34 -0800 Message-Id: Subject: Re: [PATCH] ptrace/x86: introduce TS_COMPAT_RESTART to fix get_nr_restart_syscall() In-Reply-To: References: To: Linus Torvalds , Kees Cook Cc: Oleg Nesterov , Andrew Morton , Andy Lutomirski , Borislav Petkov , Ingo Molnar , Jan Kratochvil , Pedro Alves , Peter Anvin , Thomas Gleixner , Linux Kernel Mailing List , the arch/x86 maintainers X-Mailer: iPhone Mail (17A878) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >> On Nov 28, 2019, at 11:25 AM, Linus Torvalds wrote: >>=20 >> =EF=BB=BFOn Thu, Nov 28, 2019 at 7:36 AM Oleg Nesterov w= rote: >> You misunderstood my question, I do not see a good place for the code >> above. So I am going to uglify */signal.[ch] files. >=20 > Ahh, ok, I thought that was kind of understood. >=20 >> --- a/arch/x86/include/asm/signal.h >> +++ b/arch/x86/include/asm/signal.h >> @@ -5,6 +5,10 @@ >> #ifndef __ASSEMBLY__ >> #include >> +struct restart_block; >> +extern void arch_set_restart_data(struct restart_block *); >> +#define arch_set_restart_data arch_set_restart_data >=20 > I'd just replace this with >=20 > /* We need to save TS_COMPAT at the time of the call */ > #define arch_set_restart_data(blk) (blk)->arch_data =3D > current_thread_info()->status >=20 > or something like that. I think this doesn=E2=80=99t work for x32. Let=E2=80=99s either save the res= ult of syscall_get_arch() or just actually calculate and save the restart_sy= scall nr here. Before we commit to this, Kees, do you think we can manage to just renumber r= estart_syscall()? That=E2=80=99s a much better solution if we can pull it o= ff. >=20 > Linus