From: Wilco Dijkstra Date: Fri, 10 Jun 2022 12:33:26 +0000 (+0100) Subject: libio: Avoid RMW of flags2 outside lock (BZ #27842) X-Git-Tag: glibc-2.36~158 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f107b7b30d815f191181617e2c14f21e6af4ddcf;p=thirdparty%2Fglibc.git libio: Avoid RMW of flags2 outside lock (BZ #27842) Remove an unconditional RMW on flags2 in flockfile - we don't need to change _IO_FLAGS2_NEED_LOCK since it isn't used in flockfile or funlockfile. This fixes BZ #27842. Reviewed-by: Adhemerval Zanella --- diff --git a/stdio-common/flockfile.c b/stdio-common/flockfile.c index a5decb450f8..49f72c69ab7 100644 --- a/stdio-common/flockfile.c +++ b/stdio-common/flockfile.c @@ -22,7 +22,6 @@ void __flockfile (FILE *stream) { - stream->_flags2 |= _IO_FLAGS2_NEED_LOCK; _IO_lock_lock (*stream->_lock); } weak_alias (__flockfile, flockfile);