[LU-15928] pass key length as part of index API Created: 10/Jun/22  Updated: 14/Jun/22

Status: Open
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.15.0
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Andreas Dilger Assignee: Sebastien Buisson
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Related
is related to LU-13717 Client-side encryption - support file... Resolved
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

With fscrypt passing binary names to the underlying ldiskfs storage, the lookup API should be passing the length of the key through the DT index API instead of calling strlen() on the string, otherwise this may incorrectly process keys with embedded NUL bytes.



 Comments   
Comment by Gerrit Updater [ 14/Jun/22 ]

"Andreas Dilger <adilger@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/47624
Subject: LU-15928 osd: pass keylen for dt index operations
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: f88b3fb915f3f0a56da562885db38a8f515260a3

Comment by Andreas Dilger [ 14/Jun/22 ]

Sebastien, I started on this patch but haven't had time to finish it off. I think this is needed to handle binary names properly.

Comment by Sebastien Buisson [ 14/Jun/22 ]

Actually, in order to avoid this large change in the DT index API as part of the LU-13717 series, I had decided to critical encode the names of encrypted files passed from client to server. This escapes NULL, LF, CR, /, DEL and = characters, so that using strlen is safe.

So the code is sane as it is today. But passing the length of the key through the DT index API instead of calling strlen on the string seems to be a better longer term option. And that would avoid the need to critical encode names on client side before the request is sent, just to critical decode those names on server side upon request receive. Unless the ptlrpc layer requires buffers put in the requests to be nul terminated?

Generated at Sat Feb 10 03:22:30 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.