how to deny reading of several sysctls (for a set of uids, f.e.)
- From: "Andrew N. Below" <defan@xxxxxxxxx>
- Date: Tue, 23 Jan 2007 14:44:01 +0300
Hello.
System - RELENG_6.
Easiest way I found is to patch libc.
But in this case we still can get an original library and use
LD_PRELOAD.
Is there any way to obtain uid of calling process (thread?)
within the kernel?
We have following extern in src/lib/libc/gen/sysctl.c:
[..]
extern int __sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp,
void *newp, size_t newlen);
[..]
And there is __sysctl (src/sys/kern/kern_sysctl.c):
[..]
/*
* MPSAFE
*/
int
__sysctl(struct thread *td, struct sysctl_args *uap)
[..]
1. Whether this function is called from libc sysctl() ?
2. What can we get from td here? My knowledge about FreeBSD kernel
and kernel threads is not yet enough for understanding this.
I also thought about passing control variable from libc
to kernel, but it seems to be bad idea.
Any other ways?
--
Andrew N. Below
_______________________________________________
freebsd-hackers@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"
- Follow-Ups:
- Re: how to deny reading of several sysctls (for a set of uids, f.e.)
- From: Andrey V. Elsukov
- Re: how to deny reading of several sysctls (for a set of uids, f.e.)
- From: Max Laier
- Re: how to deny reading of several sysctls (for a set of uids, f.e.)
- Prev by Date: Re: ipw3945 assistance?
- Next by Date: Re: how to deny reading of several sysctls (for a set of uids, f.e.)
- Previous by thread: MSI
- Next by thread: Re: how to deny reading of several sysctls (for a set of uids, f.e.)
- Index(es):
Relevant Pages
- Re: Why is GForth-ITC fast?
... This cost is quite dwarfed by the actual jump to the kernel land. ... Unix
syscalls have relatively few parameters and the Linux way, on ia32, ... In the Unix world,
the libc API is standard, at least at the source ... (comp.lang.forth) - Re: Why is GForth-ITC fast?
... In the Unix world, the libc API is standard, at least at the source ... The
Linux kernel has a rather good record at ... Application code which uses the libc API
automatically adapts to the new ... (comp.lang.forth) - Re: simple read char app return wrong value?
... so bash can read input meant for us, but we could also read input meant for bash i
suppose... ... linux kernel also wants posic compliance so it also implements the same
methods. ... the posix functions in libc just immidiately call the linux syscalls. ...
A C program that reads a file one character at a time with fgetcis much faster, because of this internal
buffering. ... (alt.lang.asm) - Re: Direct Linux syscalls
... > incompatibility rashes from the version changes. ... > code with the
static version of libc, ... rashes" to actually communicate with the kernel for
something to actually ... "verboten"...that decision is for the programmers using the tool
to make, ... (comp.os.linux.development.apps) - Re: microblaze syscall list
... Until very recently with the MMU support added to the CPU (and upcoming ...
is common to rebuild your entire userland and libs + kernel in one go. ... You will just
require a new libc build with a new kernel. ... It's more than just the syscall
numbers that should ideally change. ... (Linux-Kernel)