On 25/09/2024 9:42 am, Roger Pau Monne wrote: > diff --git a/xen/common/livepatch.c b/xen/common/livepatch.c > index 87b3db03e26d..8e61083f23a7 100644 > --- a/xen/common/livepatch.c > +++ b/xen/common/livepatch.c > @@ -470,6 +470,31 @@ static int xen_build_id_dep(const struct payload > *payload) > return 0; > } > > +/* Parses build-id sections into the given destination. */ > +static int parse_buildid(const struct livepatch_elf_sec *sec, > + struct livepatch_build_id *id) > +{ > + const Elf_Note *n; > + int rc; > + > + /* Presence of the sections is ensured by check_special_sections(). */ > + ASSERT(sec); > + > + n = sec->load_addr; > + > + if ( sec->sec->sh_size <= sizeof(*n) ) > + return -EINVAL; > + > + rc = xen_build_id_check(n, sec->sec->sh_size, &id->p, &id->len);
I've just realised what is so confusing. This function is not a Xen buildid check, it's an ELF buildid note check. I'll do a followup patch after yours goes in renaming it. Reviewed-by: Andrew Cooper <andrew.coop...@citrix.com>