Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-15928

pass key length as part of index API

Details

    • Bug
    • Resolution: Unresolved
    • Minor
    • None
    • Lustre 2.15.0
    • None
    • 3
    • 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.

      Attachments

        Issue Links

          Activity

            [LU-15928] pass key length as part of index API

            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?

            sebastien Sebastien Buisson added a comment - 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?

            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.

            adilger Andreas Dilger added a comment - 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.

            "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

            gerrit Gerrit Updater added a comment - "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

            People

              sebastien Sebastien Buisson
              adilger Andreas Dilger
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: