From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) by sourceware.org (Postfix) with ESMTPS id 7DEB5385801B for ; Fri, 25 Mar 2022 13:52:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7DEB5385801B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=debian.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f48.google.com with SMTP id l9-20020a05600c4f0900b0038ccd1b8642so2665168wmq.0 for ; Fri, 25 Mar 2022 06:52:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version; bh=g3otoe2SP0jrJuPcI7pLL32T4fNJdCf0XDy0GLZJqUQ=; b=vN+JOaHp8MPLbntSi7DaD2ZsZ3ySC+z+8J9J4QI68f2M/9+MlG5IGXx8vbfitJXUYZ GatjvXE94S/bUFubsoJY3HVniddCecD4FAXX2ZNYzQityHNjDhIxDrZqju+/28Ngki4a Z44tPfgKSIKYEvmbu9Y9gAE1s6V/PK6AEvIckbc2SM6Ne7aGlyym0zz9KSvfSHOmFdEl yjWvkj0c92Fgd0dUjr2FaKlVZYjFDDEeK/cGisk5BInbjaQNnH1pbwwAKdOjHsx2X9KG BJ0sYouYyzMqxuX5QGyrB0YlbTmLDzYIa3YEdyGGDzYvUxNV4IocVEG+t1qSldgNBrPx ETLw== X-Gm-Message-State: AOAM531+2sohoFU2nElDv3RDs/6aOqJMgAzJzOoV6kOUx/mq8O51zjsZ KdGdo6ch4n6649JWYr25ZtaL1t4BQeo= X-Google-Smtp-Source: ABdhPJy/Oh2J1VVIIPrWmiedBKBiQYGnQ257xMcvni+PBBQ/2We3wucxh22i6JD+7+dxud2qT8DhqQ== X-Received: by 2002:a05:600c:3b26:b0:38c:8358:4b84 with SMTP id m38-20020a05600c3b2600b0038c83584b84mr19754974wms.185.1648216338139; Fri, 25 Mar 2022 06:52:18 -0700 (PDT) Received: from localhost ([137.220.125.106]) by smtp.gmail.com with ESMTPSA id o4-20020a5d6484000000b002057ad822d4sm5747089wri.48.2022.03.25.06.52.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 06:52:16 -0700 (PDT) Message-ID: <723cfa8d317969f3ea48947da2cd9c3051cbb937.camel@debian.org> Subject: Re: [PATCH v2] libebl: recognize FDO Packaging Metadata ELF note From: Luca Boccassi To: Mark Wielaard , elfutils-devel@sourceware.org Date: Fri, 25 Mar 2022 13:52:15 +0000 In-Reply-To: <77321d756629343a321f4e011e52d1a1fcdd7302.camel@klomp.org> References: <20211119003127.466778-1-luca.boccassi@gmail.com> <20211121194318.105654-1-luca.boccassi@gmail.com> <40a5de54f089f344697ece88e11eb41e526462ac.camel@gmail.com> <17e1d554c9a52598d2c7d27e7a40f17381285ba5.camel@klomp.org> <20220324231438.350551-1-mark@klomp.org> <3ad724af194ed4b05d539f0807d77ae7955371df.camel@debian.org> <77321d756629343a321f4e011e52d1a1fcdd7302.camel@klomp.org> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-yLbbo0/ifRM5v02sE5v4" User-Agent: Evolution 3.38.3-1+plugin MIME-Version: 1.0 X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00, BODY_8BITS, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Mar 2022 13:52:21 -0000 --=-yLbbo0/ifRM5v02sE5v4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 2022-03-25 at 14:39 +0100, Mark Wielaard wrote: > Hi Luca, >=20 > On Fri, 2022-03-25 at 11:17 +0000, Luca Boccassi wrote: > > On Fri, 2022-03-25 at 00:14 +0100, Mark Wielaard wrote: > > > I took the elf.h update separately. Tweaked your patch a little and > > > added a patch of my own to make elflint recognize the new note > > > type. > > >=20 > > > =C2=A0=C2=A0[PATCH 1/3] libelf: Sync elf.h from glibc. > > > =C2=A0=C2=A0[PATCH 2/3] libebl: recognize FDO Packaging Metadata ELF = note > > > =C2=A0=C2=A0[PATCH 3/3] elflint: Recognize NT_FDO_PACKAGING_METADATA > >=20 > > No problem at all, change looks good, thanks for following up. >=20 > Thanks, I pushed these three patches. > But I noticed an issue on s390x fedora 36. > This isn't just elfutils though, binutils also has trouble: >=20 > Displaying notes found in: .note.package > =C2=A0=C2=A0Owner Data size Description > readelf: /usr/bin/bash: Warning: note with invalid namesz and/or descsz > found at offset 0x0 > readelf: /usr/bin/bash: Warning: type: 0x7e1afeca, namesize: > 0x04000000, descsize: 0x78000000, alignment: 4 >=20 > Note how it seems the sizes are swapped. s390x is a big endian > platform. >=20 > Do you happen to know what/how the notes are created and if that > process might produce bad little/big encoding issues? Agh - I knew big endianess was a bad idea! :-) We have completely overlooked that, the note is created by a linker script, which is generated at build time by this: https://github.com/systemd/package-notes/blob/main/generate-package-notes.s= h#L254 (well an older version in Fedora, but similar enough) I'll flag this, thanks for the report > > I have included the field in the first PoC that uses the spec in > > Debian, for the systemd packages: > >=20 > > $ readelf --notes /usr/lib/systemd/systemd | grep Packaging > > =C2=A0=C2=A0=C2=A0=C2=A0Packaging Metadata: > > {"type":"deb","os":"debian","name":"systemd","architecture":"amd64"," > > version":"250.4-1","debugInfoUrl":"https://debuginfod.debian.net"} >=20 > Nice, thanks. I'll look into how to pick up the debugInfoUrl and use > that automagically if possible. > > BTW. I notice that Fedora has an osCpe field where Debian has an os > field. It would imho be good if one or the other got standardized. Debian has not adopted the CPE spec in its os-release, so there's no way to 'source' the appropriate value. Also bear in mind the Debian version is purely a PoC, opt-in and used only in the systemd package, there's no proposal for distro-wide adoption. I plan to propose that eventually, but it will not be anytime soon, other distros need to adopt it first otherwise chances are it will just be rejected outright, for no particular reason other than "it's a change, we don't like change". --=20 Kind regards, Luca Boccassi --=-yLbbo0/ifRM5v02sE5v4 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEErCSqx93EIPGOymuRKGv37813JB4FAmI9yQ8ACgkQKGv37813 JB6neg//XXfJGMDbTig8VZUtnbvKIXzXCSebjzD+Ure84zzEjXsAO6V3nfkEzHdi ITse/yf4wAnN/dNahERWnVRv4JOnHUOKDX75muagyNrxjSgfuF60n1q2z31ddEsm rSFR/xBEhM4jJnJPzaf2m02uuQ+HHbS9mIYxHTxVf2+t6xCHVQOgwPi9AOYqDmT2 U/SIzue2lrD8qsbl5I/wnIO0nsEhHisTIwEXwgvBFLRpkHxqJOqUqFxzL6e+wFP2 it1VmiZQkmZGrH2WY6KM+PIKUt5jO9fKH1gKEGeSworbE5e305aoX7Br5m/bWpBu 30HmyLrwEdVUXtQeEXhzSIcMOOtaO1UrD8F/yIlsqaqhmRCCK3kTzzpPYHnRqDcD zs5TTJljAfl0JnKIVnohmSRr6ilS6UpYl92vb3TIjv1KA/qt6r4jc2PtdNh3n0t6 Ts9A/KxULICEBFZh3Kmeo9zeVWryk+YYMfaz4d2pl9DDWwm7Vgw6R40aikDzyBx7 xVQSKIPUucXm9XaHlGRy+QcO1+4xxE3UsC9ozjGzUp0LnvMIOZGgA7APvvPkBEs1 0QRObo3/4qyDcSRzkU9/MuxcVlZQVCZI+bra467sj7kYmQbAryWiYFbz5RsMIsQd HTcL5fKKwv9vFORPZcMNbmtcZUM5iAnBDm3+KPw8/lnXhrrzE/w= =cLFu -----END PGP SIGNATURE----- --=-yLbbo0/ifRM5v02sE5v4--