Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp979689ybg; Wed, 10 Jun 2020 20:05:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzz8akYFm+Gs3xDCltw58BvNgxv8JGWnDy7YcR1+4jC7pnanxV2I8x0g397qwjdk7U6wSDx X-Received: by 2002:aa7:d952:: with SMTP id l18mr5040692eds.151.1591844739683; Wed, 10 Jun 2020 20:05:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591844739; cv=none; d=google.com; s=arc-20160816; b=0reYH0LVGc0ta+pGuRPzaDTuZmd1CZhii9B4f6jCzUfxMUPlyhmq1blvuUgeQU/0zd upq0I7SRvzjmEpc58cELW6lPFHWheSpZtr/1KykLN/1DvuuU63bBaCQPhf1iQl18Cp6O ETmNa24z4YW1H28tsU87ml6rmmA3Z5xvzm4imotblGL/txKTno6FBI49Rz9TWm5Rt/57 eCDqB93faoqol3h9aiPBB/mGNa5dxTOcO2+1tTfPTU1KRe8QDZ5L5oUO+ogyasl6XnGv KTjHpLsa+u6GpkSP2Fw3flD4VO3UlyEgiMxr8qAFh67bGEWxshYaeVCBJOwHkB9/IwHP PGuw== 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=j3OsXPGIwi3xsUIwRgQitia7+o3C2dniHB1RcDZH3GE=; b=UENWugY/TcJqzGiRhUDSwSp3IyIwy/g4UME6Su5jsinKI0+egLZWKbQniic0BfqcbV niVDjYpAfmHgSVkkIHfpHVWMl2oVUCkn1Jte9CNJx/trm901AbS/LJdeTGkfHHFSKLT1 AFEKwqiQEqVYN05bjeyWZ1jwOiouPlnDZfX5JBjVsj+9rIG2arNCd1m9Z30PsA0ozerJ Ekc2c8RbNSpXUFo2dalmbZwQ+5SOLKO3i+I0QJFgvc399pGC6X60AWKFX6NpZsZGoyiX 5JxF/uyfYGZ34gmahDgX84lbc9gpkb5ghtXBwvY0wGTiz9cOJdAd0/EzSl7Bg2+RyrbZ g43w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=fcp7Rrfi; 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 p6si1124735ejb.575.2020.06.10.20.05.17; Wed, 10 Jun 2020 20:05:39 -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=fcp7Rrfi; 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 S1726523AbgFKDCz (ORCPT + 99 others); Wed, 10 Jun 2020 23:02:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726508AbgFKDCr (ORCPT ); Wed, 10 Jun 2020 23:02:47 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C04A0C08C5C2 for ; Wed, 10 Jun 2020 20:02:45 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id e18so1897311pgn.7 for ; Wed, 10 Jun 2020 20:02:45 -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=j3OsXPGIwi3xsUIwRgQitia7+o3C2dniHB1RcDZH3GE=; b=fcp7RrfiW9uA4z+tTFPju9m2g0v7xg/w/6Yv3TKyJpkvVw3AHi9F9bI1FqyDu6Hl9w GyfBNHCOgQCZw4f0JowTFQTL7UPNRXy+GlzrF7F/cvWtwqH6sFM7IejbWJFtmM65xNQl wwbn9ttjXIWQ8BBcanAOUT3ilxezqyytZ8NSI= 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=j3OsXPGIwi3xsUIwRgQitia7+o3C2dniHB1RcDZH3GE=; b=j+mKKE7dXHD+E8R39TJ6yEBM1dzOVZMOSc8a37RegFakOYjoRnR72E2mU5iWuqtQDx 7YkY3WJPkg1KspKrSPJvofdJAaxTCcSpmVtJbP+JlZ89WavhaHPpBOw1hAtJR/ThGxMS cp1nM39YR8ozrd+r9DWGocttfSGh2FWe1V9Pc/iEpYaixed6t6AUoYFbIgdSg5UDKmPv UCdONNV+qMaU8kgO8uyzh49wtBFxpciC/4XQk53VQX9mOaWwikne2dPXAqkWGw0GdbpH 1Mux1fHe9c8iSvj2ODLCle8YpP+jwAQk61tEaJ3rCNkAMFllNwlVuJLOBSrL1Jj4pTn7 /DgA== X-Gm-Message-State: AOAM533XLEM/BsaILY18MkQliuPPDP77SgsOPLSy7aXFa+ssQK21xCiA 5/bYO6ce6XCedFmGeiti2SpC7w== X-Received: by 2002:a65:484c:: with SMTP id i12mr5034279pgs.267.1591844565164; Wed, 10 Jun 2020 20:02:45 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id nl8sm1059871pjb.13.2020.06.10.20.02.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jun 2020 20:02:43 -0700 (PDT) Date: Wed, 10 Jun 2020 20:02:42 -0700 From: Kees Cook To: David Laight Cc: 'Sargun Dhillon' , Christian Brauner , "containers@lists.linux-foundation.org" , Giuseppe Scrivano , Robert Sesek , Chris Palmer , Jann Horn , Greg Kroah-Hartman , "linux-kernel@vger.kernel.org" , Matt Denton , "linux-fsdevel@vger.kernel.org" , Tejun Heo , Al Viro , "cgroups@vger.kernel.org" , "stable@vger.kernel.org" , "David S . Miller" Subject: Re: [PATCH v3 1/4] fs, net: Standardize on file_receive helper to move fds across processes Message-ID: <202006102001.E9779DFA5B@keescook> References: <202006031845.F587F85A@keescook> <20200604125226.eztfrpvvuji7cbb2@wittgenstein> <20200605075435.GA3345@ircssh-2.c.rugged-nimbus-611.internal> <202006091235.930519F5B@keescook> <20200609200346.3fthqgfyw3bxat6l@wittgenstein> <202006091346.66B79E07@keescook> <037A305F-B3F8-4CFA-B9F8-CD4C9EF9090B@ubuntu.com> <202006092227.D2D0E1F8F@keescook> <20200610081237.GA23425@ircssh-2.c.rugged-nimbus-611.internal> <40d76a9a4525414a8c9809cd29a7ba8e@AcuMS.aculab.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <40d76a9a4525414a8c9809cd29a7ba8e@AcuMS.aculab.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 10, 2020 at 08:48:45AM +0000, David Laight wrote: > From: Sargun Dhillon > > Sent: 10 June 2020 09:13 > In essence the 'copy_to_user' is done by the wrapper code. > The code filling in the CMSG buffer can be considered to be > writing a kernel buffer. > > IIRC other kernels (eg NetBSD) do the copies for ioctl() requests > in the ioctl syscall wrapper. > The IOW/IOR/IOWR flags have to be right. Yeah, this seems like it'd make a lot more sense (and would have easily caught the IOR/IOW issue pointed out later in the thread). I wonder how insane it would be to try to fix that globally in the kernel... -- Kees Cook