File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -227,6 +227,7 @@ static int __init init_percpu_var(void)
227
227
"module param, aborting ...\n" , KBUILD_MODNAME );
228
228
return ret ;
229
229
}
230
+ // set up the function pointer
230
231
schedsa_ptr = (unsigned long (* )(pid_t pid , const struct cpumask * in_mask ))func_ptr ;
231
232
232
233
/* Dynamically allocate the percpu structures */
Original file line number Diff line number Diff line change 10
10
# what you do is only limited by your imagination :).
11
11
# b) From 5.7 on, the kernel devs unexported the kallsyms_lookup_name()!
12
12
# (Rationale: https://lwn.net/Articles/813350/). With it gone, we now
13
- # simply use this approach: a helper script greps the kallsyms_lookup_name()
14
- # address and passes it to the module! There, we equate it to the exepcted
15
- # function signature - that of sched_setaffinity() - and use it.
16
- # *Not* pedantically right, but hey, it works. Don't do this in production.
13
+ # simply use this approach: a helper script greps the sched_setaffinity()
14
+ # function's address and passes it to the module! There, we equate it to the
15
+ # exepected function signature and use it.
16
+ # NOTE!
17
+ # a) This latter 5.7+ approach is *Not* pedantically right, but hey, it works.
18
+ # Don't do this in production.
19
+ # b) It works on a typical desktop-type distro... it likely won't on a locked-down
20
+ # and properly security-conscious installation.
17
21
#
18
22
KMOD=percpu_var
19
23
KFUNC=sched_setaffinity
@@ -22,7 +26,7 @@ KFUNC_PTR=0x$(sudo grep -w "T ${KFUNC}" /proc/kallsyms |awk '{print $1}')
22
26
echo " ${name} : lookup of kallsyms_lookup_name() failed, aborting..."
23
27
exit 1
24
28
}
25
- echo " KFUNC_PTR=${KFUNC_PTR} "
29
+ echo " sched_setaffinity(): KFUNC_PTR=${KFUNC_PTR} "
26
30
27
31
make clean
28
32
make
You can’t perform that action at this time.
0 commit comments