From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: from second.openwall.net (second.openwall.net [193.110.157.125]) by inbox.vuxu.org (Postfix) with SMTP id 089922258A for ; Tue, 5 Nov 2024 07:12:07 +0100 (CET) Received: (qmail 26279 invoked by uid 550); 5 Nov 2024 06:12:04 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com x-ms-reactions: disallow Received: (qmail 20308 invoked from network); 5 Nov 2024 06:07:11 -0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZTtSPBNSbagMMbMkQseOXxwV+jbZODKZ7Wm/cYhfsE2Pol49vwRRm8lldUmBxwKi5dY5kYhjwrroL2FIAIaZeogtIqbdazt4X+MgQAefNhT87g92GiEMlIM4694JPOQjoTi8KgZNRdMKcfhTa6CZ+UZPf7nMLeOP4E2fZIskXSne2RESLJcGWc+a4+pcgPXiOQOaJmV3VEiAt27XzEk65Ow+1AUeMMvTUkU17huMMr1sput0iqtnQ5EI9ujC/+QejPgZcnsfvkJ8heLsofhC2to1bqRhq9S14a2k2WfS1Gct+8jT+O56lrVAUJERkF9eafg6jWL3KhgrX5qivo0JQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+BH7k6JlgQrVBg5FnYCtn6P7tPXs0cCKS14FScJXFJI=; b=ImSjDbdDl7wsvhezSJBADiMID6bBQr9RpQ/6qvvOeg1pbMHzJeNQZJWvskPPWABf1G9kckY1aRL+t0s3/9ca+ruUOQH0zD/y7goVZr3B4HwOJgDSUWPpo9UMO+cBSlD1RacUC/nGvk4ol+AYS337cD7nV5CDn/8QmNTuu7gOHf+gAgRgJdIRsW7HkhqnR4+DmCOIl2EZ1bp47v7l3UjvmzD85SrAygt+xk7rfrNlY8jcS2yOQ8Gnl9w+7lMATqNCEKXIHn8Xuy54rqCNGqg+OWJ3oy7SbaSMroIS9aqKeFNL8dYZgFCM+Rs3uFUrQqzp+Fep7f9iBr8dm7gS6y8erw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=windriver.com; dmarc=pass action=none header.from=windriver.com; dkim=pass header.d=windriver.com; arc=none From: "Zhao, Lihua (CN)" To: Rich Felker CC: "musl@lists.openwall.com" Thread-Topic: [musl] [PATCH v2] mman: correct length check in __shm_mapname Thread-Index: AQHbLz8WwWl/tzajH0q5xYx+0qNoVbKoJNqAgAAOE2A= Date: Tue, 5 Nov 2024 06:06:53 +0000 Message-ID: References: <20241105030058.GF10433@brightrain.aerifal.cx> <20241105045628.1542264-1-lihua.zhao.cn@windriver.com> <20241105051505.GG10433@brightrain.aerifal.cx> In-Reply-To: <20241105051505.GG10433@brightrain.aerifal.cx> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PH7PR11MB5795:EE_|SA1PR11MB6565:EE_ x-ms-office365-filtering-correlation-id: 496570a2-f039-4b26-81b0-08dcfd600b9a x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|366016|376014|1800799024|38070700018; x-microsoft-antispam-message-info: =?us-ascii?Q?rPOZvE7y2dUBLq8wB/qeXYYovi3s6edT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q?jui3L2mVmMeBxUCIpP0tOCM7mXGAuprAyeGUEK9ZKSZ6jT71L18lnOIeqWJq?= =?us-ascii?Q?ZkqqdHo7MTuSjrhOMejOSKhq2cVSw7/bT68i6BlwBCPHkMApaU3+S4jAFF0X?= =?us-ascii?Q?GM63SuUccIOVdGM7orTO2ZyvyGOAF9yid1ISgzgd3SPr8x/M+O8y4Sb0MY3X?= =?us-ascii?Q?djA0Da49mRptPOXHivsRt3ZYYz40OeYOhZV7UYrr6SIwnrEW3nWDefEVWS70?= =?us-ascii?Q?AN5SsTYcwwectVAZNxMgG7yP/R5gRj4mSN9VM8r0zO2koMMB4i46Q59/IG9f?= =?us-ascii?Q?p4Mzy7gt7+vDUJP0HGZhy5QV8irJSraJcNVUdjjOIZnVNITBKiIgnslxy6JH?= =?us-ascii?Q?x7q6c4nYDOvb9n0X/QN6NGFwJ6hrKjE+6N+jJWnrfqQ0y7uwPiXCqzYQ3Gbp?= =?us-ascii?Q?67lsG5FFgnh3hSrFtltUcFSjYf6Xm++PJvCN80m+W+ILUfeZFtrDaM4RNhad?= =?us-ascii?Q?VPhOEIsg8paVlFh31rWq/23a4AX1?= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH7PR11MB5795.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(1800799024)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?2/ByvZ5J+OGWOc/XuFcMHytrKzFWuU5LfPtm060D0w+P/cpGgDfpx8P8rmge?= =?us-ascii?Q?slBL3+Uv153MPSezcGOevrVRRmQidx813IpB4tomP8MqDIhqSRhy2TxtxNwJ?= =?us-ascii?Q?c19Tm0luYulREcjmkbrYG5hvhf1Bc6OAIX3+39urqfuc7ldRAN8CdG/a4O3i?= =?us-ascii?Q?k8ZyDH9bs2WDJUclREH3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q?aMiVzTtTJRV7k/tkr5yjVnpAldZfD9/T0MlHLt5CbRk0Y5thfwPBKeyXfFuW?= =?us-ascii?Q?SC/dHieeveDwbmILPy9mzaOHt5KgvgD3jzgKBMjLA1gQLG+i1RnDf8uI21WH?= =?us-ascii?Q?/1U95E4DVFRx6Ma5ngJrD1Bwoye8hgDrg4UHVqDw9G/o1nNMsyQL/48kFNnu?= =?us-ascii?Q?X0VFIOXALqw/EFAKGIQFQHUJYe/AdxrrEcVgpqNs/utiICpseCBWVzhZ0q4Q?= =?us-ascii?Q?y5ZVDqJ4Z9bqJev7z6D/VKvZ5gxf/IOw/S/gDGoPSHTxgVs2fsia0nXhv68Y?= =?us-ascii?Q?IG+7mjpJc5Q18kYetMV4R3Epz+6KdJa4Gb86n2GjWizIUjOREYCqdZvNe3SO?= =?us-ascii?Q?fjR2meWyXE1Jtal6FUirT7vqLjT8vCl6xhX2jhp212IZRDiEexn/FHNY2ntE?= =?us-ascii?Q?turaoLWe3mb0x0Vy0JfR/aEGFphqx9icY5vfC84MaqPfPUPbRp3YGgwO+VAe?= =?us-ascii?Q?xArqVo8gSWdzEpSGb2V/03TVK8CzAJnQxK18oVrc?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH7PR11MB5795.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 496570a2-f039-4b26-81b0-08dcfd600b9a X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Nov 2024 06:06:53.2832 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 8ddb2873-a1ad-4a18-ae4e-4644631433be X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: cYY9i9RxEdavdx9WpG/OGMVUc48aGAtR4gVt4lknT5ets8tt7ucm0YnBJ7m312Q8OQufBj1AkAqBlFKInFez0u7+2K7ZXB5vswbFp2AH/08= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR11MB6565 X-Authority-Analysis: v=2.4 cv=H7mJwPYi c=1 sm=1 tr=0 ts=6729b601 cx=c_pps a=TJva2t+EO/r6NhP7QVz7tA==:117 a=Ol13hO9ccFRV9qXi2t6ftBPywas=:19 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=VlfZXiiP6vEA:10 a=bRTqI5nwn0kA:10 a=hAG5_4vcAAAA:8 a=t7CeM3EgAAAA:8 a=XkRKQH6RAAAA:8 a=uZvujYp8AAAA:8 a=wvPkM9v7g1_ikmSEda4A:9 a=CjuIK1q_8ugA:10 a=8Bh8Pg2EFav9IBZ9i9Tn:22 a=FdTzh2GWekK77mhwV6Dw:22 a=1gUyE30hU_ULiMxJiLUW:22 a=SLzB8X_8jTLwj6mN0q5r:22 X-Proofpoint-ORIG-GUID: kdHK21z8Oq7hAK3UDiF5KoFntYtY9Do0 X-Proofpoint-GUID: kdHK21z8Oq7hAK3UDiF5KoFntYtY9Do0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-11-05_01,2024-11-04_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 clxscore=1015 priorityscore=1501 lowpriorityscore=0 impostorscore=0 suspectscore=0 bulkscore=0 mlxlogscore=792 malwarescore=0 adultscore=0 mlxscore=0 phishscore=0 classifier=spam authscore=0 adjust=0 reason=mlx scancount=1 engine=8.21.0-2409260000 definitions=main-2411050043 Subject: RE: [musl] [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 =20 Sent: Tuesday, November 5, 2024 1:15 PM To: Zhao, Lihua (CN) 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 > > account for leading slashes when comparing against NAME_MAX. > > Signed-off-by: Lihua Zhao > --- 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 character in name is implementation-defined, and that=20 > the length limits for the name argument are implementation-defined and=20 > need not be the same as the pathname limits {PATH_MAX} and {NAME_MAX}. > > Although it is implementation-defined, glibc obviously calculates the lea= d slash. Leading slash is not implementation-defined. The text you quoted says the o= pposite if you didn't cut off the earlier part of the sentence: "...except that the interpretation of 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 nam= e, is what's implementation-defined. Indeed the limits need not match NAME_MAX, but since we implement named sha= red memory objects as filesystem objects, the implementation choice we make= is to have the limit match. Rich