From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/12309 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: a third bug in musl clone() Date: Tue, 2 Jan 2018 21:51:30 -0500 Message-ID: <20180103025130.GO1627@brightrain.aerifal.cx> References: <20171223094545.rmx6xtmucyz5xzap@voyager> <72c68934-4445-c83d-7bbc-004953b2f9e9@bitwagon.com> <20171231154926.GG1627@brightrain.aerifal.cx> <20180101195224.tpkl5g5w66rzwzz3@voyager> <5caf910a-dd98-6836-c70f-6a98cf8a9d22@bitwagon.com> <20180102014915.GJ1627@brightrain.aerifal.cx> <3d795d15-4808-6120-e497-d6c367c14952@bitwagon.com> <20180102195825.GN1627@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1514947793 31587 195.159.176.226 (3 Jan 2018 02:49:53 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 3 Jan 2018 02:49:53 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-12325-gllmg-musl=m.gmane.org@lists.openwall.com Wed Jan 03 03:49:48 2018 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1eWZ7e-0007W2-Oy for gllmg-musl@m.gmane.org; Wed, 03 Jan 2018 03:49:42 +0100 Original-Received: (qmail 7731 invoked by uid 550); 3 Jan 2018 02:51:43 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 7710 invoked from network); 3 Jan 2018 02:51:43 -0000 Content-Disposition: inline In-Reply-To: Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:12309 Archived-At: On Tue, Jan 02, 2018 at 11:09:24PM +0100, Florian Weimer wrote: > On 01/02/2018 08:58 PM, Rich Felker wrote: > >In any case it should be fixed by checking flags. > > I think this would be worse than the cure because it results in > subtle bugs if the kernel adds more flags which require different > argument counts. We saw that with O_TMPFILE and open/openat. Wasn't that just a bug with O_TMPFILE having implicit O_CREAT but not having the actual O_CREAT bit set in its value? I understand the sentiment here but I think if we're really worried about that we could just fail with EINVAL for unknown flags (requiring a sufficiently new libc.so to be aware of the flags) rather than leaving the UB in place. Rich