Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp1836848ybb; Fri, 29 Mar 2019 12:21:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqwLylPBxoAO3ORzYx/TX/yqhQbWeS17A6m+g9baHcX7p81bQrrSBRCHtCoJ1XYmbZ9a+g6Q X-Received: by 2002:a63:720c:: with SMTP id n12mr3947081pgc.348.1553887299322; Fri, 29 Mar 2019 12:21:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553887299; cv=none; d=google.com; s=arc-20160816; b=fcUMwBifRxL/QvHTIMHEcI5d6X894BAtJvKSL1aTSWOaNwcbnzGSvJu1PIbevAtchz qYzZYLE9Y2si8nJyk4Mui98vI+brvC0YSv+ggi8iFyYdk4eBf0OBRofonpqqHpSE38TU 41vdAU948CcueUxpvejUQbJsEllGJiSvC59KwYTs3KrXtH4Y6Io/ju1FsdxPOEr0pqsf m8rtRv30waXER3nFhjeHfLUYIwKhyRYezAysvnIw6I9inVD/D+pW8E9S6kwQxxWJigC+ mAA5dCCys93clZ9VigXy7RnX0y8wM8yQtrvIENe6WLr2qVMxG3v0lYy/syTe+/6Pl2Lp nuYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=WwRqoHcb/joMoCIW9HNzqmv0FQvsGlcwp2gveq+WQh4=; b=BeaGpWMCfFIQz/F0Y+6BtmDKO791GFtb7Snx/Sgw4HZXzHLAjt8zowL5SrPRTHKj3i Wjdi3bFV+3gvUrSPOokhzbqt3aNxla8Fix7I9hlUkUXDoJKEwtQPzfFGGaWZeaW3j+ia WLpvnIPUvDQXTYuDtGzSAqv3jgVmdCFi8h1Sa0tsPX/ekpLNGgsz4dB7pDqneTP6LtoJ LMyCUxEBAwI4TEm/maZPwpi0wkR2CyBp/GSwWXbqlg8L/kL+IYPjhWM3NxugGMEDygII T/sXvFO+l+QjTc4hd1+MLayus1gGdh7DXfP2XocZW2rc1r5GjFSmTTUF7gwrTvzmS6Yl 644A== ARC-Authentication-Results: i=1; mx.google.com; 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 t10si2502496plr.229.2019.03.29.12.21.24; Fri, 29 Mar 2019 12:21:39 -0700 (PDT) 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; 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 S1729901AbfC2TU3 (ORCPT + 99 others); Fri, 29 Mar 2019 15:20:29 -0400 Received: from vmicros1.altlinux.org ([194.107.17.57]:44516 "EHLO vmicros1.altlinux.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729483AbfC2TU3 (ORCPT ); Fri, 29 Mar 2019 15:20:29 -0400 Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id E316C72CC64; Fri, 29 Mar 2019 22:20:25 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id D32377CC74C; Fri, 29 Mar 2019 22:20:25 +0300 (MSK) Date: Fri, 29 Mar 2019 22:20:25 +0300 From: "Dmitry V. Levin" To: Linus Torvalds Cc: Steven Rostedt , Linux List Kernel Mailing , Ingo Molnar , Andrew Morton , Andy Lutomirski , Roland McGrath , Oleg Nesterov , linux-arch , Peter Zijlstra , Thomas Gleixner , "Gustavo A. R. Silva" , Borislav Petkov , "H. Peter Anvin" , the arch/x86 maintainers , Dominik Brodowski , Andy Lutomirski , Kees Cook , "Eric W. Biederman" Subject: Re: [RFC][PATCH 0/4 v2] sycalls: Remove args i and n from syscall_get_arguments() Message-ID: <20190329192025.GC32651@altlinux.org> References: <20190328230512.486297455@goodmis.org> <20190329134045.3fb2e69f@gandalf.local.home> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="S1BNGpv0yoYahz37" Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --S1BNGpv0yoYahz37 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 29, 2019 at 11:12:18AM -0700, Linus Torvalds wrote: > On Fri, Mar 29, 2019 at 10:40 AM Steven Rostedt wro= te: > > > > I'll keep it around for now, but this should go as a warning to Dmitry, > > to get something using it soon, or they may be dropped. >=20 > I don't think _that_ is the argument. >=20 > Quite the reverse: nobody has ever used it, why have it around, and > much less try to hurry some new pointless user to use it? >=20 > The "get system call arguments" code at least can be used somewhat > generically for things like tracing and strace. >=20 > The "set system call arguments" can NOT. >=20 > Anybody who sets system call arguments had better intimately know the > details anyway, and any user code has to have any legacy ptrace > interface anyway for all but the newest kernels. In strace we have a feature called system call tampering. Initially limited to system call number and return code tampering, it's being extended to tamper with system call arguments as well. Currently it's implemented in strace using traditional PTRACE_SETREGSET/PTRACE_SETREGS/PTRACE_POKEUSER interfaces. These interfaces indeed require intimate knowledge of the target architecture. Fortunately, strace already has this intimate knowledge, but the corresponding code would be much more trivial if an architecture-agnostic ptrace interface for setting syscall info existed in the kernel. I didn't plan to start the discussion about this new ptrace command before PTRACE_GET_SYSCALL_INFO [1] finally landed into the kernel. For us userspace people it takes a lot of time not only to get a new kernel interface accepted, but even to reintroduce an old internal kernel interface that was removed due to lack of users. For example, it took me roughly 4 months to get a relatively simple partial revert of commit 5e937a9ae913 accepted into linux-next. This was the reason why I asked to delay the removal of syscall_set_arguments() until PTRACE_GET_SYSCALL_INFO is merged into the kernel. [1] https://lore.kernel.org/lkml/20190322041409.GA27266@altlinux.org/ --=20 ldv --S1BNGpv0yoYahz37 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJcnm/5AAoJEAVFT+BVnCUIB8MP/AgpTmOfzpzU7Vmg05aY/JLF 9/jZeCDVOgvXQJ8ZYWq9xhwt7XNafhrx7u8stzDUQ1Aytxj2eljlMR2EvbcT4/w9 0fdKGhBV6TfWffskw/1KRGRZnK0xpJ9w/k9JPyAasI4s6KY0TkiA7zgAJt5oFgdw qXgZLS5+UzM/yyBPRxPED5H+991FqNS0cZ1SHH2KyMh5g/i0v9d7fNsloLMJK1Xi dW2F51kwqjIQHZUaIlzPyBdJGlZQaY8I6rGpbZM5ShOIZfHshStX7HZJnfLjt0YO C7HTwllGNAiLl7YB7aI/6qNur2qNJaetuDp4uqeNNp+ux09FsA6wfNd3ujiW1MKw Z5WnZcvnA/R9wsIcErrX8iU4C0ljPBEYAcuUjcAa79i4e/zp0PKgIef5337RRjUm LgFB53qG+bNNZwURMRvTAX9hcgAr0GeFfYXha6Kla4rRC2JJf7cEfTnOt2ufO2oG u+dLOl8iEp5KxiV0Q+YeNT0pYNcRW07QETpvkf+wR5RlcZGApwfyIIeJ/E/a7o/H ndb2gfSLCkePq69QkMyh2dFTIa6C06w5hNldWD/8kzPvnPHp+d/wZmoGY+7EKQpv V0MNaCV/yWo3hzJ7AD1xsE8l7tSmyeiVlktry5Bceb3KX/E5F2zw/v1sBMshZWkf G0aQg+TRavHMyyr42JjV =8k32 -----END PGP SIGNATURE----- --S1BNGpv0yoYahz37--