Merge branch 'android12-5.10' into android12-5.10-lts

Sync up with android12-5.10 for the following commits:

d30938528e ANDROID: GKI: Update symbol list for VIVO
47458bf124 ANDROID: block: export tracepoints
e41b116463 ANDROID: setlocalversion: make KMI_GENERATION optional
5dac28a174 BACKPORT: uapi: virtio_ids: add a sound device type ID from OASIS spec
2f3f5731de ANDROID: GKI: Add vendor hook to binder transaction
775cd2119d ANDROID: qcom: Add smp_call_function_single_async to ABI
d736cbf8d9 Revert "sched/fair: Keep load_avg and load_sum synced"
de0ba4ea3c Revert "sched/pelt: Ensure that *_sum is always synced with *_avg"
8630facf34 Revert "sched/fair: Ensure _sum and _avg values stay consistent"
7a7b5f89d9 ANDROID: locking/rwsem: only clean RWSEM_FLAG_HANDOFF when already set
a1a4c80265 UPSTREAM: f2fs: change fiemap way in printing compression chunk
cc98cd4a3e ANDROID: GKI: add allowed list file for xiaomi
fa9c907453 ANDROID: GKI: Update symbol list
ea592f07f6 ANDROID: Update symbol list for mtk
a4eacf3227 ANDROID: binder: fix regression in sender_euid
6b7c37f6c4 ANDROID: fips140: use UTS_RELEASE as FIPS version
11db2de0af BACKPORT: binder: use cred instead of task for getsecid
3af7a2f610 BACKPORT: binder: use cred instead of task for selinux checks
d492977395 BACKPORT: binder: use euid from cred instead of using task
7e2fbdaeab ANDROID: vendor_hooks: Add hooks for frequency optimization
054a3c228a ANDROID: GKI: Update symbols to symbol list
0db6925868 ANDROID: vendor_hooks: export get_wchan
a61d61bab7 ANDROID: vendor_hooks: Add hooks to record the time of the process in various states
6cf4b65244 FROMGIT: dma-buf: acquire name lock before read/write dma_buf.name

Due to api additions in android12-5.10, this also adds more api symbols
to track:

Leaf changes summary: 33 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 19 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 14 Added variables

19 Added functions:

  [A] 'function int __traceiter_android_vh_cpufreq_fast_switch(void*, cpufreq_policy*, unsigned int, unsigned int)'
  [A] 'function int __traceiter_android_vh_cpufreq_resolve_freq(void*, cpufreq_policy*, unsigned int, unsigned int)'
  [A] 'function int __traceiter_android_vh_cpufreq_target(void*, cpufreq_policy*, unsigned int, unsigned int)'
  [A] 'function int __traceiter_android_vh_sched_stat_runtime_rt(void*, task_struct*, u64)'
  [A] 'function int __traceiter_block_bio_complete(void*, request_queue*, bio*)'
  [A] 'function int __traceiter_block_bio_queue(void*, request_queue*, bio*)'
  [A] 'function int __traceiter_block_getrq(void*, request_queue*, bio*, int)'
  [A] 'function int __traceiter_block_rq_complete(void*, request*, int, unsigned int)'
  [A] 'function int __traceiter_block_rq_insert(void*, request_queue*, request*)'
  [A] 'function int __traceiter_block_rq_issue(void*, request_queue*, request*)'
  [A] 'function int __traceiter_block_rq_merge(void*, request_queue*, request*)'
  [A] 'function int __traceiter_block_rq_requeue(void*, request_queue*, request*)'
  [A] 'function int __traceiter_block_split(void*, request_queue*, bio*, unsigned int)'
  [A] 'function int __traceiter_sched_stat_runtime(void*, task_struct*, u64, u64)'
  [A] 'function int dev_change_flags(net_device*, unsigned int, netlink_ext_ack*)'
  [A] 'function unsigned long int get_wchan(task_struct*)'
  [A] 'function void* mempool_alloc_pages(gfp_t, void*)'
  [A] 'function void mempool_free_pages(void*, void*)'
  [A] 'function int mempool_resize(mempool_t*, int)'

14 Added variables:

  [A] 'tracepoint __tracepoint_android_vh_cpufreq_fast_switch'
  [A] 'tracepoint __tracepoint_android_vh_cpufreq_resolve_freq'
  [A] 'tracepoint __tracepoint_android_vh_cpufreq_target'
  [A] 'tracepoint __tracepoint_android_vh_sched_stat_runtime_rt'
  [A] 'tracepoint __tracepoint_block_bio_complete'
  [A] 'tracepoint __tracepoint_block_bio_queue'
  [A] 'tracepoint __tracepoint_block_getrq'
  [A] 'tracepoint __tracepoint_block_rq_complete'
  [A] 'tracepoint __tracepoint_block_rq_insert'
  [A] 'tracepoint __tracepoint_block_rq_issue'
  [A] 'tracepoint __tracepoint_block_rq_merge'
  [A] 'tracepoint __tracepoint_block_rq_requeue'
  [A] 'tracepoint __tracepoint_block_split'
  [A] 'tracepoint __tracepoint_sched_stat_runtime'

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I15990841323b2a040b41d8207da3532f3d0db795
This commit is contained in:
Greg Kroah-Hartman 2021-11-18 17:03:39 +01:00
commit 706ebf15a1
28 changed files with 610 additions and 327 deletions

