Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3300126ybt; Sat, 4 Jul 2020 12:15:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzb/6yYTwE0voOmmi921fBD8AMqgbSm9uX0NDzfsO2nNJX0Zfq10n65RhiIubkeiuABxTSK X-Received: by 2002:a17:906:c18d:: with SMTP id g13mr34344651ejz.239.1593890132571; Sat, 04 Jul 2020 12:15:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593890132; cv=none; d=google.com; s=arc-20160816; b=J7p3VtFxvLXKcq5FGzjOhBUhwvSfq8NwuVYOcer3H+U8NnUgK2zqBl7PNC4GNTU0gh QXJo8PFR89fHwHdzAaQIMdG/aGdd0tAvC0OhyAKibXg4ssAUXAVzapWptHX3Zk6cAjog eFVPO47849AH5QwKyY+xv7zD4DeEazQNqK6FH8WGh+GTSqqRK2WUjlWTcHq7uPUTgnR+ yicRQ7IRwXjn+GldqjO8+Q+ZIuvDurvOysRLPgd7BW+cNLLXj6wxezemso4MExHfYmFa +tJHDdZvkKiEB85jiJaxBUDY+dnLq6yTIw6sNgnw7F/XznsmSpI5GZCFPnmqdwV1Zdxp BCNQ== 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=F4iUDa3dtDRXZw/xT8rOR2vZ5fAZKoqf4RZc7OOfWV8=; b=vRfxii9RUzqDcClYgEGzgW4yKOlLb9a4afuYqvQa6kL7+rCJRq3/RLWSDA+Gti9Kxi IvtB6ebKWLsMRHm4NpQ7gu8TwE2KDgMLew+QeikCo1KL+azqAVupt1PCY2xN05B6eLrb b4WXilrBhX/za0tUE2dDRiSJ22bH7WU/ayD0P0f8/vaTd43oVIvVZAeYqf7vQXYkyPJV cXXtD9mZa0UmZtrrr4TYsuyvTVqZ8UNBR9hxqTEdG4hOoWuzSbAg3AWUpS7So3vR6UTT 4h+IJeJbDO5MZF0I4L3Mw6dWY1PhmZFIltXDmJ3EOo3wbth0zcmVa9SRVjcbU6w66CkU qWtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b="YO/hA7aG"; 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 j9si9592847ejk.711.2020.07.04.12.14.45; Sat, 04 Jul 2020 12:15:32 -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="YO/hA7aG"; 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 S1727106AbgGDTOZ (ORCPT + 99 others); Sat, 4 Jul 2020 15:14:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726791AbgGDTOZ (ORCPT ); Sat, 4 Jul 2020 15:14:25 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 104F1C061794; Sat, 4 Jul 2020 12:14:25 -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=F4iUDa3dtDRXZw/xT8rOR2vZ5fAZKoqf4RZc7OOfWV8=; b=YO/hA7aGz+aOl1sROiWsWS/Izd l/rue0A+a+DIVbtJC2Fxv28sJBNeRafUX7zbX/mrKJqMHhNOz4+RVgsKgTIyPNBsWlVH3oElhuYh3 SzJ0nN5HjmQwXjRE7u9p4BhJThdcS8Vg0wk35nMyhTirZ9fQEFA31D3UffGa2h9R4utUFsvPckhuS Sd5BRL6Fj1Y2dU6PdhXDcNBNGG6C+fCn5MbhAbHkyDDo6cBVModkQBHFZRtZJUVnQbl1Gb/OUvpFd WOD3xnIJZQV/6U4Z4g8czBdmheverCxGJX/JT3wSzjKeFCWKQo8/sPs0bbYJUfA75PTn/IK1siWVB KLTNXZmw==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jrncA-0004qS-0a; Sat, 04 Jul 2020 19:14:18 +0000 Date: Sat, 4 Jul 2020 20:14:17 +0100 From: Matthew Wilcox To: Greg Kroah-Hartman Cc: viro@zeniv.linux.org.uk, mtk.manpages@gmail.com, shuah@kernel.org, linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-man@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH 1/3] readfile: implement readfile syscall Message-ID: <20200704191417.GQ25523@casper.infradead.org> References: <20200704140250.423345-1-gregkh@linuxfoundation.org> <20200704140250.423345-2-gregkh@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200704140250.423345-2-gregkh@linuxfoundation.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jul 04, 2020 at 04:02:47PM +0200, Greg Kroah-Hartman wrote: > + /* only accept a small subset of O_ flags that make sense */ > + if ((flags & (O_NOFOLLOW | O_NOATIME)) != flags) > + return -EINVAL; > + > + /* add some needed flags to be able to open the file properly */ > + flags |= O_RDONLY | O_LARGEFILE; Should we also add O_NOCTTY to prevent any problems if this is called on a tty?