On Thu, Apr 7, 2011 at 10:29, Andreas Schwab <sch...@linux-m68k.org> wrote:
> Geert Uytterhoeven <ge...@linux-m68k.org> writes:
>> Isn't there a reason it was read-write on m68k, like the table may be changed
>> at runtime (to install rootkits :-)? Have to check what the other arches 
>> do...
>
> Initially the syscall_table in Linux has always been writable, bb152f53
> ("x86/x86_64: mark rodata section read-only: make some datastructures
> const") made it read-only on x86.  Apparently nobody bothered to do the
> equivalent change on m68k (I don't think anything makes the kernel text
> segment write protected anyway).

11 arches still store it in "data", including the 4 using the new
asm-generic/unistd.h
framework. 9 use "rodata" and 6 use "text".
The constness of C "extern" declarations doesn't necessarily matches the
actual sections.

alpha:          .data
arm:            presumably .text?
avr32:          .section .rodata,"a",@progbits
blackfin:       .section .l1.data / .data
cris:           .section .rodata,"a"
frv:            .section .rodata
h8300:          .section .text
ia64:           .rodata
                extern unsigned long sys_call_table[NR_syscalls];
m32r:           .section .rodata,"a"
m68k:           .data (mmu), .text (nommu)
m68knommu:      .text
microblaze:     .section .rodata,"a"
mips:           presumably .text?
mn10300:        .data
                extern const unsigned long sys_call_table[];
parisc:         .section .rodata,"a"
powerpc:        presumably .text?
                extern unsigned long *sys_call_table;
                static void *spu_syscall_table[] (SPU in CBEA)
s390:           .section .rodata, "a"
                extern const unsigned int sys_call_table[];
score:          void *sys_call_table[__NR_syscalls[] = { ... }
sh:             .data
                extern const unsigned long sys_call_table[];
sh64:           .section .data, "aw"
sparc:          .data
                extern const unsigned int sys_call_table[];
sparc64:        .text
tile:           void *sys_call_table[__NR_syscalls] = { ... }
                void *compat_sys_call_table[__NR_syscalls] = { ... }
um:             extern syscall_handler_t *sys_call_table[];
unicore32:      void *sys_call_table[__NR_syscalls] = { ... }
x86:            .section .rodata,"a"
                extern const unsigned long sys_call_table[];
                const sys_call_ptr_t
sys_call_table[__NR_syscall_max+1] = { ...  }
xtensa:         syscall_t sys_call_table[__NR_syscall_count] = { ... }

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to