[lkml]   [2003]   [May]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: The disappearing sys_call_table export.
arjanv wrote:

> examle: pseudocode for the unlink syscall
> long your_wrapped_syscall(char *userfilename)
> {
> char kernelpointer[something];
> copy_from_user(kernelpointer, usefilename, ...);
> audit_log(kernelpointer);
> return original_syscall(userfilename);
> }

That code has another hole that nobody else has mentioned
yet: I can fill the audit log by trying to delete nonexistent files,
and if accused of trying to mount a DOS attack on the audit trail
I can reasonably claim that it was all an accident...

How about:

long wrapped_unlink(char *userfilename)
char name1[len], name2[len];
long ret;

copy_from_user(name1, userfilename, ...);
ret = original_unlink(userfilename);
copy_from_user(name2, userfilename, ...);

if (strncmp(name1, name2, len))
audit_log(name1, name2, UNLINK_NAME_CHANGED);
if (ret == 0 && AUDIT_SUCCESS)
audit_log(name1, name2, UNLINK_SUCCEEDED);
if (ret == -EPERM && AUDIT_FAILURE)
audit_log(name1, name2, UNLINK_FAILED);

return ret;
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

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