On 2020/11/16 21:35, Al Viro wrote: > On Mon, Nov 16, 2020 at 08:11:04PM +0900, Tetsuo Handa wrote: >> Hello. >> >> Below is a loadable kernel module which attempts to read (for example) /proc/interrupts from >> kernel using usermode driver interface. What is strange is that the total bytes obtained by >> doing "wc -c /proc/interrupts" from userspace's shell and trying to insmod this kernel module >> differs; for unknown reason, kernel_read() returns "#!/bin/cat /proc/interrupts\n" (28 bytes) >> at the end of input. > > Because /bin/cat writes it out ;-) You are right. ;-) I have an out of tree kernel module (a loadable kernel version of TOMOYO security module) which needs to read /proc/kallsyms from kernel (in order to find symbols needed by TOMOYO). Now that kernel_read() can no longer read /proc/kallsyms , I had to abuse usermode driver only for reading /proc/kallsyms ( https://osdn.net/projects/akari/scm/svn/commits/662 ).