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:	Tue, 17 Nov 2009 18:06:29 +0100
From:	Bernd Petrovitsch <bernd@...mix.at>
To:	linux-kernel@...r.kernel.org,
	Alexey Dobriyan <adobriyan@...il.com>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: O_NOATIME and files in /proc

Hi all!

Is there a specific reason that open can not open files (at
least /proc/noatime and /proc/cpuinfo) under /proc with NO_ATIME as the
following program shows:
----  snip  ----
{12}cat noatime.c

#define _GNU_SOURCE
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>

int main(void)
{
	int fd = open("/proc/uptime", O_RDONLY|O_NOATIME);
	if (fd == -1) {
		printf("fd=%d, errno=%s\n", fd, strerror(errno));
	} else {
		printf("fd=%d\n", fd);
	}
	return 0;
}
----  snip  ----
When I compile and run it, it prints
----  snip  ----
{13}./noatime 
fd=-1, errno=Operation not permitted
----  snip  ----
Removing the "NO_ATIME" makes it work (of course).

I can also set the "noatime" mount flag on a remount and it shows up
in /proc/mounts but it makes for the above no difference.

	Bernd
-- 
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services


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