LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Markku Savela <msa@moth.iki.fi>
To: linux-kernel@vger.kernel.org
Subject: Silly questions: how can those security_ops->foo(...) calls work when entries seem to be NULL?
Date: Tue, 28 Oct 2008 11:18:38 +0200	[thread overview]
Message-ID: <200810280918.m9S9Icre029090@burp.tkv.asdf.org> (raw)

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.

             reply	other threads:[~2008-10-28  9:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-28  9:18 Markku Savela [this message]
     [not found] <brSUc-4iR-25@gated-at.bofh.it>
2008-10-28  9:33 ` Markku Savela

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200810280918.m9S9Icre029090@burp.tkv.asdf.org \
    --to=msa@moth.iki.fi \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: Silly questions: how can those security_ops->foo(...) calls work when entries seem to be NULL?' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).