Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(8564)

Issue 312180043: In dr_frontend_unix.c, reimplement drfront_access using POSIX access().

Can't Edit
Can't Publish+Mail
Start Review
Created:
7 years, 4 months ago by Edmund.Grimley.Evans
Modified:
7 years, 4 months ago
Reviewers:
zhaoqin, bruening
CC:
dynamorio-devs_googlegroups.com
Visibility:
Public.

Description

Commit log for first patchset: --------------- In dr_frontend_unix.c, reimplement drfront_access using POSIX access(). This is simpler, avoiding use of geteuid and drfront_dir_try_writable. ---------------

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+13 lines, -41 lines) Patch
M libutil/dr_frontend_unix.c View 1 chunk +13 lines, -41 lines 0 comments Download

Messages

Total messages: 13
Edmund.Grimley.Evans
7 years, 4 months ago (2016-12-09 15:01:58 UTC) #1
bruening
On 2016/12/09 15:01:58, Edmund.Grimley.Evans wrote: > In dr_frontend_unix.c, reimplement drfront_access using POSIX access(). > This ...
7 years, 4 months ago (2016-12-09 15:11:59 UTC) #2
Edmund.Grimley.Evans
On 2016/12/09 15:11:59, bruening wrote: > On 2016/12/09 15:01:58, Edmund.Grimley.Evans wrote: > > In dr_frontend_unix.c, ...
7 years, 4 months ago (2016-12-09 15:14:32 UTC) #3
bruening
On 2016/12/09 15:11:59, bruening wrote: > On 2016/12/09 15:01:58, Edmund.Grimley.Evans wrote: > > In dr_frontend_unix.c, ...
7 years, 4 months ago (2016-12-09 15:15:25 UTC) #4
Edmund.Grimley.Evans
On 2016/12/09 15:15:25, bruening wrote: > On 2016/12/09 15:11:59, bruening wrote: > > On 2016/12/09 ...
7 years, 4 months ago (2016-12-09 15:24:25 UTC) #5
bruening
I was also going to say that if unix uses access() too maybe we can ...
7 years, 4 months ago (2016-12-09 16:31:16 UTC) #6
bruening
On 2016/12/09 15:14:32, Edmund.Grimley.Evans wrote: > On 2016/12/09 15:11:59, bruening wrote: > > On 2016/12/09 ...
7 years, 4 months ago (2016-12-10 20:45:57 UTC) #7
bruening
access() seems to check the real user id, not the effective, so it is a ...
7 years, 4 months ago (2016-12-10 20:48:25 UTC) #8
Edmund.Grimley.Evans
On 2016/12/10 20:48:25, bruening wrote: > access() seems to check the real user id, not ...
7 years, 4 months ago (2016-12-10 22:02:07 UTC) #9
Edmund.Grimley.Evans
By the way, the comment in drfront_dir_try_writable says not to worry about races, but what ...
7 years, 4 months ago (2016-12-10 22:15:24 UTC) #10
bruening
On 2016/12/10 22:02:07, Edmund.Grimley.Evans wrote: > On 2016/12/10 20:48:25, bruening wrote: > > access() seems ...
7 years, 4 months ago (2016-12-11 02:33:59 UTC) #11
Edmund.Grimley.Evans
On 2016/12/11 02:33:59, bruening wrote: > "man access" says "The check is done using the ...
7 years, 4 months ago (2016-12-11 07:58:30 UTC) #12
bruening
7 years, 4 months ago (2016-12-11 21:58:16 UTC) #13
On 2016/12/11 07:58:30, Edmund.Grimley.Evans wrote:
> On 2016/12/11 02:33:59, bruening wrote:
> > "man access" says "The check is done using the calling process's real UID
and
> > GID, rather than the effective IDs".
> 
> Yes, indeed. Do we change the docs, or try to get the old behaviour somehow?

I guess the main question is how valuable is it to switch to access().  If using
access() on UNIX really does cover mounting and SELinux on Linux, Android, and
Mac, it seems like it'd be worth putting it in even if it uses real ID's, so
long as we document it (no known current uses with setuid binaries).  We could
also try faccessat with AT_EACCESS but I'm not sure if that's available
everywhere.

Please see the history of changes for Android where several changes were put in
to handle various problems there (things like root being able to write places
marked unwritable): we'd have to make sure access() covered those.

For further history, xref i#1730 Windows problems, where access() does *not*
check anything beyond local file permission bits and extra try-write checks are
required, and I believe we just ported that same approach to UNIX assuming
access() behaved the same.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b