|
Message-ID: <PH7PR11MB579563403949C4B224DFFECFB3522@PH7PR11MB5795.namprd11.prod.outlook.com> Date: Tue, 5 Nov 2024 06:06:53 +0000 From: "Zhao, Lihua (CN)" <Lihua.Zhao.CN@...driver.com> To: Rich Felker <dalias@...c.org> CC: "musl@...ts.openwall.com" <musl@...ts.openwall.com> Subject: RE: [PATCH v2] mman: correct length check in __shm_mapname 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@...c.org> Sent: Tuesday, November 5, 2024 1:15 PM To: Zhao, Lihua (CN) <Lihua.Zhao.CN@...driver.com> Cc: musl@...ts.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@...driver.com wrote: > From: Lihua Zhao <lihua.zhao.cn@...driver.com> > > account for leading slashes when comparing against NAME_MAX. > > Signed-off-by: Lihua Zhao <lihua.zhao.cn@...driver.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
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.