tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: KAUTH_GENERIC_CANSEE



On Sun, Nov 15, 2009 at 2:12 PM, David Laight <david%l8s.co.uk@localhost> wrote:
> On Sun, Nov 15, 2009 at 01:31:16PM -0500, Elad Efrat wrote:
>> On Sun, Nov 15, 2009 at 1:21 PM, David Laight <david%l8s.co.uk@localhost> 
>> wrote:
>>
>> > 1) You need a sleep lock to only allow one thread into the code.
>>
>> Hm, so we need that for BYFILE but not for BYPID?
>
> The purpose of the 'mark' is to avoid returning a file more than once.
> So you don't want 2 processes setting different values at the same time.
>
>> > 2) If the 'seq' wraps, you need to do a full scan to set the
>> > ? marker on all 'struct file' back to zero.
>>
>> Why? Once the scan's done, the seq value in struct file can be discarded...
>
> Consider:
> scan 1 proceeses all files, each now has a seq of '1'
> scans 2 onwards are partial or aborted.
> we now do a full scan with seq of '1' - misses loads of entries.
>
>> > 3) Any scan of the process table needs to worry about the consequences
>> > ? of the table growing.
>
> I'm not 100% sure of the difference between BYFILE and BYPID, especially
> when the only to enumerate all files is from the pid table.

Perhaps the marker should be a timestamp and the lock should forbid
other processes from "acquiring a timestamp for traversal"?

-e.


Home | Main Index | Thread Index | Old Index