[pso] Kernel Panic

Buciuc Victor victor.buciuc at gmail.com
Thu Mar 20 22:20:47 EET 2008


Salut,

daca te uiti la calltrace vezi ca adresa care a generat se afla la label-ul
syscall_call.

daca te uiti ce se intampla la syscall_call:

blackwing:~# cd /usr/src/linux
blackwing:/usr/src/linux# gdb --quiet vmlinux
Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".
(gdb) disassemble syscall_call
Dump of assembler code for function syscall_call:
0xc0102d13 <syscall_call+0>:    call   *0xc0403384(,%eax,4)
0xc0102d1a <syscall_call+7>:    mov    %eax,0x18(%esp)
End of assembler dump.
(gdb) x 0xc0403384
0xc0403384 <sys_call_table>:    0xc0122ba0


vezi instructiunea call   *0xc0403384(,%eax,4) care este apelul catre
functia din syscall_table a apelului curent. Acum call-ul pune pe stiva
adresa de return syscall_call+7, care apare in stack_trace. So pointer-ul pe
care il pui in tabela de syscall e null.

Sau poate ma insel eu...

2008/3/20 Valentin - Adrian IONESCU <ionescuvalentinadrian at gmail.com>:

> Sunt sigur ca-l inlocuiesc ... in tabela de syscall ... si sunt sigur ca-l
> pun la loc.
>
>
>
> 2008/3/20 Buciuc Victor <victor.buciuc at gmail.com>:
>
> > Esti sigur ca inlocuiesti corect apelul interceptat in tabela de
> > syscall?
> >
> >
> > 2008/3/20 Valentin - Adrian IONESCU <ionescuvalentinadrian at gmail.com>:
> >
> > > Salut.
> > >
> > > Acest kernel panic apare la rularea testului oficial de pe site.
> > > Rezultatele testului pana in momentul in care se blockeaza mai jos...
> > >
> > > test: insmod
> > > sci.ko...............................................passed
> > > test: bad MY_SYSCALL
> > > args.........................................passed
> > > test: 0
> > > intercept.................................................passed
> > > test: 0
> > > release...................................................passed
> > > test: 5
> > > intercept.................................................passed
> > > test: 5
> > > intercept.................................................passed
> > >
> > > In acest moment se blocheaza ....
> > >
> > >
> > > VALENTIN
> > >
> > > 2008/3/20 Buciuc Victor <victor.buciuc at gmail.com>:
> > >
> > > > Ai putea sa detaiezi putin? Cand iti apare?
> > > >
> > > > 2008/3/20 Valentin - Adrian IONESCU <ionescuvalentinadrian at gmail.com
> > > > >:
> > > >
> > > > Salut.
> > > > > Nu. Nu am interceptat execve ....
> > > > >
> > > > > VALENTIN
> > > > >
> > > > > 2008/3/20 Buciuc Victor <victor.buciuc at gmail.com>:
> > > > >
> > > > > Ai interceptat cumva apelul execve?
> > > > > >
> > > > > > 2008/3/20 Lucian Adrian Grijincu <lucian.grijincu at gmail.com>:
> > > > > >
> > > > > > On Thu, Mar 20, 2008 at 7:18 PM, Valentin - Adrian IONESCU
> > > > > > > <ionescuvalentinadrian at gmail.com> wrote:
> > > > > > > > [<c0102d1a>]  syscall_call+0x7/0xb
> > > > > > > >  ================================
> > > > > > > > Code:  Bad EIP value.
> > > > > > > > EIP:  [<00000000>]  0x0  SS:ESP 0068:ce3e1f48
> > > > > > >
> > > > > > > EIP a ajuns 0, poate faci un salt catre NULL?
> > > > > > > presupun că ai un pointer la functie pf căruia îi dai o
> > > > > > > valoare și dup-aia faci
> > > > > > > pf();
> > > > > > > daca pf=NULL, după instrucțiunea "call value_of_pf" EIP-ul va
> > > > > > > deveni 0.
> > > > > > > Prima pagină de memorie nu are drepturi de citire sau scriere,
> > > > > > > așa că
> > > > > > > procesorul va semnala o eroare.
> > > > > > >
> > > > > > >
> > > > > > > Altă variantă: modifici din struct pr_regs valoarea lui EIP și
> > > > > > > când
> > > > > > > kernelul vrea să se întoarcă in userspace, se întoarce la
> > > > > > > adresa NULL.
> > > > > > >
> > > > > > > sau desigur e altă eroare :)
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > Lucian
> > > > > > > _______________________________________________
> > > > > > > pso mailing list
> > > > > > > pso at cursuri.cs.pub.ro
> > > > > > > http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/pso
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Victor Buciuc
> > > > > > _______________________________________________
> > > > > > pso mailing list
> > > > > > pso at cursuri.cs.pub.ro
> > > > > > http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/pso
> > > > > >
> > > > > >
> > > > >
> > > > > _______________________________________________
> > > > > pso mailing list
> > > > > pso at cursuri.cs.pub.ro
> > > > > http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/pso
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > Victor Buciuc
> > > > _______________________________________________
> > > > pso mailing list
> > > > pso at cursuri.cs.pub.ro
> > > > http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/pso
> > > >
> > > >
> > >
> > > _______________________________________________
> > > pso mailing list
> > > pso at cursuri.cs.pub.ro
> > > http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/pso
> > >
> > >
> >
> >
> > --
> > Victor Buciuc
> >
> > _______________________________________________
> > pso mailing list
> > pso at cursuri.cs.pub.ro
> > http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/pso
> >
> >
>
> _______________________________________________
> pso mailing list
> pso at cursuri.cs.pub.ro
> http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/pso
>
>


-- 
Victor Buciuc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cursuri.cs.pub.ro/pipermail/pso/attachments/20080320/a976651c/attachment.htm 


More information about the pso mailing list