public inbox for linux-m68k@lists.linux-m68k.org
 help / color / mirror / Atom feed
* Writable sys_call_table (was: Re: [uClinux-dev] [PATCH] m68k: Merge mmu and non-mmu versions of sys_call_table)
@ 2011-04-13 18:05 Geert Uytterhoeven
  0 siblings, 0 replies; 9+ messages in thread
From: Geert Uytterhoeven @ 2011-04-13 18:05 UTC (permalink / raw)
  To: Andreas Schwab
  Cc: Greg Ungerer, Gavin Lambert, uClinux development list,
	Philippe De Muyter, Linux/m68k, linux-arch, Arnd Bergmann

On Thu, Apr 7, 2011 at 10:29, Andreas Schwab <schwab@linux-m68k.org> wrote:
> Geert Uytterhoeven <geert@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 -- geert@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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-04-19 15:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <BANLkTimbHgmUvisE7+TCkgthejNi_zdojQ@mail.gmail.com>
2011-04-18 14:49 ` Writable sys_call_table (was: Re: [uClinux-dev] [PATCH] m68k: Merge mmu and non-mmu versions of sys_call_table) Arnd Bergmann
2011-04-18 16:21   ` Andreas Schwab
2011-04-19  7:48     ` Arnd Bergmann
2011-04-19  8:12       ` Finn Thain
2011-04-19 11:54         ` Andreas Schwab
     [not found]         ` <m2k4eqfocu.fsf@igel.home>
2011-04-19 12:16           ` Arnd Bergmann
2011-04-19 13:25             ` Andreas Schwab
2011-04-19 15:31           ` Finn Thain
2011-04-13 18:05 Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox