Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1974616pxk; Sat, 5 Sep 2020 04:28:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyl72xJV3akmT8GIOM7OkUNkih+ElcN+lwEimzpzVCqOMgoDIwZiTelf+vJrTnPDJqL2eNK X-Received: by 2002:a50:e79c:: with SMTP id b28mr13470644edn.371.1599305334567; Sat, 05 Sep 2020 04:28:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599305334; cv=none; d=google.com; s=arc-20160816; b=XQBYcKRUQeuF+AT6FJHyqbAV9FkXtW/TcC3d24y6/bIRUAC9S0l1HhSoKOIk7j8DR0 2C+kVLrXpWrSKmAZrqP4lkPg5ASkARWlcrWMDK7WgFn/kYUR3w+/DTczXl9MT/g8plP9 f0ucOiq20wVv+htwMT1D5TFERt/sxkz/OklWVsJCtpVA4lGt550Yt3nMmA8+I/MF32EH WzHLhwBJ8NObmU7CkhYcj151nWqKaE9uHja2rVNUuNwd4wEHpEqA7cGHbpb5DQL2YhzU 6I9RemxDSSdfoloHNE5X8xnAEXpr2anxa333X9ZBej/Zk/rE938pwDhMvR6/FGTy0DSW VZXA== 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 :dkim-signature; bh=RcCo8rpDVaNpQkStt8c1HunAQwH7Y1hkDms25uGh7OM=; b=W/b/ihi9uGx87LX+7oglu14iaueoIMB/ouISZDTfGvX0OxD9SUsSFFZPHZ3YpjCCiW pvOnhki7nXziv+jR+fkTaU2YqCI2FOuOcpm3i6hJ5yf3gwXN7h8pUfEdHl323qUz1jux +DRiincgEe4sG26LlA1+sgO0zbknh3A1xt1JnGoDQgdovuJydX6fioeCYFS1BWJLYkha Z9Yt8DcAsg2htCMFSiVWG8FTm44sqs+0kcIDPDW0uQDNxNk7bqO6U3YvE38C7SaaFo9G G/dqGBJ2lelBDlODRXf/YtkNXjPTTcpVFRp1OtNlKpijPyvRcyLPkLfraZDg6ycIpX9J xYjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=H5fhTYLn; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bo3si1178979ejb.551.2020.09.05.04.28.16; Sat, 05 Sep 2020 04:28:54 -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=fail header.i=@infradead.org header.s=casper.20170209 header.b=H5fhTYLn; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728482AbgIELZP (ORCPT + 99 others); Sat, 5 Sep 2020 07:25:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728469AbgIELZJ (ORCPT ); Sat, 5 Sep 2020 07:25:09 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89A8BC061244; Sat, 5 Sep 2020 04:24:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=RcCo8rpDVaNpQkStt8c1HunAQwH7Y1hkDms25uGh7OM=; b=H5fhTYLnze+6FRQQl4W6tmfH1q pcIodbtZk0OZNy1KMaQTx5BS8S0CDbBZcr/8epL6/qMDSFzs52nOdoO8lVQW9tofPDZJDQx8A+nQZ SP5WBd5Lt7+WFiHjRZ5U5NeD1JdUH8LYQ7LRVitgJBSLXj3PIdezDLjvbFnFEAf/LB+tlBvhjd/P6 8W+BoR9OzLU7bO4kjLDP5F483ZezNZPg/YwE/lreGRBFF+PmZJ4NbBZyU+iC9qBiUciNFrmN7V7/I 1ls9g2doQTwnJH+JRPyGSZbHF2VKf89ceWGTMDjCGVhY0amiyxJlqK06cFWWIHxhPnmnb1G91GUwD AZ2H91Gw==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kEWJC-0006qo-6M; Sat, 05 Sep 2020 11:24:38 +0000 Date: Sat, 5 Sep 2020 12:24:38 +0100 From: Matthew Wilcox To: Gabriel Krisman Bertazi Cc: luto@kernel.org, tglx@linutronix.de, keescook@chromium.org, x86@kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, linux-kselftest@vger.kernel.org, shuah@kernel.org, kernel@collabora.com, Paul Gofman Subject: Re: [PATCH v6 5/9] kernel: Implement selective syscall userspace redirection Message-ID: <20200905112438.GA16750@casper.infradead.org> References: <20200904203147.2908430-1-krisman@collabora.com> <20200904203147.2908430-6-krisman@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200904203147.2908430-6-krisman@collabora.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 04, 2020 at 04:31:43PM -0400, Gabriel Krisman Bertazi wrote: > +int set_syscall_user_dispatch(int mode, unsigned long dispatcher_start, > + unsigned long dispatcher_end, char __user *selector) > +{ > + switch (mode) { > + case PR_SYS_DISPATCH_OFF: ... > + case PR_SYS_DISPATCH_ON: ... > + default: > + return -EINVAL; ... > + case PR_SET_SYSCALL_USER_DISPATCH: > + error = set_syscall_user_dispatch((int) arg2, arg3, arg4, > + (char __user *) arg5); This makes aliases of DISPATCH_OFF and DISPATCH_ON every 4GB throughout the 64-bit space of arg2. I don't think that was intentional (nor desirable). I'd suggest just making 'mode' a long and dropping the cast.