Skip to content

Commit

Permalink
android: Export symbols needed by Android drivers
Browse files Browse the repository at this point in the history
We want to enable use of the Android ashmem and binder drivers to
support Anbox, but they should not be built-in as that would waste
resources and increase security attack surface on systems that don't
need them.

Export the currently un-exported symbols they depend on.
  • Loading branch information
bwhacks authored and xanmod committed Apr 27, 2021
1 parent 88722c8 commit f050643
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions fs/file.c
Expand Up @@ -788,6 +788,7 @@ int close_fd_get_file(unsigned int fd, struct file **res)

return ret;
}
EXPORT_SYMBOL(close_fd_get_file);

void do_close_on_exec(struct files_struct *files)
{
Expand Down
1 change: 1 addition & 0 deletions kernel/fork.c
Expand Up @@ -1133,6 +1133,7 @@ void mmput_async(struct mm_struct *mm)
schedule_work(&mm->async_put_work);
}
}
EXPORT_SYMBOL_GPL(mmput_async);
#endif

/**
Expand Down
1 change: 1 addition & 0 deletions kernel/sched/core.c
Expand Up @@ -5765,6 +5765,7 @@ int can_nice(const struct task_struct *p, const int nice)
return (nice_rlim <= task_rlimit(p, RLIMIT_NICE) ||
capable(CAP_SYS_NICE));
}
EXPORT_SYMBOL_GPL(can_nice);

#ifdef __ARCH_WANT_SYS_NICE

Expand Down
1 change: 1 addition & 0 deletions kernel/task_work.c
Expand Up @@ -57,6 +57,7 @@ int task_work_add(struct task_struct *task, struct callback_head *work,

return 0;
}
EXPORT_SYMBOL(task_work_add);

/**
* task_work_cancel - cancel a pending work added by task_work_add()
Expand Down
1 change: 1 addition & 0 deletions mm/memory.c
Expand Up @@ -1548,6 +1548,7 @@ void zap_page_range(struct vm_area_struct *vma, unsigned long start,
mmu_notifier_invalidate_range_end(&range);
tlb_finish_mmu(&tlb);
}
EXPORT_SYMBOL_GPL(zap_page_range);

/**
* zap_page_range_single - remove user pages in a given range
Expand Down
1 change: 1 addition & 0 deletions mm/shmem.c
Expand Up @@ -4233,6 +4233,7 @@ int shmem_zero_setup(struct vm_area_struct *vma)

return 0;
}
EXPORT_SYMBOL_GPL(shmem_zero_setup);

/**
* shmem_read_mapping_page_gfp - read into page cache, using specified page allocation flags.
Expand Down
4 changes: 4 additions & 0 deletions security/security.c
Expand Up @@ -727,24 +727,28 @@ int security_binder_set_context_mgr(struct task_struct *mgr)
{
return call_int_hook(binder_set_context_mgr, 0, mgr);
}
EXPORT_SYMBOL_GPL(security_binder_set_context_mgr);

int security_binder_transaction(struct task_struct *from,
struct task_struct *to)
{
return call_int_hook(binder_transaction, 0, from, to);
}
EXPORT_SYMBOL_GPL(security_binder_transaction);

int security_binder_transfer_binder(struct task_struct *from,
struct task_struct *to)
{
return call_int_hook(binder_transfer_binder, 0, from, to);
}
EXPORT_SYMBOL_GPL(security_binder_transfer_binder);

int security_binder_transfer_file(struct task_struct *from,
struct task_struct *to, struct file *file)
{
return call_int_hook(binder_transfer_file, 0, from, to, file);
}
EXPORT_SYMBOL_GPL(security_binder_transfer_file);

int security_ptrace_access_check(struct task_struct *child, unsigned int mode)
{
Expand Down

0 comments on commit f050643

Please sign in to comment.