Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp2570504imb; Mon, 4 Mar 2019 08:24:18 -0800 (PST) X-Google-Smtp-Source: APXvYqxq7eb5WP5pI9VqwzWRowJTM8+rUddSvw0BbLz3CG8k7/54geqwWci4tJfsHOKgYq+FXJ2B X-Received: by 2002:a63:dc0f:: with SMTP id s15mr5863715pgg.163.1551716658237; Mon, 04 Mar 2019 08:24:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551716658; cv=none; d=google.com; s=arc-20160816; b=pNYiC5GCSmRXqTMqW6GbKO5uBXjcS37p7ORKOocPcuK3GfN01bXmvdJ7qUB1jrjy+p DnQwvR9/Lck9fo8mhgkkfnWOdek3FLjQKWdpqodtaDoYxVHCS/R2keGG5U7nn1L+OgRy meLmBXyPPkDH7xO3DectjffNVQd9W9QRZz1NCbzQtsbYlI/cR7+fyNroX/vFQjh0nk7r Z/T9mMZzEDbtlqmBtJO0HPw3kwKRQ5LkwkLmI81MAojuLjg3K7LBB5bPU8mOqrRdGFVK miiBIYXZLAkxL6dRCs/mB5hKR+KGhw6G30I2h/HSgGxvM8F1peUEf9pStJCqGXvi/1EF 4CEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:content-transfer-encoding :mime-version:subject:cc:to:references:in-reply-to:from:organization; bh=m9VZtEVBbIfVRzStwxPJgNowdH6opdtGyHn8TI+X94w=; b=DsX2NUA/9WzK0+xCd/20m9raEgFJWjic7IJ8ZcFWZ2C8umvy5WlzaxP0z1k2pFW5A5 /N4fiBdL7651tYlw6Bi3MIYkUHSdz5gF+bc0xYm3Kj0CZooWufzSLKbohxthp6DTZvIo eYggnfIf1qkvLgAWj34BjEmgEbb99RIWLcbAcfpTp+Zo3P2MMjLtacSZOddyNiT89auy yzRrhiEj5pjiJNGDVe0YLskGXJkcPoOKAOyGMSRzn66XLg9SXN7zPU3iLOMyxanysYsa NDIXOFvXZ2leeyrFRgbWVv066TTFsiiJFn1rZXVpEKH1+UEJwlnbhxZa0X15dQX57tSP vvWw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f5si5877006plf.275.2019.03.04.08.24.02; Mon, 04 Mar 2019 08:24:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727296AbfCDQWY convert rfc822-to-8bit (ORCPT + 99 others); Mon, 4 Mar 2019 11:22:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43220 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726409AbfCDQWX (ORCPT ); Mon, 4 Mar 2019 11:22:23 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8685C882F5; Mon, 4 Mar 2019 16:22:23 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-121-148.rdu2.redhat.com [10.10.121.148]) by smtp.corp.redhat.com (Postfix) with ESMTP id 110755D6B3; Mon, 4 Mar 2019 16:22:20 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <1551715930.10911.468.camel@linux.ibm.com> References: <1551715930.10911.468.camel@linux.ibm.com> <155171231301.4764.5429281379303710262.stgit@warthog.procyon.org.uk> To: Mimi Zohar Cc: dhowells@redhat.com, viro@zeniv.linux.org.uk, Mimi Zohar , linux-fsdevel@vger.kernel.org, linux-security-module@vger.kernel.org, linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] vfs: Move kernel_read_file() to fs/read_write.c MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Date: Mon, 04 Mar 2019 16:22:20 +0000 Message-ID: <12096.1551716540@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 04 Mar 2019 16:22:23 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mimi Zohar wrote: > > Move kernel_read_file() to fs/read_write.c and out of fs/exec.c as it's not > > actually used by anything in the execve subsystem. > > All files being opened by the kernel should be calling one of these > helper routines.  Has that changed? prepare_binprm() uses kernel_read() and has done since at least 2014. The binfmt drivers also use kernel_read(). Since kernel_read_file() is used by a bunch of things that aren't exec, even if we switch exec to it, it should probably still go in fs/read_write.c since it seems generic. David