lkml.org 
[lkml]   [2008]   [Dec]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/15] don't reallocate buffer in every audit_sockaddr()
On Tue, Dec 16, 2008 at 11:49:27PM -0800, Andrew Morton wrote:
> > + if (!context->sockaddr) {
> > + void *p = kmalloc(sizeof(struct sockaddr_storage), GFP_KERNEL);
>
> argh, I really hate having to run all around the code verifying that
> the type passed to sizeof matches the type that we'll be storing there :(

And I really hate being unable to find the places doing such allocations
without serious parsing. Matter of taste.

> stoopid question: can an audit_contect be shared between
> threads/processes? If so, is locking needed around the read/test/write
> of context->sockaddr and friends?

It can't. And that's very fortunate, since otherwise all that crap would
a) be horribly racy
b) require shitloads of locking all over the place, driving the
overhead even higher.


\
 
 \ /
  Last update: 2008-12-17 08:59    [W:0.054 / U:0.384 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site