mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Implement new system call in 2.6
@ 2004-02-25 10:07 Kristian Sørensen
  2004-02-25 11:14 ` Kristian Sørensen
  2004-02-25 18:14 ` Randy.Dunlap
  0 siblings, 2 replies; 5+ messages in thread
From: Kristian Sørensen @ 2004-02-25 10:07 UTC (permalink / raw)
  To: linux-kernel; +Cc: umbrella

Hi all!

How do I invoke a newly created system call in the 2.6.3 kernel from
userspace?

The call is added it arch/i386/kernel/entry.S and include/asm/unistd.h
and the call is implemented in a security module called Umbrella(*).

The kernel compiles and boots nicely.

The main problem is now to compile a userspace program that invokes this
call. The guide for implementing the systemcall at
http://fossil.wpi.edu/docs/howto_add_systemcall.html
has been followed, which yields the following userspace program:

// test.h
#include "/home/snc/linux-2.6.3-umbrella/include/linux/unistd.h"
_syscall1(int, umbrella_scr, int, arg1);

// test.c
#include "test.h"
main() {
  int test = umbrella_scr(1);
  printf ("%i\n", test);
}

When compiling:

gcc -I/home/snc/linux-2.6.3/include test.c

/tmp/ccYYs1zB.o(.text+0x20): In function `umbrella_scr':
: undefined reference to `errno'
collect2: ld returned 1 exit status


