lkml.org 
[lkml]   [2011]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [git pull] apparmor fix for __d_path() misuse
From
Date
Al Viro wrote:
> diff --git a/security/tomoyo/realpath.c b/security/tomoyo/realpath.c
> index 738bbdf..36fa7c9 100644
> --- a/security/tomoyo/realpath.c
> +++ b/security/tomoyo/realpath.c
> @@ -101,9 +101,8 @@ static char *tomoyo_get_absolute_path(struct path *path, char * const buffer,
> {
> char *pos = ERR_PTR(-ENOMEM);
> if (buflen >= 256) {
> - struct path ns_root = { };
> /* go to whatever namespace root we are under */
> - pos = __d_path(path, &ns_root, buffer, buflen - 1);
> + pos = d_absolute_path(path, buffer, buflen - 1);
> if (!IS_ERR(pos) && *pos == '/' && pos[1]) {
> struct inode *inode = path->dentry->d_inode;
> if (inode && S_ISDIR(inode->i_mode)) {

Currently, TOMOYO assumes that -ENAMETOOLONG is the only error which __d_path()
might return (and retries with larger buffer size unless kmalloc() fails).
If d_absolute_path() starts returning -EINVAL, TOMOYO will deny requests even
if "partial (I mean the result would have been different if reachable)"
pathname is granted by the policy.

How commonly can conditions that make d_absolute_path() return -EINVAL happen?



Linus Torvalds wrote:
> I don't know of any big distro that uses Tomoyo, so...
Ubuntu, Debian, OpenSUSE, ArchLinux, Mandriva...
Hope you know one of these distro. ;-)


\
 
 \ /
  Last update: 2011-12-07 04:29    [W:1.531 / U:1.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site