koverstreet / bcachefs-tools

http://bcachefs.org
GNU General Public License v2.0
116 stars 88 forks source link

Consistency in kernel key list usage #276

Open phedders opened 3 months ago

phedders commented 3 months ago

Short version - it seems "bcachefs unlock" gets a key into the @u user list, but bcachefs mount searches for a key in the @s session list.

Advice in various places suggests to use keyctl link @u @s - however this does not always work.

If my suspicion is correct, then it would make more sense for unlock to put the key in the Session list OR for mount to check the User list.

My preference would be that mount checks @u AND @s. Kent suggested it would be more secure for unlock to put the key in the session list. In my experience so far, the kernel session list is very flakey.

I am also no sure why (perhaps this is a second issue?) it is required to unlock before mount anyway - bcachefs mount asks for a passphrase but doesnt seem to use it.

OBThanks: to Kent and all the others creating this amazing code - thankyou!

tmuehlbacher commented 2 months ago

I think that this should be better in v1.9.1 or even completely resolved?