GNU bug report logs - #30918
mv: don't use syscall() to call renameat2()

Previous Next

Package: coreutils;

Reported by: Ross Burton <ross <at> burtonini.com>

Date: Fri, 23 Mar 2018 18:17:01 UTC

Severity: wishlist

Full log


Message #23 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Seebs <seebs <at> seebs.net>,
 Richard Purdie <richard.purdie <at> linuxfoundation.org>
Cc: bug-coreutils <at> gnu.org, Burton Ross <ross.burton <at> intel.com>
Subject: Re: bug#30918: Don't use syscall() to call renameat2()
Date: Sun, 25 Mar 2018 18:20:56 -0700
Seebs wrote:
> I have significant concerns about the feasibility of a generic wrapper
> for syscall(). In particular, a "wrapper" which does *nothing* but
> forward arguments may well be practical. Or one which just fails
> immediately and claims ENOTSUPP -- but this creates the risk that we'll
> break things which were using perfectly valid syscalls which work fine
> and which we don't need to intercept or do anything with.

For this particular issue, failing with ENOTSUPP should do. Perhaps such a 
behavior could be available as a link-time or runtime option.

More precise would be to have syscall to do nothing but forward arguments, 
*except* for the renameat2 syscall which would work much like the renameat 
wrapper that I assume you already have. This would work for coreutils, shouldn't 
break anything else, shouldn't require a link-time or runtime option, and 
shouldn't be that much harder than always forwarding syscall arguments.

> I'm assuming the race condition refers to the behavior of
> RENAME_EXCHANGE.

No, it's RENAME_NOREPLACE. Coreutils doesn't use RENAME_EXCHANGE now (though it 
might in the future, I suppose).




This bug report was last modified 6 years and 231 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.