linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: Size of pointers in sys_call_table?
       [not found] ` <E15blYK-0006Fb-00@the-village.bc.nu.suse.lists.linux.kernel>
@ 2001-08-28 16:54   ` Andi Kleen
  2001-08-29  1:00     ` Keith Owens
  0 siblings, 1 reply; 8+ messages in thread
From: Andi Kleen @ 2001-08-28 16:54 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-kernel, bgerst, haba

Alan Cox <alan@lxorguk.ukuu.org.uk> writes:

> > The layout of the sys_call_table is totally architecture dependant.  The
> > question to ask here is why do you need to use it?  Modifying it to hook
> > into syscalls is frowned upon.
> 
> And potentially unsafe (think about caching, and non atomic writes on
> some platforms)

It is ATM impossible to make a module that patches sys_call_table safe against
module unload races. The only way is to put a stub into the main kernel
that manages the module counters and calls a separate hook (i.e. as done 
by nfsd's syscall) 

[Introducing quiescent states in module unloading would probably fix that,
as it has been discussed for a long time now, but I lost hope that it'll ever
get implemented in the main kernel]

Other than that on some weird architectures like IA64 it can get quite 
complicated to patch the syscall table.

-Andi


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

* Re: Size of pointers in sys_call_table?
  2001-08-28 16:54   ` Size of pointers in sys_call_table? Andi Kleen
@ 2001-08-29  1:00     ` Keith Owens
  0 siblings, 0 replies; 8+ messages in thread
From: Keith Owens @ 2001-08-29  1:00 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Alan Cox, linux-kernel, bgerst, haba

On 28 Aug 2001 18:54:06 +0200, 
Andi Kleen <ak@suse.de> wrote:
>[Introducing quiescent states in module unloading would probably fix that,
>as it has been discussed for a long time now, but I lost hope that it'll ever
>get implemented in the main kernel]

It will, in 2.5.


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

* Re: Size of pointers in sys_call_table?
  2001-08-28 16:17   ` Alan Cox
  2001-08-29  0:49     ` Keith Owens
@ 2001-08-29 23:26     ` Ralf Baechle
  1 sibling, 0 replies; 8+ messages in thread
From: Ralf Baechle @ 2001-08-29 23:26 UTC (permalink / raw)
  To: Alan Cox; +Cc: Brian Gerst, Harald Barth, linux-kernel

On Tue, Aug 28, 2001 at 05:17:24PM +0100, Alan Cox wrote:

> > The layout of the sys_call_table is totally architecture dependant.  The
> > question to ask here is why do you need to use it?  Modifying it to hook
> > into syscalls is frowned upon.
> 
> And potentially unsafe (think about caching, and non atomic writes on
> some platforms)

Breakage practically guaranteed on MIPS systems where additional information
beyond the pointer is associated with a syscall entry point.  Breakage also
guaranteed on ccNUMA systems that run per-node copies of the kernel.

  Ralf

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

* Re: Size of pointers in sys_call_table?
  2001-08-28 16:17   ` Alan Cox
@ 2001-08-29  0:49     ` Keith Owens
  2001-08-29 23:26     ` Ralf Baechle
  1 sibling, 0 replies; 8+ messages in thread
From: Keith Owens @ 2001-08-29  0:49 UTC (permalink / raw)
  To: Harald Barth, linux-kernel

On Tue, 28 Aug 2001 17:17:24 +0100 (BST), 
Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
>> The layout of the sys_call_table is totally architecture dependant.  The
>> question to ask here is why do you need to use it?  Modifying it to hook
>> into syscalls is frowned upon.
>
>And potentially unsafe (think about caching, and non atomic writes on
>some platforms)

Not forgetting architectures like PPC64 and IA64 that require a
different function pointer format when syscall code is in a module.  A
simple replacement of a pointer in the syscall table will not work on
those architectures.


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

* Re: Size of pointers in sys_call_table?
  2001-08-28 13:26 ` Brian Gerst
  2001-08-28 14:30   ` Harald Barth
@ 2001-08-28 16:17   ` Alan Cox
  2001-08-29  0:49     ` Keith Owens
  2001-08-29 23:26     ` Ralf Baechle
  1 sibling, 2 replies; 8+ messages in thread
