ANDROID: GKI: add more vfs-only exports to their own namespace
When using sdcardfs, some more vfs symbols are needed to be exported to
the filesystem namespace, in order for it to build properly and to
prevent drivers from accessing them.
Like commit 0a77fca3aafc ("ANDROID: GKI: set vfs-only exports into their
own namespace"), move them to the vfs-only namespace so that builds work
properly.
Bug: 157965270
Bug: 210074446
Bug: 317479303
Change-Id: I915402a03712241bdf48681e3fb46aa33dcff305
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
committed by
Carlos Llamas
parent
7c5c987c29
commit
e0f526b01b
@@ -1835,6 +1835,7 @@ MODULE_PARM_DESC(hw_queue_depth, "Queue depth for each hardware queue. Default:
|
||||
MODULE_DESCRIPTION("Loopback device support");
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_ALIAS_BLOCKDEV_MAJOR(LOOP_MAJOR);
|
||||
MODULE_IMPORT_NS(VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver);
|
||||
|
||||
static blk_status_t loop_queue_rq(struct blk_mq_hw_ctx *hctx,
|
||||
const struct blk_mq_queue_data *bd)
|
||||
|
||||
@@ -15,6 +15,12 @@
|
||||
#include "drm_crtc_internal.h"
|
||||
#include "drm_internal.h"
|
||||
|
||||
/* ANDROID:
|
||||
* this is needed to get access to dentry_open, which the drm layer does
|
||||
* need to do.
|
||||
*/
|
||||
MODULE_IMPORT_NS(VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver);
|
||||
|
||||
/**
|
||||
* DOC: drm leasing
|
||||
*
|
||||
|
||||
@@ -548,7 +548,7 @@ void d_drop(struct dentry *dentry)
|
||||
__d_drop(dentry);
|
||||
spin_unlock(&dentry->d_lock);
|
||||
}
|
||||
EXPORT_SYMBOL(d_drop);
|
||||
EXPORT_SYMBOL_NS(d_drop, ANDROID_GKI_VFS_EXPORT_ONLY);
|
||||
|
||||
static inline void dentry_unlist(struct dentry *dentry)
|
||||
{
|
||||
@@ -930,7 +930,7 @@ repeat:
|
||||
spin_unlock(&ret->d_lock);
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(dget_parent);
|
||||
EXPORT_SYMBOL_NS(dget_parent, ANDROID_GKI_VFS_EXPORT_ONLY);
|
||||
|
||||
static struct dentry * __d_find_any_alias(struct inode *inode)
|
||||
{
|
||||
@@ -1812,7 +1812,7 @@ void d_set_d_op(struct dentry *dentry, const struct dentry_operations *op)
|
||||
dentry->d_flags |= DCACHE_OP_REAL;
|
||||
|
||||
}
|
||||
EXPORT_SYMBOL(d_set_d_op);
|
||||
EXPORT_SYMBOL_NS(d_set_d_op, ANDROID_GKI_VFS_EXPORT_ONLY);
|
||||
|
||||
static unsigned d_flags_for_inode(struct inode *inode)
|
||||
{
|
||||
@@ -2433,7 +2433,7 @@ void d_rehash(struct dentry * entry)
|
||||
__d_rehash(entry);
|
||||
spin_unlock(&entry->d_lock);
|
||||
}
|
||||
EXPORT_SYMBOL(d_rehash);
|
||||
EXPORT_SYMBOL_NS(d_rehash, ANDROID_GKI_VFS_EXPORT_ONLY);
|
||||
|
||||
static inline unsigned start_dir_add(struct inode *dir)
|
||||
{
|
||||
|
||||
@@ -1642,7 +1642,7 @@ free_lock:
|
||||
locks_free_lease(new_fl);
|
||||
return error;
|
||||
}
|
||||
EXPORT_SYMBOL(__break_lease);
|
||||
EXPORT_SYMBOL_NS(__break_lease, ANDROID_GKI_VFS_EXPORT_ONLY);
|
||||
|
||||
/**
|
||||
* lease_get_mtime - update modified time of an inode with exclusive lease
|
||||
|
||||
@@ -555,7 +555,7 @@ void path_get(const struct path *path)
|
||||
mntget(path->mnt);
|
||||
dget(path->dentry);
|
||||
}
|
||||
EXPORT_SYMBOL(path_get);
|
||||
EXPORT_SYMBOL_NS(path_get, ANDROID_GKI_VFS_EXPORT_ONLY);
|
||||
|
||||
/**
|
||||
* path_put - put a reference to a path
|
||||
@@ -2762,7 +2762,7 @@ int vfs_path_lookup(struct dentry *dentry, struct vfsmount *mnt,
|
||||
putname(filename);
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(vfs_path_lookup);
|
||||
EXPORT_SYMBOL_NS(vfs_path_lookup, ANDROID_GKI_VFS_EXPORT_ONLY);
|
||||
|
||||
static int lookup_one_common(struct mnt_idmap *idmap,
|
||||
const char *name, struct dentry *base, int len,
|
||||
@@ -3165,7 +3165,7 @@ struct dentry *lock_rename(struct dentry *p1, struct dentry *p2)
|
||||
mutex_lock(&p1->d_sb->s_vfs_rename_mutex);
|
||||
return lock_two_directories(p1, p2);
|
||||
}
|
||||
EXPORT_SYMBOL(lock_rename);
|
||||
EXPORT_SYMBOL_NS(lock_rename, ANDROID_GKI_VFS_EXPORT_ONLY);
|
||||
|
||||
/*
|
||||
* c1 and p2 should be on the same fs.
|
||||
@@ -3217,7 +3217,7 @@ void unlock_rename(struct dentry *p1, struct dentry *p2)
|
||||
mutex_unlock(&p1->d_sb->s_vfs_rename_mutex);
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL(unlock_rename);
|
||||
EXPORT_SYMBOL_NS(unlock_rename, ANDROID_GKI_VFS_EXPORT_ONLY);
|
||||
|
||||
/**
|
||||
* vfs_prepare_mode - prepare the mode to be used for a new inode
|
||||
|
||||
@@ -1478,7 +1478,7 @@ struct vfsmount *mntget(struct vfsmount *mnt)
|
||||
mnt_add_count(real_mount(mnt), 1);
|
||||
return mnt;
|
||||
}
|
||||
EXPORT_SYMBOL(mntget);
|
||||
EXPORT_SYMBOL_NS_GPL(mntget, ANDROID_GKI_VFS_EXPORT_ONLY);
|
||||
|
||||
/*
|
||||
* Make a mount point inaccessible to new lookups.
|
||||
|
||||
@@ -1118,7 +1118,7 @@ struct file *dentry_open(const struct path *path, int flags,
|
||||
}
|
||||
return f;
|
||||
}
|
||||
EXPORT_SYMBOL(dentry_open);
|
||||
EXPORT_SYMBOL_NS(dentry_open, ANDROID_GKI_VFS_EXPORT_ONLY);
|
||||
|
||||
/**
|
||||
* dentry_create - Create and open a file
|
||||
|
||||
@@ -57,7 +57,7 @@ void fsstack_copy_inode_size(struct inode *dst, struct inode *src)
|
||||
if (sizeof(i_size) > sizeof(long) || sizeof(i_blocks) > sizeof(long))
|
||||
spin_unlock(&dst->i_lock);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(fsstack_copy_inode_size);
|
||||
EXPORT_SYMBOL_NS_GPL(fsstack_copy_inode_size, ANDROID_GKI_VFS_EXPORT_ONLY);
|
||||
|
||||
/* copy all attributes */
|
||||
void fsstack_copy_attr_all(struct inode *dest, const struct inode *src)
|
||||
|
||||
@@ -206,7 +206,7 @@ int vfs_getattr(const struct path *path, struct kstat *stat,
|
||||
return retval;
|
||||
return vfs_getattr_nosec(path, stat, request_mask, query_flags);
|
||||
}
|
||||
EXPORT_SYMBOL(vfs_getattr);
|
||||
EXPORT_SYMBOL_NS(vfs_getattr, ANDROID_GKI_VFS_EXPORT_ONLY);
|
||||
|
||||
/**
|
||||
* vfs_fstat - Get the basic attributes by file descriptor
|
||||
|
||||
@@ -92,7 +92,7 @@ int vfs_statfs(const struct path *path, struct kstatfs *buf)
|
||||
buf->f_flags = calculate_f_flags(path->mnt);
|
||||
return error;
|
||||
}
|
||||
EXPORT_SYMBOL(vfs_statfs);
|
||||
EXPORT_SYMBOL_NS(vfs_statfs, ANDROID_GKI_VFS_EXPORT_ONLY);
|
||||
|
||||
int user_statfs(const char __user *pathname, struct kstatfs *st)
|
||||
{
|
||||
|
||||
@@ -1738,7 +1738,7 @@ struct dentry *mount_nodev(struct file_system_type *fs_type,
|
||||
s->s_flags |= SB_ACTIVE;
|
||||
return dget(s->s_root);
|
||||
}
|
||||
EXPORT_SYMBOL(mount_nodev);
|
||||
EXPORT_SYMBOL_NS(mount_nodev, ANDROID_GKI_VFS_EXPORT_ONLY);
|
||||
|
||||
int reconfigure_single(struct super_block *s,
|
||||
int flags, void *data)
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
# Makefile for the linux kernel.
|
||||
#
|
||||
|
||||
CFLAGS_cred.o = -DANDROID_GKI_VFS_EXPORT_ONLY=VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver
|
||||
obj-y = fork.o exec_domain.o panic.o \
|
||||
cpu.o exit.o softirq.o resource.o \
|
||||
sysctl.o capability.o ptrace.o user.o \
|
||||
|
||||
@@ -251,7 +251,7 @@ error:
|
||||
abort_creds(new);
|
||||
return NULL;
|
||||
}
|
||||
EXPORT_SYMBOL(prepare_creds);
|
||||
EXPORT_SYMBOL_NS(prepare_creds, ANDROID_GKI_VFS_EXPORT_ONLY);
|
||||
|
||||
/*
|
||||
* Prepare credentials for current to perform an execve()
|
||||
@@ -510,7 +510,7 @@ const struct cred *override_creds(const struct cred *new)
|
||||
atomic_long_read(&old->usage));
|
||||
return old;
|
||||
}
|
||||
EXPORT_SYMBOL(override_creds);
|
||||
EXPORT_SYMBOL_NS(override_creds, ANDROID_GKI_VFS_EXPORT_ONLY);
|
||||
|
||||
/**
|
||||
* revert_creds - Revert a temporary subjective credentials override
|
||||
@@ -530,7 +530,7 @@ void revert_creds(const struct cred *old)
|
||||
trace_android_rvh_revert_creds(current, old);
|
||||
put_cred(override);
|
||||
}
|
||||
EXPORT_SYMBOL(revert_creds);
|
||||
EXPORT_SYMBOL_NS(revert_creds, ANDROID_GKI_VFS_EXPORT_ONLY);
|
||||
|
||||
/**
|
||||
* cred_fscmp - Compare two credentials with respect to filesystem access.
|
||||
|
||||
@@ -389,3 +389,4 @@ static void __exit exit_dns_resolver(void)
|
||||
module_init(init_dns_resolver)
|
||||
module_exit(exit_dns_resolver)
|
||||
MODULE_LICENSE("GPL");
|
||||
MODULE_IMPORT_NS(VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver);
|
||||
|
||||
Reference in New Issue
Block a user