GNU bug report logs - #8831
[Ubuntu10.10] Impossible to create an hardlink without write access

Previous Next

Package: coreutils;

Reported by: Johan Oudinet <johan.oudinet <at> gmail.com>

Date: Thu, 9 Jun 2011 18:06:02 UTC

Severity: normal

Done: Sven Joachim <svenjoac <at> gmx.de>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 8831 in the body.
You can then email your comments to 8831 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#8831; Package coreutils. (Thu, 09 Jun 2011 18:06:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Johan Oudinet <johan.oudinet <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Thu, 09 Jun 2011 18:06:02 GMT) Full text and rfc822 format available.

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

From: Johan Oudinet <johan.oudinet <at> gmail.com>
To: bug-coreutils <at> gnu.org
Subject: [Ubuntu10.10] Impossible to create an hardlink without write access
Date: Thu, 9 Jun 2011 19:47:16 +0200
*** System information ***
GNU coreutils 8.5
Ubuntu 10.10 32bits Ext4

*** Error description ***
$ sudo touch f; ln f g
ln: creating hard link `g' => `f': Operation not permitted

However, the following commands work:
$ sudo touch f2; sudo chmod a+w f2; ln f2 g

The first call to ln should be permitted too.

Regards,
-- 
Johan




Information forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#8831; Package coreutils. (Thu, 09 Jun 2011 21:00:04 GMT) Full text and rfc822 format available.

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

From: Bob Proulx <bob <at> proulx.com>
To: Johan Oudinet <johan.oudinet <at> gmail.com>
Cc: 8831 <at> debbugs.gnu.org
Subject: Re: bug#8831: [Ubuntu10.10] Impossible to create an hardlink without
	write access
Date: Thu, 9 Jun 2011 14:59:06 -0600
Johan Oudinet wrote:
> GNU coreutils 8.5
> Ubuntu 10.10 32bits Ext4
>
> $ sudo touch f; ln f g
> ln: creating hard link `g' => `f': Operation not permitted

Thank you for the bug report.  However I am unable to recreate this
problem using 8.5 on my Debian system using ext3.

  $ sudo touch f
  $ ln f g
  $ ls -ldog f g
  -rw-r--r-- 2 0 Jun  9 14:55 f
  -rw-r--r-- 2 0 Jun  9 14:55 g

Perhaps this is a problem with ext4?  Can you run your test using
strace so that we can see what the system is saying?  Something like
this following command.

  $ strace -e trace=file -o /tmp/ln.strace.out ln f g

On my system I see this output:

  ...
  stat("g", 0x7fffa6430f10)               = -1 ENOENT (No such file or directory)
  lstat("f", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
  linkat(AT_FDCWD, "f", AT_FDCWD, "g", 0) = 0

> However, the following commands work:
> $ sudo touch f2; sudo chmod a+w f2; ln f2 g
> 
> The first call to ln should be permitted too.

As far as I can tell it is permitted.  If it isn't then it would be a
kernel limitation.

Bob




Reply sent to Sven Joachim <svenjoac <at> gmx.de>:
You have taken responsibility. (Thu, 09 Jun 2011 21:24:02 GMT) Full text and rfc822 format available.

Notification sent to Johan Oudinet <johan.oudinet <at> gmail.com>:
bug acknowledged by developer. (Thu, 09 Jun 2011 21:24:02 GMT) Full text and rfc822 format available.

Message #13 received at 8831-done <at> debbugs.gnu.org (full text, mbox):

From: Sven Joachim <svenjoac <at> gmx.de>
To: Bob Proulx <bob <at> proulx.com>
Cc: 8831-done <at> debbugs.gnu.org, Johan Oudinet <johan.oudinet <at> gmail.com>
Subject: Re: bug#8831: [Ubuntu10.10] Impossible to create an hardlink without
	write access
Date: Thu, 09 Jun 2011 23:23:35 +0200
On 2011-06-09 22:59 +0200, Bob Proulx wrote:

> Johan Oudinet wrote:
>> GNU coreutils 8.5
>> Ubuntu 10.10 32bits Ext4
>>
>> $ sudo touch f; ln f g
>> ln: creating hard link `g' => `f': Operation not permitted
>
> Thank you for the bug report.  However I am unable to recreate this
> problem using 8.5 on my Debian system using ext3.
>
>   $ sudo touch f
>   $ ln f g
>   $ ls -ldog f g
>   -rw-r--r-- 2 0 Jun  9 14:55 f
>   -rw-r--r-- 2 0 Jun  9 14:55 g
>
> Perhaps this is a problem with ext4?  Can you run your test using
> strace so that we can see what the system is saying?  Something like
> this following command.
>
>   $ strace -e trace=file -o /tmp/ln.strace.out ln f g
>
> On my system I see this output:
>
>   ...
>   stat("g", 0x7fffa6430f10)               = -1 ENOENT (No such file or directory)
>   lstat("f", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
>   linkat(AT_FDCWD, "f", AT_FDCWD, "g", 0) = 0
>
>> However, the following commands work:
>> $ sudo touch f2; sudo chmod a+w f2; ln f2 g
>> 
>> The first call to ln should be permitted too.
>
> As far as I can tell it is permitted.  If it isn't then it would be a
> kernel limitation.

This is indeed due to an Ubuntu kernel patch that is present since
10.10.  The rationale is given in
https://wiki.ubuntu.com/SecurityTeam/Roadmap/KernelHardening#Hardlink%20Protection.
I'm taking the liberty to close the bug.

Cheers,
       Sven




Information forwarded to owner <at> debbugs.gnu.org, bug-coreutils <at> gnu.org:
bug#8831; Package coreutils. (Sat, 11 Jun 2011 06:38:02 GMT) Full text and rfc822 format available.

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

From: Jim Meyering <jim <at> meyering.net>
To: 8831 <at> debbugs.gnu.org
Cc: svenjoac <at> gmx.de
Subject: Re: bug#8831: [Ubuntu10.10] Impossible to create an hardlink without
	write access
Date: Sat, 11 Jun 2011 08:37:00 +0200
Sven Joachim wrote:
> This is indeed due to an Ubuntu kernel patch that is present since
> 10.10.  The rationale is given in
> https://wiki.ubuntu.com/SecurityTeam/Roadmap/KernelHardening#Hardlink%20Protection.
> I'm taking the liberty to close the bug.

Thanks for explaining and for closing the issue.
It's too easy to forget the latter step.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 09 Jul 2011 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 14 years and 43 days ago.

Previous Next


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