[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 2/2] tools/symbols: skip names exceeding the runtime limit


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Mykola Kvach <xakep.amatop@xxxxxxxxx>
  • Date: Tue, 1 Dec 2026 22:29:39 +0200
  • Arc-authentication-results: i=1; mx.google.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=rn2oh9LHxhtylT3ZXmZszSlbB2i7cs1oYkwUDecokZU=; fh=JXmkpeuFqxUkLDSfbDrKWwpz31VCSShFQqreBLRAtoY=; b=gEq9s+dmOsB/z1x7vCGSce8iVYMOeGtc22Hs5OQwpZ6vuprMGRnBB0pYWgv0tii2ni OKvlu0+lRome0wLf9QH7vDCwMjkkBU4cXPL8cO3baMtAZx174cAkE7VnK2w1QPi0tDdV tTzb4d+NgfNCPwLMLP5ydvZ0kaKlp9Iq7GMnPCBt3/CeZTvJdPAd8HHBO8uqghnHACqa xV5P9Z59yGq/FkoI3zDj+7XPl2i1zMK0Nwq5JtPgYpsTE226Lg/eopTZ3lgncNrpNex0 xxzWO0HfbJkiZJtVS/r8CKPD9qG8JxCNcsKD6+SpT+K0QBZbbBVGT+jnzv1Jn98tyqX/ jK4w==; darn=lists.xenproject.org
  • Arc-seal: i=1; a=rsa-sha256; t=1796156992; cv=none; d=google.com; s=arc-20260327; b=GjjOoApChUU1GY0KcConmVATW5aah4CZmZlkHO5zrR/kEjuR6Cp41NV/rbX3lEFKPg NbzgtuqISPn/CmWW/EjxmP+5DXOlnm5GPasmfBziL9MAS/6/G6ZWqQJpWj4HEPxoNc7U fUgFyl3xjmLVyNvcDPnddUhS9xvoljySn7/9mWgtzM8SwL9fUBOIwdpYcQ3H5aWqNoUQ JFgfSf62PC0RL11kJoKyN8z7XzNoW71rJsOTwWUEsJXwzz0nluT+c0jVNl+cRtt2KUtt Mx92MVy61P1C0eGvHIMkZeGrtE0cMLsx7w5udcZgghkPvYEZVxFxtuYS5hRDB7EA2MNW xD9g==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=20260707 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version"
  • Cc: Mykola Kvach <Mykola_Kvach@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger@xxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 01 Dec 2026 20:29:59 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Jan,

On Tue, Dec 1, 2026 at 5:41 PM Jan Beulich <jbeulich@xxxxxxxx> wrote:
>
> On 16.11.2026 20:24, Mykola Kvach wrote:
> > The runtime lookup buffers hold KSYM_NAME_LEN bytes (128), but the
> > generator accepts longer names. SYSV input prefixes local symbols
> > with their filename, so an absolute assembly source path can make a
> > name too long even when the symbol itself is short.
> >
> > On an Orange Pi 5 debug build this crashed Xen at boot: during the
> > test_symbols() constructor, symbols_lookup_by_name() expanded the
> > 145-byte name ending in mmu/head.S#identity_mapping_removed into a
> > 128-byte buffer, overwriting the saved frame pointer and return address.
> >
> > Report and skip names of KSYM_NAME_LEN bytes or more, as Linux does.
> > Check the complete name in read_symbol(), after adding the filename
> > prefix. Keep --xensyms maps complete: they are not loaded into Xen.
> >
> > Fixes: d37d63d4b548 ("symbols: prefix static symbols with their source file 
> > names")
> > Assisted-by: Codex:GPT-6.1
> > Signed-off-by: Mykola Kvach <mykola_kvach@xxxxxxxx>
>
> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
> with ...
>
> > --- a/xen/tools/symbols.c
> > +++ b/xen/tools/symbols.c
> > @@ -178,6 +178,14 @@ static int read_symbol(FILE *in, struct sym_entry *s)
> >               *sym++ = '#';
> >       }
> >       strcpy(sym, str);
> > +     /* Only the table loaded into Xen is limited, not --xensyms maps. */
> > +     if (!map_only && s->len - 1 >= KSYM_NAME_LEN) {
> > +             fprintf(stderr,
> > +                     "Ignoring symbol '%s': too long (%u bytes, maximum 
> > %u)\n",
> > +                     SYMBOL_NAME(s), s->len - 1, KSYM_NAME_LEN - 1);
> > +             free(s->sym);
> > +             goto skip_tail;
> > +     }
> >       if (sort_by_name || map_only)
> >               s->orig_symbol = strdup(SYMBOL_NAME(s));
> >       s->type = stype; /* As s->sym[0] may end up mangled. */
>
> ... blank lines added before and after the code you add. Happy to do so
> while committing.

Thanks for the review. Sounds good to me.

Best regards,
Mykola



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.