From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 6447 invoked from network); 24 Nov 2020 09:21:54 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 24 Nov 2020 09:21:54 -0000 Received: (qmail 23746 invoked by uid 550); 24 Nov 2020 09:21:48 -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 Received: (qmail 23727 invoked from network); 24 Nov 2020 09:21:47 -0000 MIME-Version: 1.0 Date: Tue, 24 Nov 2020 12:21:36 +0300 From: Alexey Izbyshev To: musl@lists.openwall.com In-Reply-To: <20201124063048.GB534@brightrain.aerifal.cx> References: <20201122225619.GR534@brightrain.aerifal.cx> <97dd3cf7c69673e5962e9ccd46ea5131@ispras.ru> <20201123031932.GS534@brightrain.aerifal.cx> <20201123185633.GY534@brightrain.aerifal.cx> <20201123205259.GZ534@brightrain.aerifal.cx> <48faf5ab9a1f3c869c85897217db0d75@ispras.ru> <20201124042646.GA534@brightrain.aerifal.cx> <20201124063048.GB534@brightrain.aerifal.cx> User-Agent: Roundcube Webmail/1.4.4 Message-ID: X-Sender: izbyshev@ispras.ru Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [musl] realpath without procfs -- should be ready for inclusion On 2020-11-24 09:30, Rich Felker wrote: > I think before this goes upstream we should have a good set of > testcases that can be contributed to libc-test. Do you have ideas for > coverage? Some that come to mind: > Added some more ideas. > - Absolute argument starting with /, //, and /// - Absolute argument equal to one of /, //, and /// > - Absolute symlink target starting with /, //, and /// - Absolute symlink target equal to one of /, //, and ///, with the link separated from the following component with /, // > - Final / after symlink-to-dir, dir, symlink-to-nondir, nondir - Intermediate / after symlink-to-nondir, nondir > - Final / in link contents after [the above] - Multiple / after ., .., normal component > - Initial .. in argument, cwd root or non-root > - Initial .. in symlink target, symlink in root or non-root > - Initial ... > - .. following symlink-to-dir, dir, symlink-to-nondir, nondir - . following symlink-to-dir, dir, symlink-to-nondir, nondir > - More .. than path depth > - Null argument > - Empty string argument - Argument consisting of a single ., .. > - Empty string link contents (testable only with seccomp hack) > - Argument valid abs path exact length PATH_MAX-1 > - Argument valid rel path exact length PATH_MAX-1 to short abs path - Argument with PATH_MAX length (ENAMETOOLONG) - A relative symlink in the argument such that the length of the result is PATH_MAX-1 (valid path), PATH_MAX (ENAMETOOLONG) - An absolute symlink in the argument similar to the above - A relative argument with the current directory similar to the above - An argument consisting of a single (relative, absolute) symlink with the target having length PATH_MAX-1 - An argument ending with a relative symlink with the target having length PATH_MAX-1 (ENAMETOOLONG) - An argument ending with an absolute symlink with the target having length PATH_MAX-1 (valid path) Hm, the last one doesn't work now. Since p is the position of NUL instead of the size of stack, "if (k==p) goto toolong;" forbids symlinks with the length of the target == PATH_MAX-1. > > Some of these require namespace gymnastics to set up without running > the tests as root. > Alexey