Re: /proc parent &proc_root == NULL?

From: Valdis . Kletnieks
Date: Thu Jan 27 2005 - 01:56:36 EST


On Thu, 27 Jan 2005 01:40:12 EST, Valdis.Kletnieks@xxxxxx said:

> You may want to use a properly timed initcall() to create a callback that
> happens after proc_misc_init() happens, but before userspace gets going, and
> walk through the /proc tree at that time and cache info on the files you care
> about, so you don't have to re-walk /proc every time permission() gets called

Blarg.

The proper time to walk the /proc filesystem and cache such info, is, of
course, in the ->sp_post_addmount() LSM hook. Check @mnt and @mountpoint_nd to
see if it's /proc, and if so, go snarf all the info you need to make your tests
fast..

Not sure if you'd need to redo your cache in sp_post_remount(), for the odd case
where /proc gets remounted....

Attachment: pgp00000.pgp
Description: PGP signature