File diff suppressed because it is too large Load Diff

View File

@ -292,6 +292,7 @@
destroy_workqueue
dev_alloc_name
dev_base_lock
dev_change_flags
dev_change_net_namespace
dev_close
dev_driver_string

View File

@ -974,6 +974,7 @@
get_user_pages
get_user_pages_remote
get_vaddr_frames
get_wchan
get_zeroed_page
gic_nonsecure_priorities
gov_attr_set_get
@ -1112,8 +1113,8 @@
init_uts_ns
init_wait_entry
__init_waitqueue_head
inode_permission
inode_owner_or_capable
inode_permission
input_alloc_absinfo
input_allocate_device
input_close_device
@ -2604,6 +2605,9 @@
__traceiter_android_vh_clear_reserved_fmt_fields
__traceiter_android_vh_commit_creds
__traceiter_android_vh_cpufreq_acct_update_power
__traceiter_android_vh_cpufreq_fast_switch
__traceiter_android_vh_cpufreq_resolve_freq
__traceiter_android_vh_cpufreq_target
__traceiter_android_vh_cpu_idle_enter
__traceiter_android_vh_cpu_idle_exit
__traceiter_android_vh_cpu_up
@ -2651,6 +2655,7 @@
__traceiter_android_vh_rwsem_write_finished
__traceiter_android_vh_save_track_hash
__traceiter_android_vh_save_vmalloc_stack
__traceiter_android_vh_sched_stat_runtime_rt
__traceiter_android_vh_scheduler_tick
__traceiter_android_vh_selinux_avc_insert
__traceiter_android_vh_selinux_avc_lookup
@ -2694,6 +2699,7 @@
__traceiter_sched_overutilized_tp
__traceiter_sched_stat_blocked
__traceiter_sched_stat_iowait
__traceiter_sched_stat_runtime
__traceiter_sched_stat_sleep
__traceiter_sched_stat_wait
__traceiter_sched_switch
@ -2790,6 +2796,9 @@
__tracepoint_android_vh_clear_reserved_fmt_fields
__tracepoint_android_vh_commit_creds
__tracepoint_android_vh_cpufreq_acct_update_power
__tracepoint_android_vh_cpufreq_fast_switch
__tracepoint_android_vh_cpufreq_resolve_freq
__tracepoint_android_vh_cpufreq_target
__tracepoint_android_vh_cpu_idle_enter
__tracepoint_android_vh_cpu_idle_exit
__tracepoint_android_vh_cpu_up
@ -2837,6 +2846,7 @@
__tracepoint_android_vh_rwsem_write_finished
__tracepoint_android_vh_save_track_hash
__tracepoint_android_vh_save_vmalloc_stack
__tracepoint_android_vh_sched_stat_runtime_rt
__tracepoint_android_vh_scheduler_tick
__tracepoint_android_vh_selinux_avc_insert
__tracepoint_android_vh_selinux_avc_lookup
@ -2883,6 +2893,7 @@
__tracepoint_sched_overutilized_tp
__tracepoint_sched_stat_blocked
__tracepoint_sched_stat_iowait
__tracepoint_sched_stat_runtime
__tracepoint_sched_stat_sleep
__tracepoint_sched_stat_wait
__tracepoint_sched_switch

View File

@ -2251,6 +2251,7 @@
smp_call_function
smp_call_function_any
smp_call_function_single
smp_call_function_single_async
snd_card_free
snd_card_new
snd_card_register

View File

@ -1749,6 +1749,15 @@
__traceiter_android_vh_ufs_send_command
__traceiter_android_vh_ufs_update_sdev
__traceiter_binder_transaction_received
__traceiter_block_bio_complete
__traceiter_block_bio_queue
__traceiter_block_getrq
__traceiter_block_rq_complete
__traceiter_block_rq_insert
__traceiter_block_rq_issue
__traceiter_block_rq_merge
__traceiter_block_rq_requeue
__traceiter_block_split
__traceiter_cpu_frequency_limits
__traceiter_cpu_idle
__traceiter_dwc3_complete_trb
@ -1852,6 +1861,15 @@
__tracepoint_android_vh_ufs_update_sdev
__tracepoint_android_vh_vmpressure
__tracepoint_binder_transaction_received
__tracepoint_block_bio_complete
__tracepoint_block_bio_queue
__tracepoint_block_getrq
__tracepoint_block_rq_complete
__tracepoint_block_rq_insert
__tracepoint_block_rq_issue
__tracepoint_block_rq_merge
__tracepoint_block_rq_requeue
__tracepoint_block_split
__tracepoint_cpu_frequency_limits
__tracepoint_cpu_idle
__tracepoint_dwc3_complete_trb

View File

