Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys/kern



Hi,

On 2021/06/02 6:11, Taylor R Campbell wrote:
Module Name:	src
Committed By:	riastradh
Date:		Tue Jun  1 21:11:52 UTC 2021

Modified Files:
	src/sys/kern: kern_ksyms.c

Log Message:
ksyms(4): Don't skip symbol tables that are soon to be freed.

They will not actually be freed until /dev/ksyms is closed, so
continued access to them remains kosher.


To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.92 src/sys/kern/kern_ksyms.c
...
Index: src/sys/kern/kern_ksyms.c
diff -u src/sys/kern/kern_ksyms.c:1.91 src/sys/kern/kern_ksyms.c:1.92
--- src/sys/kern/kern_ksyms.c:1.91	Tue Jun  1 21:11:07 2021
+++ src/sys/kern/kern_ksyms.c	Tue Jun  1 21:11:52 2021
...
-	KASSERT(filepos <= sizeof(struct ksyms_hdr) +
+	KASSERT(filepos == sizeof(struct ksyms_hdr) +
	    ksyms_hdr.kh_shdr[SYMTAB].sh_size);
...

This KASSERT fires at least for arm and aarch64, with savecore or ``nm /dev/ksyms'':

$ nm /dev/ksyms
[ 1501.3538912] panic: kernel diagnostic assertion "filepos == sizeof(struct ksyms_hdr) + ksyms_hdr.kh_shdr[SYMTAB].sh_size" failed: file "../../../../kern/kern_ksyms.c", line 1107
[ 1501.3701109] cpu0: Begin traceback...
[ 1501.3701109] 0xc9c2ecfc: netbsd:db_panic+0xc
[ 1501.3806387] 0xc9c2ed14: netbsd:vpanic+0xc4
[ 1501.3806387] 0xc9c2ed2c: netbsd:kern_assert+0x3c
[ 1501.3906766] 0xc9c2ed6c: netbsd:ksymsread+0x208
[ 1501.4006964] 0xc9c2ee1c: netbsd:spec_read+0xbc
[ 1501.4112302] 0xc9c2ee44: netbsd:VOP_READ+0x58
[ 1501.4112302] 0xc9c2ee6c: netbsd:vn_read+0x78
[ 1501.4215160] 0xc9c2eebc: netbsd:dofileread+0x80
[ 1501.4315439] 0xc9c2eeec: netbsd:sys_read+0x50
[ 1501.4426847] 0xc9c2efac: netbsd:syscall+0x188
[ 1501.4426847] cpu0: End traceback...
Stopped in pid 11825.11825 (nm) at      netbsd:cpu_Debugger+0x4:        bx
r14
db>

Can you please take a look?

Thanks,
rin


Home | Main Index | Thread Index | Old Index