[PATCH v5 14/22] elf: Issue audit la_objopen() for vDSO

Florian Weimer fweimer@redhat.com
Thu Nov 11 17:50:03 GMT 2021


* Adhemerval Zanella:

> +static int
> +handle_restart (void)
> +{
> +  fprintf (stderr, "vdso: %" PRIxPTR "\n", vdso_addr);
> +  return 0;
> +}
> +
> +static unsigned long int
> +parse_address (const char *str)
> +{
> +  char *endptr;
> +  long int ret;
> +  errno = 0;
> +  ret = strtol (str, &endptr, 10);
> +  TEST_COMPARE (errno, 0);
> +  TEST_VERIFY (ret >= 0 && ret <= INT_MAX);
> +  return ret;
> +}

Doesn't parse_address always produce 0 fpr PRIxPTR values because
reading stops at the 'x'?  Maybe use printf and scanf with %p instead?

The rest of the patch looks okay to me.  Placement of the audit call
seems reasonable.

Thanks,
Florian



More information about the Libc-alpha mailing list