lkml.org 
[lkml]   [1999]   [Nov]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectQuestion about the function do_fork() and kernel_lock()
Date
Hi

I'm writing a kernel-extention in order to include an audit-mechanism into the
linux-kernel. The goal is to get an audit-mechnismus like bsm on a
solaris-system. In this moment I'm working on a filter, to reduce the mass of
audit-data. For this I have to set an entry in all tasks.

My problem is, that a fork can happen in this moment, when I set the entries
and I forget this new one. Ok this can only happen on a SMP-Machine. But the
problem exists and I can't ignore it. If I understand the kernel_lock()
function right, it is used to ensure that only one function is running and all
other proccessors wait for this time. That means either my set-function is
running or the fork.

Now my question. The do_fork() function locks the kernel after the copy of
current-task. Why after? Can I inverte it, that the kernel is locked before the
task is copied. In this case my function can't forget this new entry. Either it
isn't exist or it is in the task-queue and I get it with the for_each_task
macro.

Thanx for answer

--
Oliver Stecklina
<stecklina@secunet.de>


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

\
 
 \ /
  Last update: 2005-03-22 13:55    [W:0.033 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site