Fish Trophy

jbk got a fish trophy!

12709 Support custom URI schemes for the keylocation property

Review Request #2552 — Created May 8, 2020 and submitted

jbk
illumos-gate
12709
general

12709 Support custom URI schemes for the keylocation property



  • 0
  • 0
  • 7
  • 2
  • 9
Description From Last Updated
yuripv
  1. 
      
  2. This looks like out of memory, not invalid uri case.

  3. getline() returns (or should, at least) -1, not some negative number.

    1. < 0 to check for failure is a very common idiom througout the illumos code base.

    2. Not a stopper of course, but yes, illumos code base has a lot of weird stuff that needs to be fixed and not followed :)

    3. It certainly should return -1, but it's not "weird" to handle some unusual fault condition where it returns a larger negative number. No negative value would be valid, so it seems fine -- even better, frankly -- to just treat the entire range as a fault.

  4. Don't really need to modify buf2 and buf2len?

    1. As Toomas points out, we should probably clear these out (there is currently no portable way of doing this as AFAIK Linux, Windows, and OS X don't have explicit_bzero() or freezero(), and given these are passphrases, it's probably worth taking the porting/merging hit to provide better security here since we can.

  5. What is 7?

    1. That comes from the original code ('file://'). It can be changed into an ASSERT0(strncmp(uri, 'file://')).

  6. usr/src/lib/libzfs/common/libzfs_util.c (Diff revision 1)
     
     

    Don't you need to regfree(&hdl->libzfs_urire) on failures after this line?

  7. 
      
tsoome
  1. 
      
  2. Should we explicit_bzero() there perhaps?

    1. freezero() is probably better. Neither it nor explicit_bzero() an option in OpenZFS, but I think the security concerns probably outweight the portability/merge issues here.

  3. usr/src/lib/libzfs/common/libzfs_util.c (Diff revision 1)
     
     

    This kind of regex does imply C locale. For example, in et_EE, the z is after s and this regex will exclude chars t...y.

    1. It turns out, stashed way in an appendix of RFC3986 there's a regex for parsing a URI that appears to be locale agnostic. I'll update the code to use that.

  4. 
      
jbk
yuripv
  1. Ship It!
  2. 
      
tsoome
  1. Ship It!
  2. 
      
jbk
tsoome
  1. Ship It!
  2. 
      
jbk
tsoome
  1. Ship It!
  2. 
      
yuripv
  1. Ship It!
  2. 
      
jbk
Review request changed

Status: Closed (submitted)

Loading...