It seems like a little stupid error :-( Does some of you have a solution?



Thanks in advance and best regards,
Kristian Sørensen.



(*) Umbrella is a security project for securing handheld devices. Umbrella
for implements a combination of process based mandatory access control
(MAC) and authentication of files. This is implemented on top of the Linux
Security Modules framework. The MAC scheme is enforced by a set of
restrictions for each process.
More information on http://umbrella.sf.net


-- 
Kristian Sørensen <ks@cs.auc.dk>

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

* Re: Implement new system call in 2.6
  2004-02-25 10:07 Implement new system call in 2.6 Kristian Sørensen
@ 2004-02-25 11:14 ` Kristian Sørensen
  2004-02-25 18:14 ` Randy.Dunlap
  1 sibling, 0 replies; 5+ messages in thread
From: Kristian Sørensen @ 2004-02-25 11:14 UTC (permalink / raw)
  To: linux-kernel; +Cc: umbrella

PS. including <errno.h> in test.c doesn't solve the problem :-(

-- 
Kristian Sørensen <ks@cs.auc.dk>

On Wed, 25 Feb 2004, Kristian Sørensen wrote:

> Hi all!
>
> How do I invoke a newly created system call in the 2.6.3 kernel from
> userspace?
>
> The call is added it arch/i386/kernel/entry.S and include/asm/unistd.h
> and the call is implemented in a security module called Umbrella(*).
>
> The kernel compiles and boots nicely.
>
> The main problem is now to compile a userspace program that invokes this
> call. The guide for implementing the systemcall at
> http://fossil.wpi.edu/docs/howto_add_systemcall.html
> has been followed, which yields the following userspace program:
>
> // test.h
> #include "/home/snc/linux-2.6.3-umbrella/include/linux/unistd.h"
> _syscall1(int, umbrella_scr, int, arg1);
>
> // test.c
> #include "test.h"
> main() {
>   int test = umbrella_scr(1);
>   printf ("%i\n", test);
> }
>
> When compiling:
>
> gcc -I/home/snc/linux-2.6.3/include test.c
>
> /tmp/ccYYs1zB.o(.text+0x20): In function `umbrella_scr':
> : undefined reference to `errno'
> collect2: ld returned 1 exit status
>
>
> It seems like a little stupid error :-( Does some of you have a solution?
>
>
>
> Thanks in advance and best regards,
> Kristian Sørensen.
>
>
>
> (*) Umbrella is a security project for securing handheld devices. Umbrella
> for implements a combination of process based mandatory access control
> (MAC) and authentication of files. This is implemented on top of the Linux
> Security Modules framework. The MAC scheme is enforced by a set of
> restrictions for each process.
> More information on http://umbrella.sf.net
>
>
>

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

* Re: Implement new system call in 2.6
  2004-02-25 10:07 Implement new system call in 2.6 Kristian Sørensen
  2004-02-25 11:14 ` Kristian Sørensen
@ 2004-02-25 18:14 ` Randy.Dunlap
  2004-02-25 18:41   ` Richard B. Johnson
  2004-02-26 15:56   ` Kristian Soerensen
  1 sibling, 2 replies; 5+ messages in thread
From: Randy.Dunlap @ 2004-02-25 18:14 UTC (permalink / raw)
  To: Kristian Sørensen; +Cc: linux-kernel, umbrella

On Wed, 25 Feb 2004 11:07:41 +0100 (CET) Kristian Sørensen wrote:

| Hi all!
| 
| How do I invoke a newly created system call in the 2.6.3 kernel from
| userspace?
| 
| The call is added it arch/i386/kernel/entry.S and include/asm/unistd.h
| and the call is implemented in a security module called Umbrella(*).
| 
| The kernel compiles and boots nicely.
| 
| The main problem is now to compile a userspace program that invokes this
| call. The guide for implementing the systemcall at
| http://fossil.wpi.edu/docs/howto_add_systemcall.html
| has been followed, which yields the following userspace program:
| 
| // test.h
| #include "/home/snc/linux-2.6.3-umbrella/include/linux/unistd.h"
| _syscall1(int, umbrella_scr, int, arg1);
| 
| // test.c
| #include "test.h"
| main() {
|   int test = umbrella_scr(1);
|   printf ("%i\n", test);
| }
| 
| When compiling:
| 
| gcc -I/home/snc/linux-2.6.3/include test.c
| 
| /tmp/ccYYs1zB.o(.text+0x20): In function `umbrella_scr':
| : undefined reference to `errno'
| collect2: ld returned 1 exit status
| 
| 
| It seems like a little stupid error :-( Does some of you have a solution?
| 
Hm, it builds for me with no errors.
I'm using gcc version 3.2.  Maybe it's a tools issue.

| 
| (*) Umbrella is a security project for securing handheld devices. Umbrella
| for implements a combination of process based mandatory access control
| (MAC) and authentication of files. This is implemented on top of the Linux
| Security Modules framework. The MAC scheme is enforced by a set of
| restrictions for each process.
| More information on http://umbrella.sf.net


--
~Randy

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

* Re: Implement new system call in 2.6
  2004-02-25 18:14 ` Randy.Dunlap
@ 2004-02-25 18:41   ` Richard B. Johnson
  2004-02-26 15:56   ` Kristian Soerensen
  1 sibling, 0 replies; 5+ messages in thread
From: Richard B. Johnson @ 2004-02-25 18:41 UTC (permalink / raw)
  To: Randy.Dunlap; +Cc: Kristian Sørensen, linux-kernel, umbrella

On Wed, 25 Feb 2004, Randy.Dunlap wrote:

> On Wed, 25 Feb 2004 11:07:41 +0100 (CET) Kristian Sørensen wrote:
>
> | Hi all!
> |
> | How do I invoke a newly created system call in the 2.6.3 kernel from
> | userspace?
> |
> | The call is added it arch/i386/kernel/entry.S and include/asm/unistd.h
> | and the call is implemented in a security module called Umbrella(*).
> |
> | The kernel compiles and boots nicely.
> |
> | The main problem is now to compile a userspace program that invokes this
> | call. The guide for implementing the systemcall at
> | http://fossil.wpi.edu/docs/howto_add_systemcall.html
> | has been followed, which yields the following userspace program:
> |
> | // test.h
> | #include "/home/snc/linux-2.6.3-umbrella/include/linux/unistd.h"
> | _syscall1(int, umbrella_scr, int, arg1);
> |
> | // test.c
> | #include "test.h"
> | main() {
> |   int test = umbrella_scr(1);
> |   printf ("%i\n", test);
> | }
> |
> | When compiling:
> |
> | gcc -I/home/snc/linux-2.6.3/include test.c
> |
> | /tmp/ccYYs1zB.o(.text+0x20): In function `umbrella_scr':
> | : undefined reference to `errno'
> | collect2: ld returned 1 exit status
> |

#include <errno.h>

Some versions of 'C' define errno as *__errno_location().


Cheers,
Dick Johnson
Penguin : Linux version 2.4.24 on an i686 machine (797.90 BogoMips).
            Note 96.31% of all statistics are fiction.



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

* Re: Implement new system call in 2.6
  2004-02-25 18:14 ` Randy.Dunlap
  2004-02-25 18:41   ` Richard B. Johnson
@ 2004-02-26 15:56   ` Kristian Soerensen
  1 sibling, 0 replies; 5+ messages in thread
From: Kristian Soerensen @ 2004-02-26 15:56 UTC (permalink / raw)
  To: Randy.Dunlap; +Cc: linux-kernel, umbrella

Hi again!

Thanks for your rapid answers! We finally got it working now ;-)

Cheers, KS.

On Wed, 2004-02-25 at 19:14, Randy.Dunlap wrote:
> On Wed, 25 Feb 2004 11:07:41 +0100 (CET) Kristian Sørensen wrote:
> 
> | Hi all!
> | 
> | How do I invoke a newly created system call in the 2.6.3 kernel from
> | userspace?
> | 
> | The call is added it arch/i386/kernel/entry.S and include/asm/unistd.h
> | and the call is implemented in a security module called Umbrella(*).
> | 
> | The kernel compiles and boots nicely.
> | 
> | The main problem is now to compile a userspace program that invokes this
> | call. The guide for implementing the systemcall at
> | http://fossil.wpi.edu/docs/howto_add_systemcall.html
> | has been followed, which yields the following userspace program:
> | 
> | // test.h
> | #include "/home/snc/linux-2.6.3-umbrella/include/linux/unistd.h"
> | _syscall1(int, umbrella_scr, int, arg1);
> | 
> | // test.c
> | #include "test.h"
> | main() {
> |   int test = umbrella_scr(1);
> |   printf ("%i\n", test);
> | }
> | 
> | When compiling:
> | 
> | gcc -I/home/snc/linux-2.6.3/include test.c
> | 
> | /tmp/ccYYs1zB.o(.text+0x20): In function `umbrella_scr':
> | : undefined reference to `errno'
> | collect2: ld returned 1 exit status
> | 
> | 
> | It seems like a little stupid error :-( Does some of you have a solution?
> | 
> Hm, it builds for me with no errors.
> I'm using gcc version 3.2.  Maybe it's a tools issue.
> 
> | 
> | (*) Umbrella is a security project for securing handheld devices. Umbrella
> | for implements a combination of process based mandatory access control
> | (MAC) and authentication of files. This is implemented on top of the Linux
> | Security Modules framework. The MAC scheme is enforced by a set of
> | restrictions for each process.
> | More information on http://umbrella.sf.net
> 
> 
> --
> ~Randy
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/


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

end of thread, other threads:[~2004-02-26 15:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-25 10:07 Implement new system call in 2.6 Kristian Sørensen
2004-02-25 11:14 ` Kristian Sørensen
2004-02-25 18:14 ` Randy.Dunlap
2004-02-25 18:41   ` Richard B. Johnson
2004-02-26 15:56   ` Kristian Soerensen

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

all inboxes | Powered by JetHome®