lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 20 Jun 2008 07:17:46 -0700
From:	Dave Hansen <dave@...ux.vnet.ibm.com>
To:	Jens Rottmann <JRottmann@...PERTEmbedded.de>
Cc:	Al Viro <viro@...iv.linux.org.uk>,
	linux-fsdevel <linux-fsdevel@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: "r/o bind mounts" patch in 2.6.26-rc6 changes (breaks?) error
	behaviour

On Fri, 2008-06-20 at 12:16 +0200, Jens Rottmann wrote:
> 
> I noticed the following change in the error behaviour when attempting
> to delete nonexisting files/dirs from R/O-mounted directories:
> 
> Linux 2.6.25.7:
> rm /RO_mounted_path/nonexisting_file
> ==> "No such file or directory"
> 
> Linux 2.6.26-rc6-git6:
> rm /RO_mounted_path/nonexisting_file
> ==> "Read-only file system"

We looked at this way back in the beginning when I started to work on
the patches.  It was decided that the error codes weren't horribly
important.  We did have a case a bit ago where it really mattered, and
Al fixed that up.

I know this changed behavior a bit, but userspace can surely work around
it with read-only operations (stat) when it is really important to get
the error to the user just right.

> @@ -2371,8 +2373,10 @@ static long do_unlinkat(int dfd, const c
>                 if (inode)
>                         atomic_inc(&inode->i_count);
>                 error = mnt_want_write(nd.path.mnt);
> -               if (error)
> +               if (error) {
> +                       error = vfs_unlink(nd.path.dentry->d_inode, dentry);
>                         goto exit2;
> +               }
>                 error = vfs_unlink(nd.path.dentry->d_inode, dentry);
>                 mnt_drop_write(nd.path.mnt);

On a r/w fs where this is being performed on a r/o bind mount, this will
let you unlink files.  I think that's bad.  :)

-- Dave

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