From unknown Fri Sep 05 08:56:42 2025 X-Loop: help-debbugs@gnu.org Subject: bug#8831: [Ubuntu10.10] Impossible to create an hardlink without write access Resent-From: Johan Oudinet Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Thu, 09 Jun 2011 18:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 8831 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 8831@debbugs.gnu.org X-Debbugs-Original-To: bug-coreutils@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.130764274017515 (code B ref -1); Thu, 09 Jun 2011 18:06:02 +0000 Received: (at submit) by debbugs.gnu.org; 9 Jun 2011 18:05:40 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QUjbv-0004YS-RV for submit@debbugs.gnu.org; Thu, 09 Jun 2011 14:05:40 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QUjKn-0004BD-4I for submit@debbugs.gnu.org; Thu, 09 Jun 2011 13:47:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QUjKf-00012i-6V for submit@debbugs.gnu.org; Thu, 09 Jun 2011 13:47:51 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RFC_ABUSE_POST, T_DKIM_INVALID, T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:37120) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QUjKe-00012K-NH for submit@debbugs.gnu.org; Thu, 09 Jun 2011 13:47:48 -0400 Received: from eggs.gnu.org ([140.186.70.92]:34518) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QUjKY-0007DB-Fr for bug-coreutils@gnu.org; Thu, 09 Jun 2011 13:47:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QUjKV-0000y8-1e for bug-coreutils@gnu.org; Thu, 09 Jun 2011 13:47:41 -0400 Received: from mail-qw0-f41.google.com ([209.85.216.41]:44615) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QUjKU-0000xB-Gu for bug-coreutils@gnu.org; Thu, 09 Jun 2011 13:47:38 -0400 Received: by qwa26 with SMTP id 26so1177859qwa.0 for ; Thu, 09 Jun 2011 10:47:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:from:date:message-id:subject:to :content-type; bh=Fs+JRVEP0mbPloj4S56YQT1X8bbor/KYVBuFztk2tT4=; b=w6bCfIJJJjW34YcPaqnNNrtWnUKcSp85C3rlDy+FID5uMnVlS5ZC7qJmCeFK9uGnkd T79kXlpIsWWMEj+C+cUbEFfS0B+YzKQ6Ae1NqWnq75C1RUvinsVZUOsOAVaHPb6clIBe XKhx4C17q+5vVcTvvGGYSU0ro0Prg2sYQM5YQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=rIXztHaG8QkhgcwDYVdfvXIqKasuWTYUbMyV+nZl+7JxxZm43V+1mkBlTpbj1Ex0Jg 5jY5TW9j8ELxg5iC8zNoyF8uWlQvpAUJUCC8aBEjb9aPEcAl1xeGXKzslx+5MZrjKGXl WEAmQ5dGr98zCvfN8I1ZczYah7B03Bj4NcMxI= Received: by 10.229.68.227 with SMTP id w35mr771789qci.140.1307641656091; Thu, 09 Jun 2011 10:47:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.212.132 with HTTP; Thu, 9 Jun 2011 10:47:16 -0700 (PDT) From: Johan Oudinet Date: Thu, 9 Jun 2011 19:47:16 +0200 Message-ID: Content-Type: text/plain; charset=ISO-8859-1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -5.9 (-----) X-Mailman-Approved-At: Thu, 09 Jun 2011 14:05:38 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.9 (-----) *** 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 From unknown Fri Sep 05 08:56:42 2025 X-Loop: help-debbugs@gnu.org Subject: bug#8831: [Ubuntu10.10] Impossible to create an hardlink without write access Resent-From: Bob Proulx Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Thu, 09 Jun 2011 21:00:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8831 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Johan Oudinet Cc: 8831@debbugs.gnu.org Received: via spool by 8831-submit@debbugs.gnu.org id=B8831.130765315532110 (code B ref 8831); Thu, 09 Jun 2011 21:00:04 +0000 Received: (at 8831) by debbugs.gnu.org; 9 Jun 2011 20:59:15 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QUmJu-0008Lr-RI for submit@debbugs.gnu.org; Thu, 09 Jun 2011 16:59:15 -0400 Received: from joseki.proulx.com ([216.17.153.58]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QUmJr-0008Ld-Tj for 8831@debbugs.gnu.org; Thu, 09 Jun 2011 16:59:12 -0400 Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id 62C6721312; Thu, 9 Jun 2011 14:59:06 -0600 (MDT) Received: by hysteria.proulx.com (Postfix, from userid 1000) id 3250E2DC65; Thu, 9 Jun 2011 14:59:06 -0600 (MDT) Date: Thu, 9 Jun 2011 14:59:06 -0600 From: Bob Proulx Message-ID: <20110609205906.GA20229@hysteria.proulx.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Score: -2.4 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.4 (--) 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 From unknown Fri Sep 05 08:56:42 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Johan Oudinet Subject: bug#8831: closed (Re: bug#8831: [Ubuntu10.10] Impossible to create an hardlink without write access) Message-ID: References: <87hb7yya08.fsf@turtle.gmx.de> X-Gnu-PR-Message: they-closed 8831 X-Gnu-PR-Package: coreutils Reply-To: 8831@debbugs.gnu.org Date: Thu, 09 Jun 2011 21:24:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1307654642-1779-1" This is a multi-part message in MIME format... ------------=_1307654642-1779-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #8831: [Ubuntu10.10] Impossible to create an hardlink without write access which was filed against the coreutils package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 8831@debbugs.gnu.org. --=20 8831: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D8831 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1307654642-1779-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 8831-done) by debbugs.gnu.org; 9 Jun 2011 21:23:43 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QUmhb-0000SD-GH for submit@debbugs.gnu.org; Thu, 09 Jun 2011 17:23:43 -0400 Received: from mailout-de.gmx.net ([213.165.64.22]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1QUmhY-0000S1-NH for 8831-done@debbugs.gnu.org; Thu, 09 Jun 2011 17:23:41 -0400 Received: (qmail invoked by alias); 09 Jun 2011 21:23:33 -0000 Received: from p4FF89C18.dip.t-dialin.net (EHLO turtle.gmx.de) [79.248.156.24] by mail.gmx.net (mp026) with SMTP; 09 Jun 2011 23:23:33 +0200 X-Authenticated: #28250155 X-Provags-ID: V01U2FsdGVkX18Lgi1xeHcLpiOrrUIi2+528/hu1+MPZ0LmcgWeRq ySDmQRZQ5ZLkA0 Received: by turtle.gmx.de (Postfix, from userid 1000) id D362B3F4CF; Thu, 9 Jun 2011 23:23:35 +0200 (CEST) From: Sven Joachim To: Bob Proulx Subject: Re: bug#8831: [Ubuntu10.10] Impossible to create an hardlink without write access References: <20110609205906.GA20229@hysteria.proulx.com> Date: Thu, 09 Jun 2011 23:23:35 +0200 In-Reply-To: <20110609205906.GA20229@hysteria.proulx.com> (Bob Proulx's message of "Thu, 9 Jun 2011 14:59:06 -0600") Message-ID: <87hb7yya08.fsf@turtle.gmx.de> User-Agent: Gnus/5.110017 (No Gnus v0.17) Emacs/23.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Y-GMX-Trusted: 0 X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 8831-done Cc: 8831-done@debbugs.gnu.org, Johan Oudinet X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) 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 ------------=_1307654642-1779-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 9 Jun 2011 18:05:40 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QUjbv-0004YS-RV for submit@debbugs.gnu.org; Thu, 09 Jun 2011 14:05:40 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QUjKn-0004BD-4I for submit@debbugs.gnu.org; Thu, 09 Jun 2011 13:47:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QUjKf-00012i-6V for submit@debbugs.gnu.org; Thu, 09 Jun 2011 13:47:51 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RFC_ABUSE_POST, T_DKIM_INVALID, T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:37120) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QUjKe-00012K-NH for submit@debbugs.gnu.org; Thu, 09 Jun 2011 13:47:48 -0400 Received: from eggs.gnu.org ([140.186.70.92]:34518) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QUjKY-0007DB-Fr for bug-coreutils@gnu.org; Thu, 09 Jun 2011 13:47:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QUjKV-0000y8-1e for bug-coreutils@gnu.org; Thu, 09 Jun 2011 13:47:41 -0400 Received: from mail-qw0-f41.google.com ([209.85.216.41]:44615) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QUjKU-0000xB-Gu for bug-coreutils@gnu.org; Thu, 09 Jun 2011 13:47:38 -0400 Received: by qwa26 with SMTP id 26so1177859qwa.0 for ; Thu, 09 Jun 2011 10:47:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:from:date:message-id:subject:to :content-type; bh=Fs+JRVEP0mbPloj4S56YQT1X8bbor/KYVBuFztk2tT4=; b=w6bCfIJJJjW34YcPaqnNNrtWnUKcSp85C3rlDy+FID5uMnVlS5ZC7qJmCeFK9uGnkd T79kXlpIsWWMEj+C+cUbEFfS0B+YzKQ6Ae1NqWnq75C1RUvinsVZUOsOAVaHPb6clIBe XKhx4C17q+5vVcTvvGGYSU0ro0Prg2sYQM5YQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=rIXztHaG8QkhgcwDYVdfvXIqKasuWTYUbMyV+nZl+7JxxZm43V+1mkBlTpbj1Ex0Jg 5jY5TW9j8ELxg5iC8zNoyF8uWlQvpAUJUCC8aBEjb9aPEcAl1xeGXKzslx+5MZrjKGXl WEAmQ5dGr98zCvfN8I1ZczYah7B03Bj4NcMxI= Received: by 10.229.68.227 with SMTP id w35mr771789qci.140.1307641656091; Thu, 09 Jun 2011 10:47:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.212.132 with HTTP; Thu, 9 Jun 2011 10:47:16 -0700 (PDT) From: Johan Oudinet Date: Thu, 9 Jun 2011 19:47:16 +0200 Message-ID: Subject: [Ubuntu10.10] Impossible to create an hardlink without write access To: bug-coreutils@gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -5.9 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Thu, 09 Jun 2011 14:05:38 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.9 (-----) *** 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 ------------=_1307654642-1779-1-- From unknown Fri Sep 05 08:56:42 2025 X-Loop: help-debbugs@gnu.org Subject: bug#8831: [Ubuntu10.10] Impossible to create an hardlink without write access Resent-From: Jim Meyering Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-coreutils@gnu.org Resent-Date: Sat, 11 Jun 2011 06:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8831 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 8831@debbugs.gnu.org Cc: svenjoac@gmx.de Received: via spool by 8831-submit@debbugs.gnu.org id=B8831.13077742336718 (code B ref 8831); Sat, 11 Jun 2011 06:38:02 +0000 Received: (at 8831) by debbugs.gnu.org; 11 Jun 2011 06:37:13 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QVHon-0001kD-Cf for submit@debbugs.gnu.org; Sat, 11 Jun 2011 02:37:13 -0400 Received: from mx.meyering.net ([82.230.74.64]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QVHog-0001iL-Ue for 8831@debbugs.gnu.org; Sat, 11 Jun 2011 02:37:11 -0400 Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000) id 273446018D; Sat, 11 Jun 2011 08:37:01 +0200 (CEST) From: Jim Meyering In-Reply-To: <87hb7yya08.fsf@turtle.gmx.de> (Sven Joachim's message of "Thu, 09 Jun 2011 23:23:35 +0200") References: <20110609205906.GA20229@hysteria.proulx.com> <87hb7yya08.fsf@turtle.gmx.de> Date: Sat, 11 Jun 2011 08:37:00 +0200 Message-ID: <87fwngnab7.fsf@rho.meyering.net> Lines: 8 MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -6.0 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.0 (------) 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.