Source-Changes-D archive

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

Re: CVS commit: src/sys



> > I've tested with an i386 kernel.  I'd rather not make those changes  
> > conditional so I'll see if I can work out why the Atari kernel would  
> > have problems.  If no CTF section is found then ksyms should behave  
> > exactly as it did before the change, just with an empty CTF section.
> 
> Ok, I'll check what happens on initialization,
> but should it work even with old bootloaders?

It looks more sanity checks are required in ksyms_addsyms_elf().

---
#ifdef KDTRACE_HOOKS
        /* Find the CTF section */
        shdr = (Elf_Shdr *)((uint8_t *)start + ehdr->e_shoff);
        if (ehdr->e_shstrndx != 0) {
                char *shstr = (uint8_t*)start +
                                shdr[ehdr->e_shstrndx].sh_offset;
                for (i = 1; i < ehdr->e_shnum; i++) {
                        if (shdr[i].sh_type != SHT_PROGBITS)
                                continue;
                        if (strncmp(".SUNW_ctf", &shstr[shdr[i].sh_name] ,10) 
!= 0)
                                continue;
---

My atari kernel hangs in this strncmp().
shstr is 0x4c60f4 and it looks invalid because
kernel end is 0x277d48 and shdr is 0x277d7c.

(BTW, please also use KNF properly)
---
Izumi Tsutsui


Home | Main Index | Thread Index | Old Index