From: Alan Cox @ 2001-08-28 16:17 UTC (permalink / raw)
  To: Brian Gerst; +Cc: Harald Barth, linux-kernel

> The layout of the sys_call_table is totally architecture dependant.  The
> question to ask here is why do you need to use it?  Modifying it to hook
> into syscalls is frowned upon.

And potentially unsafe (think about caching, and non atomic writes on
some platforms)


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

* Re: Size of pointers in sys_call_table?
  2001-08-28 13:26 ` Brian Gerst
@ 2001-08-28 14:30   ` Harald Barth
  2001-08-28 16:17   ` Alan Cox
  1 sibling, 0 replies; 8+ messages in thread
From: Harald Barth @ 2001-08-28 14:30 UTC (permalink / raw)
  To: bgerst; +Cc: haba, linux-kernel

> The layout of the sys_call_table is totally architecture dependant.  The
> question to ask here is why do you need to use it?  Modifying it to hook
> into syscalls is frowned upon.

I want to set the "frowning upon" aside just for the moment and point
to the fact that the symbol actually is exported and in consequence
should be described by some data type. The data type may be "totally
architecture dependant".

I can join the frowning upon if we extend it to be about the export
of the sys_call_table in the first place, but there are no other means
to populate a syscall from a module, or have I missed something?

The different AFS implementations have used this for years.

Harald.

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

* Re: Size of pointers in sys_call_table?
  2001-08-28 12:53 Harald Barth
@ 2001-08-28 13:26 ` Brian Gerst
  2001-08-28 14:30   ` Harald Barth
  2001-08-28 16:17   ` Alan Cox
  0 siblings, 2 replies; 8+ messages in thread
From: Brian Gerst @ 2001-08-28 13:26 UTC (permalink / raw)
  To: Harald Barth, linux-kernel

Harald Barth wrote:
> 
> Most linux kernel ports export the sys_call_table symbol to be used in
> modules. I have not succeeded how to automatially figure out the size
> of a syscall pointer without inspecting the assembler for the
> architecture in question. Examples are mips and sparc64. Have I
> missed a syscall_t type available or shouldn't there be one?
> 
> Harald.

The layout of the sys_call_table is totally architecture dependant.  The
question to ask here is why do you need to use it?  Modifying it to hook
into syscalls is frowned upon.

--

				Brian Gerst

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

* Size of pointers in sys_call_table?
@ 2001-08-28 12:53 Harald Barth
  2001-08-28 13:26 ` Brian Gerst
  0 siblings, 1 reply; 8+ messages in thread
From: Harald Barth @ 2001-08-28 12:53 UTC (permalink / raw)
  To: linux-kernel


Most linux kernel ports export the sys_call_table symbol to be used in
modules. I have not succeeded how to automatially figure out the size
of a syscall pointer without inspecting the assembler for the
architecture in question. Examples are mips and sparc64. Have I
missed a syscall_t type available or shouldn't there be one?

Harald.

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

end of thread, other threads:[~2001-08-29 23:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <3B8B9C00.4842710D@didntduck.org.suse.lists.linux.kernel>
     [not found] ` <E15blYK-0006Fb-00@the-village.bc.nu.suse.lists.linux.kernel>
2001-08-28 16:54   ` Size of pointers in sys_call_table? Andi Kleen
2001-08-29  1:00     ` Keith Owens
2001-08-28 12:53 Harald Barth
2001-08-28 13:26 ` Brian Gerst
2001-08-28 14:30   ` Harald Barth
2001-08-28 16:17   ` Alan Cox
2001-08-29  0:49     ` Keith Owens
2001-08-29 23:26     ` Ralf Baechle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).