lkml.org 
[lkml]   [2008]   [Oct]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectSilly questions: how can those security_ops->foo(...) calls work when entries seem to be NULL?
Can someone point me to the explanation?

- the "register_security" just loads the pointer to "security_ops"

- most LSM modules only define subset of the function pointers, and as
far as I can tell, the rest are NULL.

- however, all security calls just seem to call blindly
"security_ops->foo(...)" without caring wether the function is NULL.

Just curious: how does this magic work?

Does same magic work for all "ops" tables in the kernel? Might get
size and speed reduction if need to test for the NULL function pointer
is removed -- at a huge cost of uncertainty, because all NULL pointer
function deferences would then go undetected.


\
 
 \ /
  Last update: 2008-10-28 10:21    [W:0.084 / U:0.772 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site