mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Alexey Izbyshev <izbyshev@ispras.ru>
To: musl@lists.openwall.com
Subject: Re: [musl] realpath without procfs -- should be ready for inclusion
Date: Tue, 24 Nov 2020 12:21:36 +0300	[thread overview]
Message-ID: <a39bc2337c321df9015ef31bc03a868a@ispras.ru> (raw)
In-Reply-To: <20201124063048.GB534@brightrain.aerifal.cx>

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

  reply	other threads:[~2020-11-24  9:21 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-22 22:56 Rich Felker
2020-11-23  2:03 ` Alexey Izbyshev
2020-11-23  3:17   ` Érico Nogueira
2020-11-23  3:34     ` Rich Felker
2020-11-23  3:19   ` Rich Felker
2020-11-23 18:56     ` Rich Felker
2020-11-23 20:53       ` Rich Felker
2020-11-24  3:39         ` Alexey Izbyshev
2020-11-24  4:26           ` Rich Felker
2020-11-24  5:13             ` Alexey Izbyshev
2020-11-24  6:30               ` Rich Felker
2020-11-24  9:21                 ` Alexey Izbyshev [this message]
2020-11-24 14:35                   ` Rich Felker
2020-11-24 20:17                     ` Rich Felker
2020-11-25 15:02                   ` Rich Felker
2020-11-25 19:40                     ` Alexey Izbyshev
2020-11-24 20:31             ` Rich Felker
2020-11-25  5:40               ` Alexey Izbyshev
2020-11-25 15:03                 ` Rich Felker
2020-11-24  3:41     ` Alexey Izbyshev

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=a39bc2337c321df9015ef31bc03a868a@ispras.ru \
    --to=izbyshev@ispras.ru \
    --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).