Re: [RFC PATCH 1/6] NFSD: Handle @rqstp == NULL in check_nfsd_access()

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

 




> On Aug 28, 2024, at 2:30 AM, NeilBrown <neilb@xxxxxxx> wrote:
> 
> On Wed, 28 Aug 2024, Mike Snitzer wrote:
>> On Wed, Aug 28, 2024 at 11:12:00AM +1000, NeilBrown wrote:
>>> 
>>> The "AUTH_UNIX check below" only applies if exp->ex_flavours == 0.
>>> To make "rqstp == NULL" mean "treat like AUTH_UNIX" I think we need
>>> to confirm that 
>>>  exp->ex_xprtsec_mods & NFSEXP_XPRTSEC_NONE
>>> and either
>>>  exp->ex_nflavours == 0
>>> or
>>>  one for the exp->ex_flavors->pseudoflavor values is RPC_AUTH_UNIX
>>> 
>>> I'm not sure that is all really necessary, but if not then we probably
>>> need a better comment...
>> 
>> Think extra checks aren't needed (unless you think a NULL rqstp
>> _without_ the use of LOCALIO possible?  which could trigger a false
>> positive granting of access? seems unlikely but...)
>> 
> 
> I agree they aren't needed.  I think we need to have a clear
> understanding of why that aren't needed, and to write that understanding
> down.  So that if some day someone wants to change this code, they can
> understand the consequences.

> I don't know what is best, but I think we should have a comment
> justifying the short-circuit, and I don't think the current proposed
> comment does that correctly.

My goal is to document that understanding here, as you stated.
I will leave it to you and Mike to adjust the wording to your
liking.


--
Chuck Lever






[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux