Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4278439pxj; Wed, 12 May 2021 01:53:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrxVu7z9IPcI4GLGdy/lcCe7OWq8lfWOZdmXt35qhabZy8I3uE1dfYbZp2uvxJRnPoA8MS X-Received: by 2002:a02:6d13:: with SMTP id m19mr21538806jac.65.1620809611987; Wed, 12 May 2021 01:53:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620809611; cv=none; d=google.com; s=arc-20160816; b=pLWJQrPKUMQKxyWnJXJpj4x1JSqUiEkzcwXU8LnVH3S4/TCwKc6UL1I55yTmtF7oPq A4DcbjzviUNwnDgrx1q1Rwa6w1wg/hRmmWDi2C9HTztWxeWZftqlc2egkGNmSKVPcck8 D/ChOSTiSo2gmMTji0/YiCk6lDbfw4QyTxzKMtBdmksf61RQIWFlLMda1ahi5BB2qw3Z quN+yWisIzPJNVfH/+zfxBa7Bk8aLd3BJkjUuHkMSZ9vcXXHbpipsQEKGdxavp7KkI1P ot9JXagBmETvEJ9wFGHA6zssJrhAIH4WSTO/M5x9fSVAxlly4sfLNsgCYbW3YKCNoWXx EHVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=fce5qJN1hadTzFdkSFVgTLhw/gyfml8gF90uU9wKwAo=; b=ThU+iMWFE1d5yNGpTFRhSTXtr6S5yXe11r24Opm3VjgW5iF00S1SLMinS7TOnoomp8 yT6/Ht645WclG6osgd2AkR+qEePLXpiI5KtklZNxq8/d29Qd19Fo8xhZhND3KZjmkjty GkoyzvM+lUyIAbxRxg99QKE/VO7EShy6CLFoW2P67w1CFkT8zN13IN7d5kXa9WJl13vl hRBDrFod+RI0qIJZA/bnH4WrTLpoorJJ/VFER2Tk+YkIYDnOs/f6edfDEe+2o9PkcBog eIwl5Vl4C8nnD8EywMnWMw8UB7mS9g1agAGCNO20YbaqeIxrcTS/gZXZL7vGsUX16RGT 0b5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XQlayrCX; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s3si21623655ioc.57.2021.05.12.01.53.19; Wed, 12 May 2021 01:53:31 -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=XQlayrCX; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230440AbhELIwf (ORCPT + 99 others); Wed, 12 May 2021 04:52:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230137AbhELIwc (ORCPT ); Wed, 12 May 2021 04:52:32 -0400 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 307B5C061574 for ; Wed, 12 May 2021 01:51:24 -0700 (PDT) Received: by mail-ej1-x636.google.com with SMTP id l4so33817203ejc.10 for ; Wed, 12 May 2021 01:51:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=fce5qJN1hadTzFdkSFVgTLhw/gyfml8gF90uU9wKwAo=; b=XQlayrCX96DZLM7WQw2rZQ+XhpwQHyQOgChpTkVdq4QH8yeol/wikkX7VUx0sSY38Y GxIDHMVcS7I/c4E4uU2Nky18YypHIwU9BOeAjBXmff+c2BbS0j4neSQG0WosI2TmVOQd nJRx3HK+Gp8vBQDrZD2rHxtecg0S5Z+p6OUZS4CQiWfF+W4SVvrxJd2Mw6zoSFKChcc0 v4cAVcZXK/hFdbrz08D5buiz+grHpDi7kfVUSlcoVmtqhHYN9EE40J+Fexff8ttDn3FL 5oevBRxYBawkkJU8R+20Wv1Ei992xAVqA21rAHz8GFWLHPX/UYVU7pibLHaC2wuIqI0h lA/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=fce5qJN1hadTzFdkSFVgTLhw/gyfml8gF90uU9wKwAo=; b=lsChrfB553hne7GrbtI7UdACPuTk57DI2RHJgiUMA8rf1VWueZFtUOWjZSEbeNR43Y A6jr4vM3+DRHL6FxtMSLwWL1HLLGr63HQgP6dk3rLo5VXRQf/J5OHTLdQO42DnDQ+3pN tBaoO3JN6RrbpvobfcMZYwheWV95Q5IU6BdZKDeFxt5hT+zpbp5RAa3BTWl3C5Azm+ld l+obROeqKZLujVV0KU50T794dHN6psHpuoCyvyVF0wqCyaMQBqkKxKCVwWlHHR1sTVQ4 0mzMzOg9hgYiU2yUfHy3auhS1/gV9u+PUXkDhbFtiK6FlYbHGHVSyjG0gh/uOPdUfu0X r98A== X-Gm-Message-State: AOAM530XK+YzdZe6sIpBiVvDJYS/PtkcmZea1o8MdwhIiiLuHHQL/3BK XM98ZMZIwD6MfjHL+LBRsXs= X-Received: by 2002:a17:906:cede:: with SMTP id si30mr34479922ejb.99.1620809482940; Wed, 12 May 2021 01:51:22 -0700 (PDT) Received: from gmail.com (0526E777.dsl.pool.telekom.hu. [5.38.231.119]) by smtp.gmail.com with ESMTPSA id k9sm17883147edv.69.2021.05.12.01.51.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 May 2021 01:51:22 -0700 (PDT) Sender: Ingo Molnar Date: Wed, 12 May 2021 10:51:20 +0200 From: Ingo Molnar To: "H. Peter Anvin" Cc: Ingo Molnar , Thomas Gleixner , Borislav Petkov , Andy Lutomirski , Linux Kernel Mailing List Subject: Re: [RFC v2 PATCH 7/7] x86/entry: use int for syscall number; handle all invalid syscall nrs Message-ID: References: <20210510185316.3307264-1-hpa@zytor.com> <20210510185316.3307264-8-hpa@zytor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210510185316.3307264-8-hpa@zytor.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * H. Peter Anvin wrote: > From: "H. Peter Anvin (Intel)" > > Redefine the system call number consistently to be "int". The value -1 > is a non-system call (which can be poked in by ptrace/seccomp to > indicate that no further processing should be done and that the return > value should be the current value in regs->ax, default to -ENOSYS; any > other value which does not correspond to a valid system call > unconditionally calls sys_ni_syscall() and returns -ENOSYS just like > any system call that corresponds to a hole in the system call table. > > This is the defined semantics of syscall_get_nr(), so that is what all > the architecture-independent code already expects. As documented in > (which is simply the documentation file for > ): > > /** > * syscall_get_nr - find what system call a task is executing > * @task: task of interest, must be blocked > * @regs: task_pt_regs() of @task > * > * If @task is executing a system call or is at system call > * tracing about to attempt one, returns the system call number. > * If @task is not executing a system call, i.e. it's blocked > * inside the kernel for a fault or signal, returns -1. > * > * Note this returns int even on 64-bit machines. Only 32 bits of > * system call number can be meaningful. If the actual arch value > * is 64 bits, this truncates to 32 bits so 0xffffffff means -1. > * > * It's only valid to call this when @task is known to be blocked. > */ > int syscall_get_nr(struct task_struct *task, struct pt_regs *regs); I've applied patches 1-6, thanks Peter! Wrt. patch #7 - the changelog is hedging things a bit and the changes are non-trivial. Does this patch (intend to) change any actual observable behavior in the system call interface, and if yes, in which areas? Or is this a pure cleanup with no observable changes expected? Thanks, Ingo