Hi
There was a change in function posix_acl_valid() where the new implementation required additional argument to be supplied
old:
Code:
posix_acl_valid( posix_acl )
new:
Code:
posix_acl_valid( user_namespace, posix_acl )
so in order to fix the problem the file ifslinux/ufsdvfs.c needs some changes in function ufsd_xattr_set_acl() starting at line line: 5421
The first argument is not supplied in line 5451
Code:
err = posix_acl_valid( acl );
In order to fix that I "borrowed" user_namespace definition from another place in the file (line 4692).
File should contain this updated function.
Code:
///////////////////////////////////////////////////////////
// ufsd_xattr_set_acl
//
// Helper function for ufsd_xattr_acl_access_set/ufsd_xattr_acl_default_set
///////////////////////////////////////////////////////////
static int
ufsd_xattr_set_acl(
IN struct inode *i,
IN int type,
IN const void *value,
IN size_t size
)
{
#include <linux/user_namespace.h>
// wait for 'init_user_ns' to be non G.P.L.
struct user_namespace user_ns = {
.uid_map = { .nr_extents = 1, .extent[0] = { .count = ~0u, }, },
.gid_map = { .nr_extents = 1, .extent[0] = { .count = ~0u, }, },
.projid_map = { .nr_extents = 1, .extent[0] = { .count = ~0u, }, },
#if defined HAVE_STRUCT_USER_NAMESPACE_COUNT && HAVE_STRUCT_USER_NAMESPACE_COUNT
.count = ATOMIC_INIT(3),
#else
.kref = { .refcount = ATOMIC_INIT(3), },
#endif
.owner = GLOBAL_ROOT_UID,
.group = GLOBAL_ROOT_GID,
#if defined HAVE_STRUCT_USER_NAMESPACE_PROC_INUM && HAVE_STRUCT_USER_NAMESPACE_PROC_INUM
.proc_inum = PROC_USER_INIT_INO,
#endif
};
struct posix_acl *acl;
int err;
if ( !UFSD_SB( i->i_sb )->options.acl )
return -EOPNOTSUPP;
if ( !inode_owner_or_capable( i ) )
return -EPERM;
if ( NULL == value )
acl = NULL;
else {
acl = Posix_acl_from_xattr( value, size );
if ( IS_ERR( acl ) )
return PTR_ERR(acl);
if ( NULL != acl ) {
err = posix_acl_valid( &user_ns, acl );
if ( err )
goto release_and_out;
}
}
err = ufsd_set_acl( i, acl, type );
release_and_out:
if ( NULL != acl )
ufsd_posix_acl_release( acl );
return err;
}
Main changes are:
1. Added user_ns structure:
Code:
#include <linux/user_namespace.h>
// wait for 'init_user_ns' to be non G.P.L.
struct user_namespace user_ns = {
.uid_map = { .nr_extents = 1, .extent[0] = { .count = ~0u, }, },
.gid_map = { .nr_extents = 1, .extent[0] = { .count = ~0u, }, },
.projid_map = { .nr_extents = 1, .extent[0] = { .count = ~0u, }, },
#if defined HAVE_STRUCT_USER_NAMESPACE_COUNT && HAVE_STRUCT_USER_NAMESPACE_COUNT
.count = ATOMIC_INIT(3),
#else
.kref = { .refcount = ATOMIC_INIT(3), },
#endif
.owner = GLOBAL_ROOT_UID,
.group = GLOBAL_ROOT_GID,
#if defined HAVE_STRUCT_USER_NAMESPACE_PROC_INUM && HAVE_STRUCT_USER_NAMESPACE_PROC_INUM
.proc_inum = PROC_USER_INIT_INO,
#endif
};
and changed err = posix_acl_valid( acl ); to err = posix_acl_valid( &user_ns, acl );
Hope that helps.
p4xel.