@ -40,6 +40,7 @@
scsi_print_command
scsi_dma_map
scsi_host_alloc
scsi_normalize_sense
sg_copy_from_buffer
sg_copy_to_buffer
ufshcd_alloc_host
@ -58,6 +59,9 @@
blk_queue_update_dma_alignment
blk_queue_update_dma_pad
blk_ksm_get_slot_idx
mempool_resize
mempool_alloc_pages
mempool_free_pages
#required by cs35l41 module
regmap_raw_write_async

View File

@ -625,6 +625,7 @@ unsigned long get_wchan(struct task_struct *p)
put_task_stack(p);
return ret;
}
EXPORT_SYMBOL_GPL(get_wchan);
unsigned long arch_align_stack(unsigned long sp)
{

View File

@ -58,6 +58,13 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(block_rq_remap);
EXPORT_TRACEPOINT_SYMBOL_GPL(block_bio_complete);
EXPORT_TRACEPOINT_SYMBOL_GPL(block_split);
EXPORT_TRACEPOINT_SYMBOL_GPL(block_unplug);
EXPORT_TRACEPOINT_SYMBOL_GPL(block_bio_queue);
EXPORT_TRACEPOINT_SYMBOL_GPL(block_getrq);
EXPORT_TRACEPOINT_SYMBOL_GPL(block_rq_insert);
EXPORT_TRACEPOINT_SYMBOL_GPL(block_rq_issue);
EXPORT_TRACEPOINT_SYMBOL_GPL(block_rq_merge);
EXPORT_TRACEPOINT_SYMBOL_GPL(block_rq_requeue);
EXPORT_TRACEPOINT_SYMBOL_GPL(block_rq_complete);
DEFINE_IDA(blk_queue_ida);

View File

@ -8,17 +8,17 @@
#include <linux/completion.h>
#include <linux/module.h>
#include <generated/utsrelease.h>
#undef pr_fmt
#define pr_fmt(fmt) "fips140: " fmt
/*
* This is the name and version number of the module that are shown on the FIPS
* certificate. These don't necessarily have any relation to the filename of
* the .ko file, or to the git branch or commit ID.
* certificate.
*/
#define FIPS140_MODULE_NAME "Android Kernel Cryptographic Module"
#define FIPS140_MODULE_VERSION "v1.0"
#define FIPS140_MODULE_VERSION UTS_RELEASE
#ifdef CONFIG_CRYPTO_FIPS140_MOD_ERROR_INJECTION
extern char *fips140_broken_alg;

View File

@ -2180,7 +2180,8 @@ static int binder_translate_binder(struct flat_binder_object *fp,
ret = -EINVAL;
goto done;
}
if (security_binder_transfer_binder(proc->tsk, target_proc->tsk)) {
if (security_binder_transfer_binder(binder_get_cred(proc),
binder_get_cred(target_proc))) {
ret = -EPERM;
goto done;
}
@ -2226,7 +2227,8 @@ static int binder_translate_handle(struct flat_binder_object *fp,
proc->pid, thread->pid, fp->handle);
return -EINVAL;
}
if (security_binder_transfer_binder(proc->tsk, target_proc->tsk)) {
if (security_binder_transfer_binder(binder_get_cred(proc),
binder_get_cred(target_proc))) {
ret = -EPERM;
goto done;
}
@ -2314,7 +2316,8 @@ static int binder_translate_fd(u32 fd, binder_size_t fd_offset,
ret = -EBADF;
goto err_fget;
}
ret = security_binder_transfer_file(proc->tsk, target_proc->tsk, file);
ret = security_binder_transfer_file(binder_get_cred(proc),
binder_get_cred(target_proc), file);
if (ret < 0) {
ret = -EPERM;
goto err_security;
@ -2724,8 +2727,8 @@ static void binder_transaction(struct binder_proc *proc,
}
e->to_node = target_node->debug_id;
trace_android_vh_binder_trans(target_proc, proc, thread, tr);
if (security_binder_transaction(proc->tsk,
target_proc->tsk) < 0) {
if (security_binder_transaction(binder_get_cred(proc),
binder_get_cred(target_proc)) < 0) {
return_error = BR_FAILED_REPLY;
return_error_param = -EPERM;
return_error_line = __LINE__;
@ -2793,6 +2796,7 @@ static void binder_transaction(struct binder_proc *proc,
if (target_thread)
e->to_thread = target_thread->pid;
e->to_proc = target_proc->pid;
trace_android_rvh_binder_transaction(target_proc, proc, thread, tr);
/* TODO: reuse incoming transaction for reply */
t = kzalloc(sizeof(*t), GFP_KERNEL);
@ -2861,7 +2865,7 @@ static void binder_transaction(struct binder_proc *proc,
size_t added_size;
int max_retries = 100;
security_task_getsecid(proc->tsk, &secid);
security_cred_getsecid(binder_get_cred(proc), &secid);
retry_alloc:
ret = security_secid_to_secctx(secid, &secctx, &secctx_sz);
if (ret == -ENOMEM && max_retries-- > 0) {
@ -4486,6 +4490,8 @@ static struct binder_thread *binder_get_thread(struct binder_proc *proc)
static void binder_free_proc(struct binder_proc *proc)
{
struct binder_device *device;
struct binder_proc_ext *eproc =
container_of(proc, struct binder_proc_ext, proc);
BUG_ON(!list_empty(&proc->todo));
BUG_ON(!list_empty(&proc->delivered_death));
@ -4499,8 +4505,9 @@ static void binder_free_proc(struct binder_proc *proc)
}
binder_alloc_deferred_release(&proc->alloc);
put_task_struct(proc->tsk);
put_cred(eproc->cred);
binder_stats_deleted(BINDER_STAT_PROC);
kfree(proc);
kfree(eproc);
}
static void binder_free_thread(struct binder_thread *thread)
@ -4711,7 +4718,7 @@ static int binder_ioctl_set_ctx_mgr(struct file *filp,
ret = -EBUSY;
goto out;
}
ret = security_binder_set_context_mgr(proc->tsk);
ret = security_binder_set_context_mgr(binder_get_cred(proc));
if (ret < 0)
goto out;
if (uid_valid(context->binder_context_mgr_uid)) {
@ -5187,6 +5194,7 @@ static int binder_mmap(struct file *filp, struct vm_area_struct *vma)
static int binder_open(struct inode *nodp, struct file *filp)
{
struct binder_proc *proc, *itr;
struct binder_proc_ext *eproc;
struct binder_device *binder_dev;
struct binderfs_info *info;
struct dentry *binder_binderfs_dir_entry_proc = NULL;
@ -5195,13 +5203,15 @@ static int binder_open(struct inode *nodp, struct file *filp)
binder_debug(BINDER_DEBUG_OPEN_CLOSE, "%s: %d:%d\n", __func__,
current->group_leader->pid, current->pid);
proc = kzalloc(sizeof(*proc), GFP_KERNEL);
eproc = kzalloc(sizeof(*eproc), GFP_KERNEL);
proc = &eproc->proc;
if (proc == NULL)
return -ENOMEM;
spin_lock_init(&proc->inner_lock);
spin_lock_init(&proc->outer_lock);
get_task_struct(current->group_leader);
proc->tsk = current->group_leader;
eproc->cred = get_cred(filp->f_cred);
INIT_LIST_HEAD(&proc->todo);
init_waitqueue_head(&proc->freeze_wait);
if (binder_supported_policy(current->policy)) {

View File

@ -473,6 +473,29 @@ struct binder_proc {
bool oneway_spam_detection_enabled;
};
/**
* struct binder_proc_ext - binder process bookkeeping
* @proc: element for binder_procs list
* @cred struct cred associated with the `struct file`
* in binder_open()
* (invariant after initialized)
*
* Extended binder_proc -- needed to add the "cred" field without
* changing the KMI for binder_proc.
*/
struct binder_proc_ext {
struct binder_proc proc;
const struct cred *cred;
};
static inline const struct cred *binder_get_cred(struct binder_proc *proc)
{
struct binder_proc_ext *eproc;
eproc = container_of(proc, struct binder_proc_ext, proc);
return eproc->cred;
}
/**
* struct binder_thread - binder thread bookkeeping
* @proc: binder process for this thread

View File

@ -136,6 +136,9 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_show_suspend_epoch_val);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_show_resume_epoch_val);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_show_max_freq);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_freq_table_limits);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cpufreq_resolve_freq);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cpufreq_fast_switch);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cpufreq_target);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_sched_newidle_balance);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_sched_nohz_balancer_kick);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_sched_rebalance_domains);
@ -286,6 +289,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_timerfd_create);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_alloc_new_buf_locked);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_reply);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_trans);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_binder_transaction);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_preset);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_proc_transaction);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_new_ref);
@ -312,6 +316,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_dequeue_entity);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_entity_tick);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_enqueue_task_fair);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_dequeue_task_fair);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_sched_stat_runtime_rt);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_prepare_update_load_avg_se);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_finish_update_load_avg_se);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_selinux_is_initialized);

View File

@ -543,7 +543,10 @@ EXPORT_SYMBOL_GPL(cpufreq_disable_fast_switch);
unsigned int cpufreq_driver_resolve_freq(struct cpufreq_policy *policy,
unsigned int target_freq)
{
unsigned int old_target_freq = target_freq;
target_freq = clamp_val(target_freq, policy->min, policy->max);
trace_android_vh_cpufreq_resolve_freq(policy, target_freq, old_target_freq);
policy->cached_target_freq = target_freq;
if (cpufreq_driver->target_index) {
@ -2094,9 +2097,11 @@ unsigned int cpufreq_driver_fast_switch(struct cpufreq_policy *policy,
unsigned int target_freq)
{
unsigned int freq;
unsigned int old_target_freq = target_freq;
int cpu;
target_freq = clamp_val(target_freq, policy->min, policy->max);
trace_android_vh_cpufreq_fast_switch(policy, target_freq, old_target_freq);
freq = cpufreq_driver->fast_switch(policy, target_freq);
if (!freq)
@ -2213,6 +2218,7 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy,
/* Make sure that target_freq is within supported range */
target_freq = clamp_val(target_freq, policy->min, policy->max);
trace_android_vh_cpufreq_target(policy, target_freq, old_target_freq);
pr_debug("target for CPU %u: %u kHz, relation %u, requested %u kHz\n",
policy->cpu, target_freq, relation, old_target_freq);

View File

@ -1425,6 +1425,7 @@ static int dma_buf_debug_show(struct seq_file *s, void *unused)
if (ret)
goto error_unlock;
spin_lock(&buf_obj->name_lock);
seq_printf(s, "%08zu\t%08x\t%08x\t%08ld\t%s\t%08lu\t%s\n",
buf_obj->size,
buf_obj->file->f_flags, buf_obj->file->f_mode,
@ -1432,6 +1433,7 @@ static int dma_buf_debug_show(struct seq_file *s, void *unused)
buf_obj->exp_name,
file_inode(buf_obj->file)->i_ino,
buf_obj->name ?: "");
spin_unlock(&buf_obj->name_lock);
robj = buf_obj->resv;
while (true) {

View File

@ -1873,8 +1873,9 @@ int f2fs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
u64 logical = 0, phys = 0, size = 0;
u32 flags = 0;
int ret = 0;
bool compr_cluster = false;
bool compr_cluster = false, compr_appended;
unsigned int cluster_size = F2FS_I(inode)->i_cluster_size;
unsigned int count_in_cluster = 0;
loff_t maxbytes;
if (fieinfo->fi_flags & FIEMAP_FLAG_CACHE) {
@ -1922,15 +1923,17 @@ int f2fs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
map.m_next_pgofs = &next_pgofs;
map.m_seg_type = NO_CHECK_TYPE;
if (compr_cluster)
map.m_len = cluster_size - 1;
if (compr_cluster) {
map.m_lblk += 1;
map.m_len = cluster_size - count_in_cluster;
}
ret = f2fs_map_blocks(inode, &map, 0, F2FS_GET_BLOCK_FIEMAP);
if (ret)
goto out;
/* HOLE */
if (!(map.m_flags & F2FS_MAP_FLAGS)) {
if (!compr_cluster && !(map.m_flags & F2FS_MAP_FLAGS)) {
start_blk = next_pgofs;
if (blks_to_bytes(inode, start_blk) < blks_to_bytes(inode,
@ -1940,6 +1943,14 @@ int f2fs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
flags |= FIEMAP_EXTENT_LAST;
}
compr_appended = false;
/* In a case of compressed cluster, append this to the last extent */
if (compr_cluster && ((map.m_flags & F2FS_MAP_UNWRITTEN) ||
!(map.m_flags & F2FS_MAP_FLAGS))) {
compr_appended = true;
goto skip_fill;
}
if (size) {
flags |= FIEMAP_EXTENT_MERGED;
if (IS_ENCRYPTED(inode))
@ -1956,39 +1967,37 @@ int f2fs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
if (start_blk > last_blk)
goto out;
if (compr_cluster) {
compr_cluster = false;
logical = blks_to_bytes(inode, start_blk - 1);
phys = blks_to_bytes(inode, map.m_pblk);
size = blks_to_bytes(inode, cluster_size);
flags |= FIEMAP_EXTENT_ENCODED;
start_blk += cluster_size - 1;
if (start_blk > last_blk)
goto out;
goto prep_next;
}
skip_fill:
if (map.m_pblk == COMPRESS_ADDR) {
compr_cluster = true;
start_blk++;
goto prep_next;
count_in_cluster = 1;
} else if (compr_appended) {
unsigned int appended_blks = cluster_size -
count_in_cluster + 1;
size += blks_to_bytes(inode, appended_blks);
start_blk += appended_blks;
compr_cluster = false;
} else {
logical = blks_to_bytes(inode, start_blk);
phys = __is_valid_data_blkaddr(map.m_pblk) ?
blks_to_bytes(inode, map.m_pblk) : 0;
size = blks_to_bytes(inode, map.m_len);
flags = 0;
if (compr_cluster) {
flags = FIEMAP_EXTENT_ENCODED;
count_in_cluster += map.m_len;
if (count_in_cluster == cluster_size) {
compr_cluster = false;
size += blks_to_bytes(inode, 1);
}
} else if (map.m_flags & F2FS_MAP_UNWRITTEN) {
flags = FIEMAP_EXTENT_UNWRITTEN;
}
start_blk += bytes_to_blks(inode, size);
}
logical = blks_to_bytes(inode, start_blk);
phys = blks_to_bytes(inode, map.m_pblk);
size = blks_to_bytes(inode, map.m_len);
flags = 0;
if (map.m_flags & F2FS_MAP_UNWRITTEN)
flags = FIEMAP_EXTENT_UNWRITTEN;
start_blk += bytes_to_blks(inode, size);
prep_next:
cond_resched();
if (fatal_signal_pending(current))

View File

@ -26,13 +26,13 @@
* #undef LSM_HOOK
* };
*/
LSM_HOOK(int, 0, binder_set_context_mgr, struct task_struct *mgr)
LSM_HOOK(int, 0, binder_transaction, struct task_struct *from,
struct task_struct *to)
LSM_HOOK(int, 0, binder_transfer_binder, struct task_struct *from,
struct task_struct *to)
LSM_HOOK(int, 0, binder_transfer_file, struct task_struct *from,
struct task_struct *to, struct file *file)
LSM_HOOK(int, 0, binder_set_context_mgr, const struct cred *mgr)
LSM_HOOK(int, 0, binder_transaction, const struct cred *from,
const struct cred *to)
LSM_HOOK(int, 0, binder_transfer_binder, const struct cred *from,
const struct cred *to)
LSM_HOOK(int, 0, binder_transfer_file, const struct cred *from,
const struct cred *to, struct file *file)
LSM_HOOK(int, 0, ptrace_access_check, struct task_struct *child,
unsigned int mode)
LSM_HOOK(int, 0, ptrace_traceme, struct task_struct *parent)

View File

@ -1297,22 +1297,22 @@
*
* @binder_set_context_mgr:
* Check whether @mgr is allowed to be the binder context manager.
* @mgr contains the task_struct for the task being registered.
* @mgr contains the struct cred for the current binder process.
* Return 0 if permission is granted.
* @binder_transaction:
* Check whether @from is allowed to invoke a binder transaction call
* to @to.
* @from contains the task_struct for the sending task.
* @to contains the task_struct for the receiving task.
* @from contains the struct cred for the sending process.
* @to contains the struct cred for the receiving process.
* @binder_transfer_binder:
* Check whether @from is allowed to transfer a binder reference to @to.
* @from contains the task_struct for the sending task.
* @to contains the task_struct for the receiving task.
* @from contains the struct cred for the sending process.
* @to contains the struct cred for the receiving process.
* @binder_transfer_file:
* Check whether @from is allowed to transfer @file to @to.
* @from contains the task_struct for the sending task.
* @from contains the struct cred for the sending process.
* @file contains the struct file being transferred.
* @to contains the task_struct for the receiving task.
* @to contains the struct cred for the receiving process.
*
* @ptrace_access_check:
* Check permission before allowing the current process to trace the

View File

@ -252,13 +252,13 @@ extern int security_init(void);
extern int early_security_init(void);
/* Security operations */
int security_binder_set_context_mgr(struct task_struct *mgr);
int security_binder_transaction(struct task_struct *from,
struct task_struct *to);
int security_binder_transfer_binder(struct task_struct *from,
struct task_struct *to);
int security_binder_transfer_file(struct task_struct *from,
struct task_struct *to, struct file *file);
int security_binder_set_context_mgr(const struct cred *mgr);
int security_binder_transaction(const struct cred *from,
const struct cred *to);
int security_binder_transfer_binder(const struct cred *from,
const struct cred *to);
int security_binder_transfer_file(const struct cred *from,
const struct cred *to, struct file *file);
int security_ptrace_access_check(struct task_struct *child, unsigned int mode);
int security_ptrace_traceme(struct task_struct *parent);
int security_capget(struct task_struct *target,
@ -494,25 +494,25 @@ static inline int early_security_init(void)
return 0;
}
static inline int security_binder_set_context_mgr(struct task_struct *mgr)
static inline int security_binder_set_context_mgr(const struct cred *mgr)
{
return 0;
}
static inline int security_binder_transaction(struct task_struct *from,
struct task_struct *to)
static inline int security_binder_transaction(const struct cred *from,
const struct cred *to)
{
return 0;
}
static inline int security_binder_transfer_binder(struct task_struct *from,
struct task_struct *to)
static inline int security_binder_transfer_binder(const struct cred *from,
const struct cred *to)
{
return 0;
}
static inline int security_binder_transfer_file(struct task_struct *from,
struct task_struct *to,
static inline int security_binder_transfer_file(const struct cred *from,
const struct cred *to,
struct file *file)
{
return 0;
@ -1011,6 +1011,11 @@ static inline void security_transfer_creds(struct cred *new,
{
}
static inline void security_cred_getsecid(const struct cred *c, u32 *secid)
{
*secid = 0;
}
static inline int security_kernel_act_as(struct cred *cred, u32 secid)
{
return 0;

View File

@ -52,6 +52,10 @@ DECLARE_HOOK(android_vh_binder_trans,
TP_PROTO(struct binder_proc *target_proc, struct binder_proc *proc,
struct binder_thread *thread, struct binder_transaction_data *tr),
TP_ARGS(target_proc, proc, thread, tr));
DECLARE_RESTRICTED_HOOK(android_rvh_binder_transaction,
TP_PROTO(struct binder_proc *target_proc, struct binder_proc *proc,
struct binder_thread *thread, struct binder_transaction_data *tr),
TP_ARGS(target_proc, proc, thread, tr), 1);
DECLARE_HOOK(android_vh_binder_preset,
TP_PROTO(struct hlist_head *hhead, struct mutex *lock),
TP_ARGS(hhead, lock));

View File

@ -31,6 +31,21 @@ DECLARE_HOOK(android_vh_cpufreq_acct_update_power,
DECLARE_RESTRICTED_HOOK(android_rvh_cpufreq_transition,
TP_PROTO(struct cpufreq_policy *policy),
TP_ARGS(policy), 1);
DECLARE_HOOK(android_vh_cpufreq_resolve_freq,
TP_PROTO(struct cpufreq_policy *policy, unsigned int target_freq,
unsigned int old_target_freq),
TP_ARGS(policy, target_freq, old_target_freq));
DECLARE_HOOK(android_vh_cpufreq_fast_switch,
TP_PROTO(struct cpufreq_policy *policy, unsigned int target_freq,
unsigned int old_target_freq),
TP_ARGS(policy, target_freq, old_target_freq));
DECLARE_HOOK(android_vh_cpufreq_target,
TP_PROTO(struct cpufreq_policy *policy, unsigned int target_freq,
unsigned int old_target_freq),
TP_ARGS(policy, target_freq, old_target_freq));
/* macro versions of hooks are no longer required */
#endif /* _TRACE_HOOK_CPUFREQ_H */

View File

@ -354,6 +354,10 @@ DECLARE_HOOK(android_vh_prepare_update_load_avg_se,
TP_PROTO(struct sched_entity *se, int flags),
TP_ARGS(se, flags));
DECLARE_HOOK(android_vh_sched_stat_runtime_rt,
TP_PROTO(struct task_struct *tsk, u64 delta),
TP_ARGS(tsk, delta));
DECLARE_HOOK(android_vh_finish_update_load_avg_se,
TP_PROTO(struct sched_entity *se, int flags),
TP_ARGS(se, flags));

View File

@ -45,6 +45,7 @@
#define VIRTIO_ID_CRYPTO 20 /* virtio crypto */
#define VIRTIO_ID_IOMMU 23 /* virtio IOMMU */
#define VIRTIO_ID_MEM 24 /* virtio mem */
#define VIRTIO_ID_SOUND 25 /* virtio sound */
#define VIRTIO_ID_FS 26 /* virtio filesystem */
#define VIRTIO_ID_PMEM 27 /* virtio pmem */
#define VIRTIO_ID_MAC80211_HWSIM 29 /* virtio mac80211-hwsim */

View File

@ -1287,7 +1287,7 @@ rwsem_down_write_slowpath(struct rw_semaphore *sem, int state)
list_del(&waiter.list);
if (unlikely(wstate == WRITER_HANDOFF))
atomic_long_add(-RWSEM_FLAG_HANDOFF, &sem->count);
atomic_long_andnot(RWSEM_FLAG_HANDOFF, &sem->count);
if (list_empty(&sem->wait_list))
atomic_long_andnot(RWSEM_FLAG_WAITERS, &sem->count);

View File

@ -24,6 +24,8 @@
#include <trace/hooks/sched.h>
EXPORT_TRACEPOINT_SYMBOL_GPL(sched_stat_runtime);
/*
* Targeted preemption latency for CPU-bound tasks:
*
@ -3509,9 +3511,10 @@ update_tg_cfs_runnable(struct cfs_rq *cfs_rq, struct sched_entity *se, struct cf
static inline void
update_tg_cfs_load(struct cfs_rq *cfs_rq, struct sched_entity *se, struct cfs_rq *gcfs_rq)
{
long delta, running_sum, runnable_sum = gcfs_rq->prop_runnable_sum;
long delta_avg, running_sum, runnable_sum = gcfs_rq->prop_runnable_sum;
unsigned long load_avg;
u64 load_sum = 0;
s64 delta_sum;
u32 divider;
if (!runnable_sum)
@ -3558,13 +3561,13 @@ update_tg_cfs_load(struct cfs_rq *cfs_rq, struct sched_entity *se, struct cfs_rq
load_sum = (s64)se_weight(se) * runnable_sum;
load_avg = div_s64(load_sum, divider);
delta = load_avg - se->avg.load_avg;
delta_sum = load_sum - (s64)se_weight(se) * se->avg.load_sum;
delta_avg = load_avg - se->avg.load_avg;
se->avg.load_sum = runnable_sum;
se->avg.load_avg = load_avg;
add_positive(&cfs_rq->avg.load_avg, delta);
cfs_rq->avg.load_sum = cfs_rq->avg.load_avg * divider;
add_positive(&cfs_rq->avg.load_avg, delta_avg);
add_positive(&cfs_rq->avg.load_sum, delta_sum);
}
static inline void add_tg_cfs_propagate(struct cfs_rq *cfs_rq, long runnable_sum)
@ -3680,15 +3683,15 @@ update_cfs_rq_load_avg(u64 now, struct cfs_rq *cfs_rq)
r = removed_load;
sub_positive(&sa->load_avg, r);
sa->load_sum = sa->load_avg * divider;
sub_positive(&sa->load_sum, r * divider);
r = removed_util;
sub_positive(&sa->util_avg, r);
sa->util_sum = sa->util_avg * divider;
sub_positive(&sa->util_sum, r * divider);
r = removed_runnable;
sub_positive(&sa->runnable_avg, r);
sa->runnable_sum = sa->runnable_avg * divider;
sub_positive(&sa->runnable_sum, r * divider);
/*
* removed_runnable is the unweighted version of removed_load so we
@ -3775,17 +3778,11 @@ static void attach_entity_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *s
*/
static void detach_entity_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *se)
{
/*
* cfs_rq->avg.period_contrib can be used for both cfs_rq and se.
* See ___update_load_avg() for details.
*/
u32 divider = get_pelt_divider(&cfs_rq->avg);
dequeue_load_avg(cfs_rq, se);
sub_positive(&cfs_rq->avg.util_avg, se->avg.util_avg);
cfs_rq->avg.util_sum = cfs_rq->avg.util_avg * divider;
sub_positive(&cfs_rq->avg.util_sum, se->avg.util_sum);
sub_positive(&cfs_rq->avg.runnable_avg, se->avg.runnable_avg);
cfs_rq->avg.runnable_sum = cfs_rq->avg.runnable_avg * divider;
sub_positive(&cfs_rq->avg.runnable_sum, se->avg.runnable_sum);
add_tg_cfs_propagate(cfs_rq, -se->avg.load_sum);

View File

@ -1026,6 +1026,8 @@ static void update_curr_rt(struct rq *rq)
curr->se.exec_start = now;
cgroup_account_cputime(curr, delta_exec);
trace_android_vh_sched_stat_runtime_rt(curr, delta_exec);
if (!rt_bandwidth_enabled())
return;

View File

@ -41,8 +41,6 @@ if test $# -gt 0; then
kmi_generation=$1
[ $(expr $kmi_generation : '^[0-9]\+$') -eq 0 ] && usage
shift
else
usage
fi
fi
if test $# -gt 0 -o ! -d "$srctree"; then
@ -68,6 +66,8 @@ scm_version()
if [ -n "$android_release" ] && [ -n "$kmi_generation" ]; then
printf '%s' "-$android_release-$kmi_generation"
elif [ -n "$android_release" ]; then
printf '%s' "-$android_release"
fi
# If we are at a tagged commit (like "v2.6.30-rc6"), we ignore

View File

@ -689,25 +689,25 @@ static void __init lsm_early_task(struct task_struct *task)
/* Security operations */
int security_binder_set_context_mgr(struct task_struct *mgr)
int security_binder_set_context_mgr(const struct cred *mgr)
{
return call_int_hook(binder_set_context_mgr, 0, mgr);
}
int security_binder_transaction(struct task_struct *from,
struct task_struct *to)
int security_binder_transaction(const struct cred *from,
const struct cred *to)
{
return call_int_hook(binder_transaction, 0, from, to);
}
int security_binder_transfer_binder(struct task_struct *from,
struct task_struct *to)
int security_binder_transfer_binder(const struct cred *from,
const struct cred *to)
{
return call_int_hook(binder_transfer_binder, 0, from, to);
}
int security_binder_transfer_file(struct task_struct *from,
struct task_struct *to, struct file *file)
int security_binder_transfer_file(const struct cred *from,
const struct cred *to, struct file *file)
{
return call_int_hook(binder_transfer_file, 0, from, to, file);
}

View File

@ -2007,22 +2007,19 @@ static inline u32 open_file_to_av(struct file *file)
/* Hook functions begin here. */
static int selinux_binder_set_context_mgr(struct task_struct *mgr)
static int selinux_binder_set_context_mgr(const struct cred *mgr)
{
u32 mysid = current_sid();
u32 mgrsid = task_sid(mgr);
return avc_has_perm(&selinux_state,
mysid, mgrsid, SECCLASS_BINDER,
current_sid(), cred_sid(mgr), SECCLASS_BINDER,
BINDER__SET_CONTEXT_MGR, NULL);
}
static int selinux_binder_transaction(struct task_struct *from,
struct task_struct *to)
static int selinux_binder_transaction(const struct cred *from,
const struct cred *to)
{
u32 mysid = current_sid();
u32 fromsid = task_sid(from);
u32 tosid = task_sid(to);
u32 fromsid = cred_sid(from);
u32 tosid = cred_sid(to);
int rc;
if (mysid != fromsid) {
@ -2033,27 +2030,24 @@ static int selinux_binder_transaction(struct task_struct *from,
return rc;
}
return avc_has_perm(&selinux_state,
fromsid, tosid, SECCLASS_BINDER, BINDER__CALL,
NULL);
return avc_has_perm(&selinux_state, fromsid, tosid,
SECCLASS_BINDER, BINDER__CALL, NULL);
}
static int selinux_binder_transfer_binder(struct task_struct *from,
struct task_struct *to)
static int selinux_binder_transfer_binder(const struct cred *from,
const struct cred *to)
{
u32 fromsid = task_sid(from);
u32 tosid = task_sid(to);
return avc_has_perm(&selinux_state,
fromsid, tosid, SECCLASS_BINDER, BINDER__TRANSFER,
cred_sid(from), cred_sid(to),
SECCLASS_BINDER, BINDER__TRANSFER,
NULL);
}
static int selinux_binder_transfer_file(struct task_struct *from,
struct task_struct *to,
static int selinux_binder_transfer_file(const struct cred *from,
const struct cred *to,
struct file *file)
{
u32 sid = task_sid(to);
u32 sid = cred_sid(to);
struct file_security_struct *fsec = selinux_file(file);
struct dentry *dentry = file->f_path.dentry;
struct inode_security_struct *isec;