lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <4506A295.6010206@gmail.com>
Date:	Tue, 12 Sep 2006 14:05:41 +0200
From:	guest01 <guest01@...il.com>
To:	linux-kernel@...r.kernel.org
Subject: OT: calling kernel syscall manually

Hi

Sorry guys, this question is a little bit off topic, but maybe someone
has an answer, I am sure that there is a simple one. :-)

Ok, I have to find 3 possibilities to create a directory with 3 small c
programs:
1 -> using libc: mkdir(dir,mode)
2 -> using libcsyscall:  syscall(__NR_mkdir, "mkdirLibcSyscall", 0777);
3 -> using kernel directly

Ok, the third one is a little bit tricky, at least for me. I found an
example for lseek, but I don't know how to convert that for mkdir. I
don't know the necessary arguments, ..

> #include <linux/unistd.h>
> 
> _syscall5(int, _llseek, unsigned int, fd,
>           unsigned long, offset_high, unsigned long, offset_low,
>           long long *, result, unsigned int, origin)
> 
> long long
> my_llseek(unsigned int fd, unsigned long long offset, unsigned int origin) {
>           long long result;
>           int retval;
> 
>           retval = _llseek (fd, offset >> 32, offset & 0xffffffff,
>                             &result, origin);
>           return (retval == -1) ? -1 : result;
> }

Any help would be much appreciated. Thxs

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