|
strncpy(midas_mmap_buf.entrys[i].tgid_name, task->comm, TASK_COMM_LEN); |
Please add a null check to task before strncpy!
Also if possible change strncpy to a safer function with respect to broader change in linux kernel.
Working code with no issues in sm8550:
https://github.com/OnePlusOSS/android_kernel_modules_and_devicetree_oneplus_sm8550/blob/7361170583ffa7cc9570c1678ae38ee37f4023cd/vendor/oplus/kernel/cpu/midas/v1_gki/midas_ioctl.c#L129
android_kernel_modules_and_devicetree_oneplus_sm8750/vendor/oplus/kernel/cpu/midas/v1_gki/midas_ioctl.c
Line 131 in 8148c21
Please add a null check to task before strncpy!
Also if possible change strncpy to a safer function with respect to broader change in linux kernel.
Working code with no issues in sm8550:
https://github.com/OnePlusOSS/android_kernel_modules_and_devicetree_oneplus_sm8550/blob/7361170583ffa7cc9570c1678ae38ee37f4023cd/vendor/oplus/kernel/cpu/midas/v1_gki/midas_ioctl.c#L129