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-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201104271700.13013.arnd@arndb.de>
Date:	Wed, 27 Apr 2011 17:00:12 +0200
From:	Arnd Bergmann <arnd@...db.de>
To:	Andrea Righi <andrea@...terlinux.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Dave Chinner <david@...morbit.com>,
	Mike Frysinger <vapier@...too.org>,
	Al Viro <viro@...iv.linux.org.uk>,
	linux-fsdevel@...r.kernel.org, linux-api@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] fadvise: introduce POSIX_FADV_DONTNEED_FS

On Wednesday 27 April 2011 16:29:05 Andrea Righi wrote:
> diff --git a/include/linux/fadvise.h b/include/linux/fadvise.h
> index e8e7471..dc9ce98 100644
> --- a/include/linux/fadvise.h
> +++ b/include/linux/fadvise.h
> @@ -13,9 +13,11 @@
>  #if defined(__s390x__)
>  #define POSIX_FADV_DONTNEED    6 /* Don't need these pages.  */
>  #define POSIX_FADV_NOREUSE     7 /* Data will be accessed once.  */
> +#define POSIX_FADV_DONTNEED_FS 8 /* Don't need these filesystem pages.  */
>  #else
>  #define POSIX_FADV_DONTNEED    4 /* Don't need these pages.  */
>  #define POSIX_FADV_NOREUSE     5 /* Data will be accessed once.  */
> +#define POSIX_FADV_DONTNEED_FS 6 /* Don't need these filesystem pages.  */
>  #endif
>  
>  #endif /* FADVISE_H_INCLUDED */

Please don't make the s390 mess worse than it already is here.
I think the best solution would be to assign new values starting
from 8 so they can be common for all architectures.

> @@ -127,6 +128,12 @@ SYSCALL_DEFINE(fadvise64_64)(int fd, loff_t offset, loff_t len, int advice)
>                         invalidate_mapping_pages(mapping, start_index,
>                                                 end_index);
>                 break;
> +       case POSIX_FADV_DONTNEED_FS:
> +               if (!current_euid())
> +                       drop_pagecache_sb(file->f_dentry->d_sb, NULL);
> +               else
> +                       ret = -EPERM;
> +               break;

I somewhat disagree with keying the capability off the UID value, even
if that is what the sysctl uses. CAP_SYS_ADMIN is not that nice either, but
I think it's better than the UID here.

Aside from these, I like the patch.

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