From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1380 invoked by alias); 19 Jul 2019 22:57:32 -0000 Mailing-List: contact elfutils-devel-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: elfutils-devel-owner@sourceware.org Received: (qmail 1369 invoked by uid 89); 19 Jul 2019 22:57:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.3 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-7.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy= X-Spam-Status: No, score=-7.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on sourceware.org X-Spam-Level: X-HELO: vmicros1.altlinux.org Received: from vmicros1.altlinux.org (HELO vmicros1.altlinux.org) (194.107.17.57) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 19 Jul 2019 22:57:29 +0000 Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id CA9BF72CA65; Sat, 20 Jul 2019 01:57:27 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id BD1F07CC774; Sat, 20 Jul 2019 01:57:27 +0300 (MSK) Date: Fri, 19 Jul 2019 22:57:00 -0000 From: "Dmitry V. Levin" To: Mark Wielaard Cc: Florian Weimer , elfutils-devel@sourceware.org, Panu Matilainen Subject: Re: [PATCH] elfclassify tool Message-ID: <20190719225727.GA31985@altlinux.org> References: <2e6a27c552ae5e365db54ca6b432c77c9ad5b041.camel@klomp.org> <871s22yybt.fsf@oldenburg2.str.redhat.com> <8736mfzhob.fsf@oldenburg2.str.redhat.com> <20190719134341.GA26346@altlinux.org> <84da918d32c57e6f16fbcf1c854b375111dbdcb5.camel@wildebeest.org> <20190719183542.GB29323@altlinux.org> <87v9vxivsu.fsf@oldenburg2.str.redhat.com> <20190719212308.GA31813@altlinux.org> <20190719213653.GA2851@wildebeest.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="W/nzBZO5zC0uMSeA" Content-Disposition: inline In-Reply-To: <20190719213653.GA2851@wildebeest.org> X-IsSubscribed: yes X-SW-Source: 2019-q3/txt/msg00070.txt.bz2 --W/nzBZO5zC0uMSeA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1568 On Fri, Jul 19, 2019 at 11:36:53PM +0200, Mark Wielaard wrote: > On Sat, Jul 20, 2019 at 12:23:08AM +0300, Dmitry V. Levin wrote: > > On Fri, Jul 19, 2019 at 11:00:49PM +0200, Florian Weimer wrote: > > > * Dmitry V. Levin: > > >=20 > > > >> So, I don't think the code is wrong. We might want to tweak the co= mment > > > >> a bit though, to make it less definitive? > > > > > > > > What I'm saying is that has_soname is just a hint which is probably= even > > > > less reliable than has_program_interpreter. > > >=20 > > > If I recall correctly, I added the soname check to classify > > > /lib64/libc.so.6 as a library, not an executable. So it didn't come > > > completely out of nowhere. > >=20 > > Well, /lib64/libc.so.6 is not just a library, it's also a valid executa= ble. > >=20 > > If the ELF type is ET_DYN and the object is not marked as DF_1_PIE, > > could we come up with a more reliable heuristics than DT_SONAME and PT_= INTERP? >=20 > Why do you feel it is unreliable? Do you have any examples of files > misidentified? No, I don't have such examples because most (if not all) ET_DYN non-DF_1_PIE objects we have nowadays are actually libraries regardless of their DT_SONAME or PT_INTERP. What actually disqualifies these objects from being libraries, besides missing PT_DYNAMIC? The only reason why I feel uncomfortable to rely on this has_soname check is that DT_SONAME is so easily added unnoticed by mistake. btw, I think it would be appropriate to move the has_dynamic check before the first check in is_shared that returns true. --=20 ldv --W/nzBZO5zC0uMSeA Content-Type: application/pgp-signature; name="signature.asc" Content-length: 801 -----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJdMkrXAAoJEAVFT+BVnCUIVLwQANE87VkBqdaAI8Jd4QTX6jJH pqfItwNJ8vHxGyYMkW9VhVz8n8X8i6a0YPQDKmLd85hq3HM0moEvvTTJtog74oCL MKXyRXDtU9/MHSszVDKEg3bxVdhGYZwIJTsRdSg5NQwsp3U44U/Tfka7cWI/1PM+ GxdJKf56Hg31jtEplzsJL1owDqi3OZW1hB6FHDWLvvvrfzZnoGVGFYEl7jE9sWYb UzbsYpxomFhdV6oV+HV04rkW4wbtzR1SuNcehgwM8Zy3CfR6RAbkyApQbOejYbiP nkkKmyg/aApIuZ+VZMURZRQgMD8QQu31v8JLPdNvGXSHqXeSTu/0BMvPVtnwUbf+ pzo8CxzK3XROf25kEdcjpR/iuqfmyBKHwwd/aTEgDJi8l3ZxUtW4RAlyW9wwiwS+ B2g94ZDR1A2dsN6t0ZhXWyWXs9lXWl4ROEZ39YnxWBQjpyKD6log+nS6JmPsoc29 kEeFRb5yf4BK12NxQLFR1GiWeC9UAhPQcmtyDo3Gwk+mpDgNTX7aEa9ijstfsKyG yctdEQ3EI2YCfUc3ddu5NSps8Z9VdUpy/TQQFm6BrFLJ454xFD8eP8vV1TbT3M18 XxDqfOzxixcOjwSWlykFNhgUPzb0D72GEFBXfSFyamVBQG7zAj39Mc02VgIWl2A6 5ZA8IAj9X8vottIjez1h =7WKn -----END PGP SIGNATURE----- --W/nzBZO5zC0uMSeA--