From: "Zhao, Lihua (CN)" <Lihua.Zhao.CN@windriver.com>
To: Rich Felker <dalias@libc.org>
Cc: "musl@lists.openwall.com" <musl@lists.openwall.com>
Subject: RE: [musl] [PATCH v2] mman: correct length check in __shm_mapname
Date: Tue, 5 Nov 2024 06:06:53 +0000 [thread overview]
Message-ID: <PH7PR11MB579563403949C4B224DFFECFB3522@PH7PR11MB5795.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20241105051505.GG10433@brightrain.aerifal.cx>
Thank you for your support and respect your decision. Anyway, this is just a boundary management and is usually not used, so it is OK not to change it.
Lihua
-----Original Message-----
From: Rich Felker <dalias@libc.org>
Sent: Tuesday, November 5, 2024 1:15 PM
To: Zhao, Lihua (CN) <Lihua.Zhao.CN@windriver.com>
Cc: musl@lists.openwall.com
Subject: Re: [musl] [PATCH v2] mman: correct length check in __shm_mapname
CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know the content is safe.
On Tue, Nov 05, 2024 at 12:56:28PM +0800, lihua.zhao.cn@windriver.com wrote:
> From: Lihua Zhao <lihua.zhao.cn@windriver.com>
>
> account for leading slashes when comparing against NAME_MAX.
>
> Signed-off-by: Lihua Zhao <lihua.zhao.cn@windriver.com>
> ---
I'm still not clear what you're trying to achieve here. If the bug is "it's different from glibc", that is not a bug.
> According to https://pubs.opengroup.org/onlinepubs/9799919799/:
>
> leading <slash> character in name is implementation-defined, and that
> the length limits for the name argument are implementation-defined and
> need not be the same as the pathname limits {PATH_MAX} and {NAME_MAX}.
>
> Although it is implementation-defined, glibc obviously calculates the lead slash.
Leading slash is not implementation-defined. The text you quoted says the opposite if you didn't cut off the earlier part of the sentence:
"...except that the interpretation of <slash> characters other than the"
A leading slash is necessary to portably open shared memory by a name in a shared global namespace. Omitting it, or using slashes elsewhere in the name, is what's implementation-defined.
Indeed the limits need not match NAME_MAX, but since we implement named shared memory objects as filesystem objects, the implementation choice we make is to have the limit match.
Rich
prev parent reply other threads:[~2024-11-05 6:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-05 1:06 [musl] [PATCH] " lihua.zhao.cn
2024-11-05 1:46 ` Rich Felker
2024-11-05 2:03 ` Zhao, Lihua (CN)
2024-11-05 3:00 ` Rich Felker
2024-11-05 4:56 ` [musl] [PATCH v2] " lihua.zhao.cn
2024-11-05 5:15 ` Rich Felker
2024-11-05 6:06 ` Zhao, Lihua (CN) [this message]
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=PH7PR11MB579563403949C4B224DFFECFB3522@PH7PR11MB5795.namprd11.prod.outlook.com \
--to=lihua.zhao.cn@windriver.com \
--cc=dalias@libc.org \
--cc=musl@lists.openwall.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.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
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 NNTP newsgroup(s).