Operating System - Tru64 Unix
1751974 Members
4371 Online
108784 Solutions
New Discussion

Re: System panic when add new syscall to sysent[]

 
Sung-Geun, Lee
Occasional Contributor

System panic when add new syscall to sysent[]

Hi, all.
I'm developing kernel module, which add new syscall to sysent[] and hooks some syscalls.

Environment is below.
- OS : Tru64 5.1B with TruCluster
- Model : GS320
- Memory : 20GB

when i try to load my kernel module, system panic.

In detail, Panic occured in write access to empty sysent slot.(sysent[186].sy_info)

Below is assembly code.
============================================
[register_new_syscall:471, 0xffffffff8016d2b0] ldah v0, -2(gp)
[register_new_syscall:471, 0xffffffff8016d2b4] ldah t4, -32743(zero)
[register_new_syscall:473, 0xffffffff8016d2b8] ldah t6, -32745(zero)
[register_new_syscall:471, 0xffffffff8016d2bc] lda v0, -2384(v0)
[register_new_syscall:471, 0xffffffff8016d2c0] lda t4, 15296(t4)
[register_new_syscall:473, 0xffffffff8016d2c4] lda t6, -3456(t6)
[register_new_syscall:475, 0xffffffff8016d2c8] ldl t3, 2984(v0)
[register_new_syscall:471, 0xffffffff8016d2cc] ldq t0, 2976(v0)
[register_new_syscall:471, 0xffffffff8016d2d0] ldq t1, 2984(v0)
[register_new_syscall:475, 0xffffffff8016d2d4] bic t3, 0xff, t3
[register_new_syscall:475, 0xffffffff8016d2d8] bis t3, 0x55, t3
[register_new_syscall:475, 0xffffffff8016d2dc] stl t3, 2984(v0) <== panic occured.
[register_new_syscall:471, 0xffffffff8016d2e0] stq t0, 0(t4)
[register_new_syscall:473, 0xffffffff8016d2e4] stq t6, 2976(v0)
[register_new_syscall:471, 0xffffffff8016d2e8] stq t1, 8(t4)
[register_new_syscall:479, 0xffffffff8016d2ec] ret at, (ra), 1

Below is register info.
=============================================
$vfp= 0xfffffe0a4da47780 $r0_v0=0xffffffff00805080
$r1_t0=0xffffffff003a90b0 $r2_t1=0x3030303030303010
$r3_t2=0xffffffff0002d8b0 $r4_t3=0x30303055
$r5_t4=0xffffffff80193bc0 $r6_t5=0xffffffff80180000
$r7_t6=0xffffffff8016f280 $r8_t7=0xffffffff80180000
$r9_s0=0xffffffff801814f4 $r10_s1=0xffffffff80180008
$r11_s2=0xfffffc4017afcb40 $r12_s3=0xfffffe0413d48b58
$r13_s4=0xfffffc4017afcb40 $r14_s5=0xfffffc4017afcb40
$r15_s6=0x0 $r16_a0=0xffffffff80180000
$r17_a1=0xffffffff80180000 $r18_a2=0xffffffff003177d0
$r19_a3=0xffffffff80180000 $r20_a4=0xffffffff80180000
$r21_a5=0xffffffff80180000 $r22_t8=0xffffffff0006c600
$r23_t9=0xffffffff00059230 $r24_t10=0xffffffff80180000
$r25_t11=0xffffffff80180000 $r26_ra=0xffffffff8016c258
$r27_t12=0xffffffff000d6690 $r28_at=0xffffffff801756e8
$r29_gp=0xffffffff008259d0 $r30_sp=0xfffffe0a4da47780

$r0_v0, $r4_t3, $r5_t4, $r7_t6 is valid.

This is my C code.
((struct sysent *)sysent)[SYS_newcall].sy_call = newcall; // function address
((struct sysent *)sysent)[SYS_newcall].sy_info = 0x55; // argument flag

I attached 'crashdc.out'.

Please let me know why panic occured and how to resolve this problem.
withggam
1 REPLY 1
Rob Leadbeater
Honored Contributor

Re: System panic when add new syscall to sysent[]

Hi,

I've no idea what's happening here, but you may get more help if you explain exactly what you're trying to achieve...

Cheers,

Rob