Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1511659ybh; Thu, 16 Jul 2020 14:27:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzF9otPljeMnlKBuRz1Eyzhk3Oxyy1f8e7Qov4m5e4CHeCCNeyp3nxWDNPWNMo/lnZZhuAj X-Received: by 2002:aa7:c909:: with SMTP id b9mr6177564edt.111.1594934824826; Thu, 16 Jul 2020 14:27:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594934824; cv=none; d=google.com; s=arc-20160816; b=VKiqpMpWMI7EoUZNyaOkh1NygofnfeC1yPpjrqMSxspv3lp9uYOSDdRLwm50kfugIu +UFQq+JWWqZyUDgOx7tBox194pae3+sQgP0lHnI2BhsNsVL5Qgn86K6HwcliRSc1YftI Y+DtaBae5YKu1faTX7u9moeWjM24CAPcKb99UoVB4IFFhkWM50ZtDklTs+tMS2/0WlaY ekuWAeNxf9Xo4KZsdq0KhF4tcEkRqBb/gQJduz/i2zJ0Iw1FVq1iEUizfJqX0dB4a+pM eefbUVc+pWpou3FaIrbybj/HCyCsA7BkSa67sZtme4HDt1kCHsSQRRQxWsDR4MYSCPpl 5HRQ== 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=S4tbpXgCt+LdJ7QuTPeRA+fObQgUcTw9DSUS/65F4MU=; b=K92wt/rfI0GyZfUaCnz4RgcaN8qVdcQeYdqg+RdnE4FH97nrQpjlwrHClQS/ta2qy4 87oJgxuv1/pU5PSElu2a8mqTATyeEHZV2jXjsD9RdgOtTeTCEoaNTBUXNOzhNKnValRB DWvaHH3LK0HsctmayZKuGGxBFgmAPr5G86+lfMLsLiSbXMijSBsfPlYDMELTXsF2xwfP TyHOGeKoFt9v2a1H2gBhH+xLLCASm8lfDGoEmBCR0ohC2rqkKBY0KlbKtqhcSp/OuFK7 /ybJtM60DUjV8eWyM+j6vSgzVvLQYBNImTgUTzEwIBEM8yySOZiiC2kqMmxUwMP+M9Kc ugXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Q+l7XoBw; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w10si3871966ejv.343.2020.07.16.14.26.40; Thu, 16 Jul 2020 14:27:04 -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=@chromium.org header.s=google header.b=Q+l7XoBw; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726238AbgGPV0d (ORCPT + 99 others); Thu, 16 Jul 2020 17:26:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725970AbgGPV0c (ORCPT ); Thu, 16 Jul 2020 17:26:32 -0400 Received: from mail-pj1-x1042.google.com (mail-pj1-x1042.google.com [IPv6:2607:f8b0:4864:20::1042]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8472BC061755 for ; Thu, 16 Jul 2020 14:26:32 -0700 (PDT) Received: by mail-pj1-x1042.google.com with SMTP id cv18so3368453pjb.1 for ; Thu, 16 Jul 2020 14:26:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=S4tbpXgCt+LdJ7QuTPeRA+fObQgUcTw9DSUS/65F4MU=; b=Q+l7XoBw5f2LK3rM1sQJQWnlL3rB9WlWIlGX8wcJliWkCXL7b/An6ORKoVML1/iblt rN/fJIeuSz/JvolvEkoVoW8pY5n3Vr8gKwzIkpHcWsy+TOAgfExnstbA35+Oq042eszL svBipPMeqYFFQ3ZXDRC+lwf74Ck1bA1CuSV4I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=S4tbpXgCt+LdJ7QuTPeRA+fObQgUcTw9DSUS/65F4MU=; b=XC3zGzka7MQIs2JS+7POxQe7ZAtErfsTXeF5qJJxRPMBymIoK5t9s9kZm9uhLqO8TB Y76f7xZC6UOTRrl3Un7av2dq0XujS4JroX65HeQtyMShJ60/lw64Vejl/E1q/0HXTOYx ZQKcycDK33/P6bIOvH4H6MfSeVTpTWyOTToHanem4ZH89CJdCdDC3MLe1vQLljDKV32o 7YqEXe39+0O+DUcBE0JjHN4XmvrDRmFIvGZxRKoBNF/ePmRSrt0wltQcvsPh7TEt3DvM pHmcQFVRyQfzfRoVA/98lKNtpAyUbTM/vXlduJPo8lWjcvNog9pC7n4Y2gZJEpvg15d7 XSnw== X-Gm-Message-State: AOAM531h0BzprtVaDn0Qyp26RUfOXO3Os81w1xGXb82xaduXv+b/9MzY pE0DMbkWazx4cuPbCrv4959pmg== X-Received: by 2002:a17:902:9692:: with SMTP id n18mr5018526plp.86.1594934792122; Thu, 16 Jul 2020 14:26:32 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id u26sm5700644pfn.54.2020.07.16.14.26.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2020 14:26:31 -0700 (PDT) Date: Thu, 16 Jul 2020 14:26:30 -0700 From: Kees Cook To: Matthew Wilcox Cc: Gabriel Krisman Bertazi , tglx@linutronix.de, linux-kernel@vger.kernel.org, kernel@collabora.com, luto@kernel.org, gofmanp@gmail.com, linux-kselftest@vger.kernel.org, shuah@kernel.org Subject: Re: [PATCH v4 1/2] kernel: Implement selective syscall userspace redirection Message-ID: <202007161425.3D9B91DB6@keescook> References: <20200716193141.4068476-1-krisman@collabora.com> <20200716193141.4068476-2-krisman@collabora.com> <20200716210601.GN12769@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200716210601.GN12769@casper.infradead.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 16, 2020 at 10:06:01PM +0100, Matthew Wilcox wrote: > On Thu, Jul 16, 2020 at 03:31:40PM -0400, Gabriel Krisman Bertazi wrote: > > selector is an optional pointer to a char-sized userspace memory region > > that has a key switch for the mechanism. This key switch is set to > > either PR_SYS_DISPATCH_ON, PR_SYS_DISPATCH_OFF to enable and disable the > > redirection without calling the kernel. > > > > The feature is meant to be set per-thread and it is disabled on > > fork/clone/execv. > > Disabled on exec. Disabled in the child on clone/fork (and vfork, I > think). > > That means we don't need to worry about it interacting badly with > a setuid program, right? Right, that's the intention. -- Kees Cook