public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Adhemerval Zanella via Libc-alpha <libc-alpha@sourceware.org>
Cc: Paul Pluzhnikov <ppluzhnikov@google.com>,
	 Adhemerval Zanella <adhemerval.zanella@linaro.org>,
	 Alan Zhao <ayzhao@google.com>
Subject: Re: [PATCH] debug: Fix fortified realpath  C++ ODR violation (BZ 30516)
Date: Mon, 03 Jul 2023 18:03:58 +0200	[thread overview]
Message-ID: <877crhx9qp.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <20230703154833.3529850-1-adhemerval.zanella@linaro.org> (Adhemerval Zanella via Libc-alpha's message of "Mon, 3 Jul 2023 12:48:33 -0300")

* Adhemerval Zanella via Libc-alpha:

> @@ -41,10 +35,6 @@ __NTH (realpath (const char *__restrict __name, char *__restrict __resolved))
>    if (sz == (size_t) -1)
>      return __realpath_alias (__name, __resolved);
>  
> -#if defined _LIBC_LIMITS_H_ && defined PATH_MAX
> -  if (__glibc_unsafe_len (PATH_MAX, sizeof (char), sz))
> -    return __realpath_chk_warn (__name, __resolved, sz);
> -#endif
>    return __realpath_chk (__name, __resolved, sz);
>  }

The issue is tje _LIBC_LIMITS_H_ conditional, right?

I suggest we just define PATH_MAX to the correct value in a Linux header
(in a namespace-clean fashion), and add a check of that constant against
the Linux UAPI value.  This constant is ABI anyway, and it's good to
know if the kernel decides to change it underneath us.

Regressing C diagnostics for experimental C++ module support does not
seem the right trade-off, sorry.

Thanks,
Florian


  reply	other threads:[~2023-07-03 16:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-03 15:48 Adhemerval Zanella
2023-07-03 16:03 ` Florian Weimer [this message]
2023-07-03 16:50   ` Adhemerval Zanella Netto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877crhx9qp.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=ayzhao@google.com \
    --cc=libc-alpha@sourceware.org \
    --cc=ppluzhnikov@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).