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, 30 Dec 2011 16:26:49 -0800
From:	Andrew Ayer <agwa@...rewayer.name>
To:	Alexander Viro <viro@...iv.linux.org.uk>
Cc:	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 0/2] vfs: POSIX-compliant version of fchmodat with flag argument

Hi,

The below patches implement a 4 argument version of fchmodat (fchmodat4)
that supports a flag argument, as specified by POSIX.  Currently, the
glibc wrapper has a flag argument, but fails with EOPNOTSUPP if you
specify AT_SYMLINK_NOFOLLOW. POSIX says that fchmodat should only fail
with EOPNOTSUPP if you specify AT_SYMLINK_NOFOLLOW and the path actually
refers to a symbolic link (and the system doesn't support changing the
mode of symbolic links).  Unfortunately glibc can't do better because
the current syscall doesn't have a flag argument.

In addition to supporting AT_SYMLINK_NOFOLLOW, this also supports the
AT_EMPTY_PATH flag, just like fchownat.

Besides the POSIX-compliance, this patch will make it possible to
ensure, in a race-free way, that you do not follow symlinks when
chmodding. Previously, you could open a file with O_NOFOLLOW and fchmod
it, but this only worked if you had read or write permissions on the
file.  Now you can open the file with O_PATH|O_NOFOLLOW and do fchmodat
with AT_EMPTY_PATH.

Any feedback is welcome.

Cheers, 
Andrew

--
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