public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* adding a system call
@ 2001-01-09  0:49 Mihai Moise
  2001-01-09 14:56 ` David Woodhouse
  0 siblings, 1 reply; 5+ messages in thread
From: Mihai Moise @ 2001-01-09  0:49 UTC (permalink / raw)
  To: linux-kernel

Hello,

What is the procedure for adding a new system call to the Linux kernel?

Mihai
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

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

* Re: adding a system call
@ 2001-01-09 14:41 Mihai Moise
  2001-01-09 19:17 ` Doug McNaught
  0 siblings, 1 reply; 5+ messages in thread
From: Mihai Moise @ 2001-01-09 14:41 UTC (permalink / raw)
  To: linux-kernel


> > What is the procedure for adding a new system call to the Linux kernel?
> 
> hack away, the code's free.  don't expect Linus to accept your 
> changes into the "real" kernel without a VERY good argument.

I know. However the Kernel Hacker's Guide writes about sys.h. After a bit of exploring, I found that sys.h has been replaced by something else in later kernels, which leaves me wondering where in the kernel I should insert my code, and where the dispatcher is located for the other system calls, in case my system call would need them.

My system call idea is to allow a superuser process to request a mmap on behalf of an user process. To see how this would be useful, let us consider svgalib.

Until now, there were two ways to allow an application access to the video array. The first was by making it setuid root, but this compromises system security by allowing it too many permissions. The second was by having a helper module which allows user applications access to the video card. However this allows any remote user to set the screen in flames.

With my new system call, a superuser process can set the graphics mode in a safe manner and then ask for an mmap of the video array into the application data segment.

Mihai
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

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

* Re: adding a system call
  2001-01-09  0:49 adding a system call Mihai Moise
@ 2001-01-09 14:56 ` David Woodhouse
  0 siblings, 0 replies; 5+ messages in thread
From: David Woodhouse @ 2001-01-09 14:56 UTC (permalink / raw)
  To: Mihai Moise; +Cc: linux-kernel


mcartoaj@mat.ulaval.ca said:
>  What is the procedure for adding a new system call to the Linux
> kernel?

First: Convince people that it's necessary. 

--
dwmw2


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

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

* Re: adding a system call
  2001-01-09 14:41 Mihai Moise
@ 2001-01-09 19:17 ` Doug McNaught
  2001-01-09 19:34   ` Brian Pomerantz
  0 siblings, 1 reply; 5+ messages in thread
From: Doug McNaught @ 2001-01-09 19:17 UTC (permalink / raw)
  To: Mihai Moise; +Cc: linux-kernel

Mihai Moise <mcartoaj@mat.ulaval.ca> writes:

> My system call idea is to allow a superuser process to request a mmap on
> behalf of an user process. To see how this would be useful, let us consider
> svgalib.

[...]

> With my new system call, a superuser process can set the graphics mode in a
> safe manner and then ask for an mmap of the video array into the application
> data segment.

Ummm, couldn't the the root process open the video device, then pass
the file descriptor (via AF_UNIX socket) to the user process?  The
user process would then call mmap() on the open file descriptor. 

I'm not *completely* sure this would work, but it would avoid creating 
a new system call if so.

-Doug
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

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

* Re: adding a system call
  2001-01-09 19:17 ` Doug McNaught
@ 2001-01-09 19:34   ` Brian Pomerantz
  0 siblings, 0 replies; 5+ messages in thread
From: Brian Pomerantz @ 2001-01-09 19:34 UTC (permalink / raw)
  To: Mihai Moise; +Cc: Doug McNaught, linux-kernel

This can all be done with a device file and a corresponding module to
handle the mmap and any ioctl()'s you may want to support.  No need to
add another system call.


BAPper

On Tue, Jan 09, 2001 at 02:17:26PM -0500, Doug McNaught wrote:
> Mihai Moise <mcartoaj@mat.ulaval.ca> writes:
> 
> > My system call idea is to allow a superuser process to request a mmap on
> > behalf of an user process. To see how this would be useful, let us consider
> > svgalib.
> 
> [...]
> 
> > With my new system call, a superuser process can set the graphics mode in a
> > safe manner and then ask for an mmap of the video array into the application
> > data segment.
> 
> Ummm, couldn't the the root process open the video device, then pass
> the file descriptor (via AF_UNIX socket) to the user process?  The
> user process would then call mmap() on the open file descriptor. 
> 
> I'm not *completely* sure this would work, but it would avoid creating 
> a new system call if so.
> 
> -Doug
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> Please read the FAQ at http://www.tux.org/lkml/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

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

end of thread, other threads:[~2001-01-09 19:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-01-09  0:49 adding a system call Mihai Moise
2001-01-09 14:56 ` David Woodhouse
  -- strict thread matches above, loose matches on Subject: below --
2001-01-09 14:41 Mihai Moise
2001-01-09 19:17 ` Doug McNaught
2001-01-09 19:34   ` Brian Pomerantz

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