Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 24 Feb 2023 20:17:31 +0600
From: NRK <>
To: Rich Felker <>
Cc:, Tamir Duberstein <>
Subject: Re: undefined behavior in fread.c

On Fri, Feb 24, 2023 at 09:07:41AM -0500, Rich Felker wrote:
> stdio functions are required (by POSIX) to behave as if they take a
> mutex on the FILE. If fread with a length of zero makes forward
> progress when another thread holds the lock, this is non-conforming.

OK, I see. Wasn't aware of that.

On a sidenote, if I'm reading the right function (libio/iofread.c) then
glibc is taking the lock _after_ they do the size check.

	  if (bytes_requested == 0)
	    return 0;
	  _IO_acquire_lock (fp);
	/* ... */


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.