Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Seebs <seebs@seebs.net>
To: Jason Wessel <jason.wessel@windriver.com>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH v2] pseudo: Upgrade to latest to fix openat() with a directory symlink [NAK]
Date: Fri, 2 Aug 2019 12:07:33 -0500	[thread overview]
Message-ID: <20190802120733.4a24ca3f@seebsdell> (raw)
In-Reply-To: <f991e41b-39c6-a088-63aa-07553cae131b@windriver.com>

On Fri, 2 Aug 2019 11:27:45 -0500
Jason Wessel <jason.wessel@windriver.com> wrote:

> The sequence of openat() followed by an fstat() on the opened file
> handle, will erase the pseudo uid entry for the symlink, as shown by
> the following lstat() in test 5. The culprit appears to be the
> fstat(), but it could be something much more complex than that...
> The next step is to figure out why the recent change to openat() to
> address test case 1, caused this new problem.

I suspect I know that one, although I'm not sure I know the details.

Pseudo will destroy entries of incompatible directory-entry types; for
instance, if it has the same path listed as both a plain file and a
directory. But consider, from openat.c:

#ifdef PSEUDO_NO_REAL_AT_FUNCTIONS
                rc = real___xstat64(_STAT_VER, path, &buf);
#else           
                rc = real___fxstatat64(_STAT_VER, dirfd, path, &buf, 0);
#endif

Note that there's no lstat, and no AT_SYMLINK_NOFOLLOW. Which is to say,
these stats will be following the symlink even though O_NOFOLLOW was
set. I can probably patch this in a bit.

-s


  reply	other threads:[~2019-08-02 17:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-01 20:03 [PATCH v2] pseudo: Upgrade to latest to fix openat() with a directory symlink Jason Wessel
2019-08-01 21:37 ` [PATCH v2] pseudo: Upgrade to latest to fix openat() with a directory symlink [NAK] Jason Wessel
2019-08-01 23:57   ` Seebs
2019-08-02 16:27     ` Jason Wessel
2019-08-02 17:07       ` Seebs [this message]
2019-08-02 17:42         ` Seebs
2019-08-03 12:33           ` Khem Raj
2019-08-03 14:23             ` Seebs
2019-08-03 14:57               ` Khem Raj
2019-08-04 16:13                 ` Mark Hatle
2019-08-05 14:23                 ` Jason Wessel
2019-08-05 22:42               ` Bystricky, Juro
2019-08-06  6:51                 ` Martin Jansa
2019-08-14 16:02                   ` Randy MacLeod
2019-08-14 17:09                     ` Martin Jansa

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=20190802120733.4a24ca3f@seebsdell \
    --to=seebs@seebs.net \
    --cc=jason.wessel@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox