Re: [PATCH v1] sysfs: fix sysfs_kf_seq_show null pointer dereference

From: Greg Kroah-Hartman
Date: Wed Jun 15 2022 - 03:41:05 EST


On Tue, Jun 14, 2022 at 11:38:27AM -0700, Will McVicker wrote:
> On Tue, Jun 14, 2022 at 10:31 AM Greg Kroah-Hartman <
> gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
> >
> > On Tue, Jun 14, 2022 at 05:24:01PM +0000, Will McVicker wrote:
> > > When the kobj->ktype is null,
> >
> > How can that happen? What in-tree code does that?
>
> This kernel panic happens randomly for me. The call trace shows that this
> happens when the read syscall is invoked by Android. GDB gave me this line
> when disassembling __arm64_sys_read+0x20/0x30:
>
> fs/read_write.c:628
> SYSCALL_DEFINE3(read, unsigned int, fd, char __user *, buf, size_t, count)

What sysfs file is it reading? Any hint about that?

thanks,

greg k-h