Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2200726ybt; Mon, 15 Jun 2020 22:50:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYsfNN9YN9SdNGxLlIhTID3CKifGM84+25+X9pQB6i5XHldNpIrrQeDV6GcFuGrtm2hZeA X-Received: by 2002:a05:6402:1285:: with SMTP id w5mr1096213edv.73.1592286649064; Mon, 15 Jun 2020 22:50:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592286649; cv=none; d=google.com; s=arc-20160816; b=LX6XV6BLi0rgqgmn4vUyp9URs19UHOv4QXJK7weUC0VSNbWRE4WFPU7r61217uhXwH eRyQ1v1o6J1DVs36Jhy+bIfrG+UZJwJn9Y5zeLnWo0Deqt3ykl1cFLvJ/GclgTHsqfvY 1RGY9uQ49gLbqXHM/Xn55OFR2dzcFr/qt8xisbru2oLz3vLEPnv0wSfRoTQYycd7pwdY fxycX8gLBoeqIg718Ng+nnvQHKGLCdbOwzvd7RJbTYN5rr8diFJbE8iH5q/BBTOGZwbS +J9kgi6geJOJcUuasGgbdEPBN/e2B8bWBCp0mhtXPX5Fya2EBWAkkRM3h5XRFWhOnk1s CtRQ== 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=jVMXkZReclJfWUwDhO52OxqMkCMrLsR1BufGDz+LRJA=; b=iDOV48k0PvQUXJasCuyMAUbNZpt0fD4rB1fDrD3UB4ajAuXDOzKUIdbmdLwGj8/JL2 MqXxBojHJnBU37qadFCFADc5NmIXF2nXIYKnE6qUyRJb61gnK2oIzRzf0ZAerOkzlKFt 0Sms+UcdbZa/CbaKYDGPZxGS6YFveEq9Q7eFxBpBF2eMjsZkF4B9ZNAYWbty7R5PB42G 4Ab1edeRB2hxSnHEkqSVAsrapwyv2PmOiH8T3wCkwoEq4DkSXVeWGDz2j36trVqQs/QL lkCOvPVQug6aoVoGHyZD4508TM6FjqkotPrk3zq2KgiBnUOIKGh1eOtNga3kJXY4ulll dwSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="Y/jZuYRO"; 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 i24si9890224eds.397.2020.06.15.22.50.25; Mon, 15 Jun 2020 22:50:49 -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="Y/jZuYRO"; 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 S1726936AbgFPFsc (ORCPT + 99 others); Tue, 16 Jun 2020 01:48:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725710AbgFPFsb (ORCPT ); Tue, 16 Jun 2020 01:48:31 -0400 Received: from mail-pj1-x1041.google.com (mail-pj1-x1041.google.com [IPv6:2607:f8b0:4864:20::1041]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94833C05BD43 for ; Mon, 15 Jun 2020 22:48:30 -0700 (PDT) Received: by mail-pj1-x1041.google.com with SMTP id i12so935308pju.3 for ; Mon, 15 Jun 2020 22:48:30 -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=jVMXkZReclJfWUwDhO52OxqMkCMrLsR1BufGDz+LRJA=; b=Y/jZuYROCnWNy8yDQHa+xLPbEzmyWOXuXUaMIuKQWlxvItI97MmpLAsjOOy1PPsiNo UoQgUVJa0T9FqYKoIq8imZeyd9/P/AV+w9Bu0no0JPgG3uHnW3lsDYs4HkS6FcpyekXs MYT2cRX/qQMeXm+aj7sGNPaDaiCg0FqY7U+CU= 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=jVMXkZReclJfWUwDhO52OxqMkCMrLsR1BufGDz+LRJA=; b=Raw0mG+IiYueD6MTt46gH+6lferSrSQIWewhoXTS1e1kXqJt05UsY0ubv09mqMpzPW vPQcMcOEFHKaDOkVOc0VnDvdD+eXapsobfmGdeH//Rh1wUMe1p5RaEf9rT6fAWtEo8mU EUbpJKFj79j2oToS343UgPldNF/AASXnQfcKU0LBocDVzKJufUWv207kDS0Zybk3UBww 4uA7Ke9f87QX9qWfjeaOpO8ngWDb8vS/NGXH9OThIFX/0RaTV3jWTvkxbCMs3J0t0wHV eat8lbt30YcgHq5T+STi8prxRD1uoT2o+f0ldg4wzxowlEUC+pE5WgYkOT4gEkDYRXKi MUGg== X-Gm-Message-State: AOAM5328ZfM5WHQZebrLH+cJX15oxCshvC0CpTo8OkS17khHe06v5oha KeqWc18wZJlCBXf13e42yG5k9A== X-Received: by 2002:a17:902:7611:: with SMTP id k17mr690817pll.255.1592286510152; Mon, 15 Jun 2020 22:48:30 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id m9sm15615291pfo.200.2020.06.15.22.48.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jun 2020 22:48:29 -0700 (PDT) Date: Mon, 15 Jun 2020 22:48:28 -0700 From: Kees Cook To: Sargun Dhillon Cc: linux-kernel@vger.kernel.org, Christian Brauner , "David S. Miller" , Christoph Hellwig , Tycho Andersen , Jakub Kicinski , Alexander Viro , Aleksa Sarai , Matt Denton , Jann Horn , Chris Palmer , Robert Sesek , Giuseppe Scrivano , Greg Kroah-Hartman , Andy Lutomirski , Will Drewry , Shuah Khan , netdev@vger.kernel.org, containers@lists.linux-foundation.org, linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH v4 02/11] fs: Move __scm_install_fd() to __fd_install_received() Message-ID: <202006152247.17A6A1EAF7@keescook> References: <20200616032524.460144-1-keescook@chromium.org> <20200616032524.460144-3-keescook@chromium.org> <20200616052941.GB16032@ircssh-2.c.rugged-nimbus-611.internal> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200616052941.GB16032@ircssh-2.c.rugged-nimbus-611.internal> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 16, 2020 at 05:29:41AM +0000, Sargun Dhillon wrote: > On Mon, Jun 15, 2020 at 08:25:15PM -0700, Kees Cook wrote: > > +/** > > + * __fd_install_received() - Install received file into file descriptor table > > + * > > + * @fd: fd to install into (if negative, a new fd will be allocated) > > + * @file: struct file that was received from another process > > + * @ufd_required: true to use @ufd for writing fd number to userspace > > + * @ufd: __user pointer to write new fd number to > > + * @o_flags: the O_* flags to apply to the new fd entry > Probably doesn't matter, but this function doesn't take the fd, or ufd_required > argument in this patch. > > > + * > > + * Installs a received file into the file descriptor table, with appropriate > > + * checks and count updates. Optionally writes the fd number to userspace. > ufd does not apppear options here. Argh, yes, thanks. I think this was a fixup targeting the wrong commit. I will adjust. -- Kees Cook