lkml.org 
[lkml]   [2016]   [Oct]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 20/26] ubifs: Add support for encrypted symlinks
On Fri, Oct 21, 2016 at 02:48:35PM +0200, Richard Weinberger wrote:
> +
> + if (!dentry)
> + return ERR_PTR(-ECHILD);
> +
> + if (ubifs_crypt_is_encrypted(inode)) {
> + err = fscrypt_get_encryption_info(inode);
> + if (err)
> + return ERR_PTR(err);
> + } else
> + return ui->data;
> +

This will make path lookups drop out of RCU mode when an unencrypted symlink is
followed. This can be avoided by checking for unencrypted symlinks first:

if (!ubifs_crypt_is_encrypted(inode))
return ui->data;

if (!dentry)
return ERR_PTR(-ECHILD);

err = fscrypt_get_encryption_info(inode);
if (err)
return ERR_PTR(err);

> +
> + pstr.name[err] = '\0';
> +

In 4.9, fscrypt_fname_{disk_to_usr,usr_to_disk} return 0 instead of the output
length, so this will need to be changed to 'pstr.name[pstr.len] = '\0''.

\
 
 \ /
  Last update: 2016-10-21 20:43    [W:0.168 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site