Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\ioprio.c Create Date:2022-07-28 17:22:48
Last Modify:2020-03-17 23:21:05 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:SYSCALL_DEFINE3

Proto:SYSCALL_DEFINE3(ioprio_set, int, which, int, who, int, ioprio)

Type:

Parameter:Nothing

102  ret = ioprio_check_cap(ioprio)
103  If ret Then Return ret
106  ret = -ESRCH
107  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
109  Case which == IOPRIO_WHO_PROCESS
110  If Not who Then p = current process
112  Else p = find_task_by_vpid(who)
114  If p Then ret = set_task_ioprio(p, ioprio)
116  Break
117  Case which == IOPRIO_WHO_PGRP
118  If Not who Then pgrp = Without tasklist or RCU lock it is not safe to dereference* the result of task_pgrp/task_session even if task == current,* we can race with another thread doing sys_setsid/sys_setpgid.
120  Else pgrp = find_vpid(who)
122  Do
122  If ((pgrp) != NULL) Then cycle (({
122  cycle (({}), (p) = ({
122  typeof(({typeof(( * ((struct hlist_node * * )( & ( & (pgrp)-> lists of tasks that use this pid [PIDTYPE_PGID])->first))))________p1 = ({union{typeof(( * ((struct hlist_node * * )( & ( & (pgrp)-> lists of tasks that use this pid [PIDTYPE_PGID])->first))))__val;char __c[1];}__u;if (1)__read_once_size( & (( * ((struct hlist_node * * )( & ( & (pgrp)-> lists of tasks that use this pid [PIDTYPE_PGID])->first)))), __u.__c, sizeof(( * ((struct hlist_node * * )( & ( & (pgrp)-> lists of tasks that use this pid [PIDTYPE_PGID])->first)))));Else  __read_once_size_nocheck( & (( * ((struct hlist_node * * )( & ( & (pgrp)-> lists of tasks that use this pid [PIDTYPE_PGID])->first)))), __u.__c, sizeof(( * ((struct hlist_node * * )( & ( & (pgrp)-> lists of tasks that use this pid [PIDTYPE_PGID])->first)))));Do{}while (0);__u.__val;});((typeof( * ( * ((struct hlist_node * * )( & ( & (pgrp)-> lists of tasks that use this pid [PIDTYPE_PGID])->first)))) * )(________p1));}))____ptr = (({
122  typeof(( * ((struct hlist_node * * )( & ( & (pgrp)-> lists of tasks that use this pid [PIDTYPE_PGID])->first))))________p1 = ({
122  union{typeof(( * ((structhlist_node * * )( & first)))) __val;char __c[1];}__u
122  If 1 Then __read_once_size( & (( * ((structhlist_node * * )( & first)))), __c, size of *first )
122  Else __read_once_size_nocheck( & (( * ((structhlist_node * * )( & first)))), __c, size of *first )
122  Do
122  When 0 cycle
122  __val
122  })
122  }))
122  ____ptr ? ({
122  __mptr = ____ptr
122  Do
122  When 0 cycle
122  __mptr - __builtin_offsetof(typeof( * ((p))), pid_links[PIDTYPE_PGID])
122  }) : NULL
122  cycle (({}), (p) = ({});(p);(p) = ({
122  typeof(({typeof(( * ((struct hlist_node * * )( & ( & ((p))->pid_links[PIDTYPE_PGID])->next))))________p1 = ({union{typeof(( * ((struct hlist_node * * )( & ( & ((p))->pid_links[PIDTYPE_PGID])->next))))__val;char __c[1];}__u;if (1)__read_once_size( & (( * ((struct hlist_node * * )( & ( & ((p))->pid_links[PIDTYPE_PGID])->next)))), __u.__c, sizeof(( * ((struct hlist_node * * )( & ( & ((p))->pid_links[PIDTYPE_PGID])->next)))));Else  __read_once_size_nocheck( & (( * ((struct hlist_node * * )( & ( & ((p))->pid_links[PIDTYPE_PGID])->next)))), __u.__c, sizeof(( * ((struct hlist_node * * )( & ( & ((p))->pid_links[PIDTYPE_PGID])->next)))));Do{}while (0);__u.__val;});((typeof( * ( * ((struct hlist_node * * )( & ( & ((p))->pid_links[PIDTYPE_PGID])->next)))) * )(________p1));}))____ptr = (({
122  typeof(( * ((struct hlist_node * * )( & ( & ((p))->pid_links[PIDTYPE_PGID])->next))))________p1 = ({
122  union{typeof(( * ((structhlist_node * * )( & next)))) __val;char __c[1];}__u
122  If 1 Then __read_once_size( & (( * ((structhlist_node * * )( & next)))), __c, size of *next )
122  Else __read_once_size_nocheck( & (( * ((structhlist_node * * )( & next)))), __c, size of *next )
122  Do
122  When 0 cycle
122  __val
122  })
122  }))
122  ____ptr ? ({
122  __mptr = ____ptr
122  Do
122  When 0 cycle
122  __mptr - __builtin_offsetof(typeof( * ((p))), pid_links[PIDTYPE_PGID])
122  }) : NULL
122  }))
122  tg___ = p
122  cycle (({cycle (({}), p = ({
122  void * __mptr = (void * )(({
122  union{typeof(next__val;char __c[1];}__u
122  If 1 Then __read_once_size( & (next), __c, size of next )
122  Else __read_once_size_nocheck( & (next), __c, size of next )
122  Do
122  When 0 cycle
122  __val
122  }))
122  Do
122  When 0 cycle
122  __mptr - __builtin_offsetof(typeof( * p), thread_node)
122  cycle (({}), p = ({}); & p->thread_node != ( & ((tg___)->signal)->thread_head);p = ({
122  void * __mptr = (void * )(({
122  union{typeof(next__val;char __c[1];}__u
122  If 1 Then __read_once_size( & (next), __c, size of next )
122  Else __read_once_size_nocheck( & (next), __c, size of next )
122  Do
122  When 0 cycle
122  __val
122  }))
122  Do
122  When 0 cycle
122  __mptr - __builtin_offsetof(typeof( * p), thread_node)
122  }))
124  If ret Then Break
126  p = tg___
126  If PIDTYPE_PGID == PIDTYPE_PID Then Break
126  When 0 cycle
127  Break
128  Case which == IOPRIO_WHO_USER
129  uid = make_kuid(current_user_ns(), who)
130  If Not uid_valid(uid) Then Break
132  If Not who Then user = current_user()
134  Else user = Locate the user_struct for the passed UID. If found, take a ref on it. The* caller must undo that ref with free_uid().* If the user_struct could not be found, return NULL.
137  If Not user Then Break
141  If Not uid_eq(task_uid(p), uid) || Not task_pid_vnr(p) Then Continue
145  If ret Then Go to free_uid
148  free_uid :
149  If who Then free_uid(user)
151  Break
152  Default
153  ret = -EINVAL
156  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
157  Return ret