From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-4.1 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 740AE20248 for ; Wed, 13 Mar 2019 15:46:33 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id:references :mime-version:content-type:in-reply-to; q=dns; s=default; b=uoIR JdrKc9DsxmD5NhJ8/dbD8LmQ+NBuCVzQuLwOiN2G30IxjyiT7oQKNdllhbhSQlss GzbUr9vxoB3QkwQN+1P2V3IVmd/uuDHLr6ePvl7o+72jCq51Y/y1m9tn4asnwEj8 YgE+IvzeikTWGRStazJ17RBUcuqkQfcTkPOGVrc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id:references :mime-version:content-type:in-reply-to; s=default; bh=q2erIEQBjq +eEHJmbqpvv7fYfaY=; b=xNTukyQ+U9ttznxxM+abJVDsSs2dEKp+YnB3k4LKXS KzYbLmZPxuy9x2HcZC8VmyziQsvHzdCIc/LnDtMnYKpNZ1WO8dDOPax78eaUlV0x tY+jojSrTh8YUM3Miu7/OJie7AQXzex5DrmWQkLCrcxDNAAHgbdEW2FkT19J1ORn 0= Received: (qmail 48889 invoked by alias); 13 Mar 2019 15:46:30 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 48835 invoked by uid 89); 13 Mar 2019 15:46:25 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: vmicros1.altlinux.org Date: Wed, 13 Mar 2019 18:46:20 +0300 From: "Dmitry V. Levin" To: Florian Weimer Cc: libc-alpha@sourceware.org Subject: Re: [PATCH v3] libio: do not unbuffer legacy standard files in compatibility mode [BZ #24228] Message-ID: <20190313154619.GA5829@altlinux.org> References: <20190218124438.GB20127@altlinux.org> <87mumtcl0w.fsf@oldenburg2.str.redhat.com> <20190218191021.GA25527@altlinux.org> <20190219005741.GA29070@altlinux.org> <20190219012913.GB29070@altlinux.org> <8736nqerrz.fsf@oldenburg2.str.redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="liOOAslEiF7prFVr" Content-Disposition: inline In-Reply-To: <8736nqerrz.fsf@oldenburg2.str.redhat.com> --liOOAslEiF7prFVr Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 13, 2019 at 04:08:16PM +0100, Florian Weimer wrote: > * Dmitry V. Levin: >=20 > > Commit glibc-2.23~693 (a601b74d31ca086de38441d316a3dee24c866305) >=20 > Please quote the commit hash and commit subject, kernel-style. The kernel-style reference would look this way: Commit a601b74d31ca ("In preparation for fixing BZ#16734, fix failure in misc/tst-error1-mem when _G_HAVE_MMAP is turned off.") I'd like to add a reference to glibc-2.23~693 somewhere because I find it useful, but I don't see any suitable place for it in this long kernel-style form. > (How did you determine this reference, anyway?) Sorry? > > diff --git a/libio/genops.c b/libio/genops.c > > index 2a0d9b81df..aa92d61b6b 100644 > > --- a/libio/genops.c > > +++ b/libio/genops.c > > @@ -789,6 +789,10 @@ _IO_unbuffer_all (void) > > =20 > > for (fp =3D (FILE *) _IO_list_all; fp; fp =3D fp->_chain) > > { > > +#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1) > > + if (__glibc_unlikely (&_IO_stdin_used =3D=3D NULL) && _IO_legacy= _file (fp)) > > + continue; > > +#endif >=20 > I wonder if we should check _IO_legacy_file only here. This is related > to the previous discussion. If we omitted the check for _IO_stdin_used, then standard files would be skipped and misc/tst-error1-mem would complain. > > diff --git a/libio/tst-bz24228.c b/libio/tst-bz24228.c > > new file mode 100644 > > index 0000000000..3692f14b71 > > --- /dev/null > > +++ b/libio/tst-bz24228.c > > @@ -0,0 +1,30 @@ > > +/* BZ #24228 check for memory corruption in legacy libio > > + > > + Copyright (C) 2019 Free Software Foundation, Inc. > > + This file is part of the GNU C Library. >=20 > We do not generally have a blank line for the =E2=80=9CCopyright=E2=80=9D= line, I think. No problem, I can remove it. I don't think we are quite consistent about it, though. > > +#include > > +#include > > + > > +static int > > +do_test (void) > > +{ > > + mtrace (); > > + return 0; > > +} > > + > > +#include > > diff --git a/libio/tst-bz24228.map b/libio/tst-bz24228.map > > new file mode 100644 > > index 0000000000..ecb8c058f5 > > --- /dev/null > > +++ b/libio/tst-bz24228.map > > @@ -0,0 +1,3 @@ > > +{ > > + local: _IO_stdin_used; > > +}; >=20 > Please add a comment to the file why you are doing this, something like > =E2=80=9Chide the symbol from libc.so.6 to switch to the libio/oldfileops= =2Ec > implementation (if it is available for the architecture)=E2=80=9D. Indeed, thanks for the suggestion. --=20 ldv --liOOAslEiF7prFVr Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJciSXLAAoJEAVFT+BVnCUIwRUP/RR85gW5NL2MbpZeT7ATUHsK UeDO2NR+wf5foaqsIozyOrvwy0Eb7gKY7ahUGd8xH7lsu46d0QbJkaIoSXPfWzeQ 2UYkNFd2JF6bl5EU2NOaTfisgjdsS5MB9C20rB59aiiOH1E+KuGfPHBqWNl0YXkt ttUTZc2/UZdh1v+0Z0k9dafv9SH51k2uOptDBYv8ehEdBqNTfkkVxfB0fQkz1xh2 UXUSCvawXyenCDqo65Jd8yfavvthCYfChDBYtjp5nGSFL8afMcpfcN3Bq4/iVVxO Vs92p/Pm2BQ7Ww8U4+VKVFgOk6eHFv5JnOvYQcYsRIsK8ZFlwDtBPFMudoLx8+o9 IgIgcwDvKElOC5NJqYIY/d6bKxG2WAI+OCN3TZgbgPT6M9zm+8BRF29LwW+Wpp1O ZolrDMtocuaIA8K0NDQUi2vsTWu2Q37v6O6AZ021VyWm+OC9K/llAgAMGPN82xTf hd3G1sDRty/EkAIdw1IB+WnjdYhgru61OYoTgLJ9LaDmPLZ6QrxBsJXU++AoV2EP 40AgSzds0NFHij2kY9ytGmMoFSmDBPSbSfk40I9vVPnXsf5BeLmzuNy06dXJrqDd WM909D16+gqo7j1KViNe5GYKkhEMLOKsoVETi8aLnfYp8EzteNsZ1p6Mv0S8oGWf ZbSQo/0ZlLpGODfuA9bC =yQ9v -----END PGP SIGNATURE----- --liOOAslEiF7prFVr--