libbrillo: blkdevutils: avoid passing non-null terminated data as C-string

SecureBlobs created from std::strings do not end in '\0'.
In this case, the dm code calls strlen() on the parameter string
which results in an access beyond the allocated space. This caused
the ASAN builder to fail continuously. Instead, for now, use the
string functions for SecureBlob to pass the data on.

BUG=chromium:941727
TEST=amd-generic vm boots up.

Change-Id: I6c63b37bae1204c9dca6315f2285f16f4405296a
Reviewed-on: https://chromium-review.googlesource.com/1524550
Commit-Ready: Sarthak Kukreti <sarthakkukreti@chromium.org>
Tested-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Cr-Mirrored-From: https://chromium.googlesource.com/chromiumos/platform2
Cr-Mirrored-Commit: 70164ed0d01338cff38777b0bbeb71a79ffe6b6c
1 file changed
tree: 64c490b3b728e5d70f4ad1085a982db82fab5343
  1. brillo/
  2. install_attributes/
  3. policy/
  4. libbrillo-462023.gypi
  5. libbrillo-glib.pc.in
  6. libbrillo-test.pc.in
  7. libbrillo.gyp
  8. libbrillo.gypi
  9. libbrillo.pc.in
  10. libinstallattributes.gypi
  11. libpolicy.gypi
  12. libpolicy.ver
  13. OWNERS
  14. platform2_preinstall.sh
  15. PRESUBMIT.cfg
  16. README.md
  17. testrunner.cc
README.md

libbrillo: platform utility library

libbrillo is a shared library meant to hold common utility code that we deem useful for platform projects. It supplements the functionality provided by libbase/libchrome since that project, by design, only holds functionality that Chromium (the browser) needs. As a result, this tends to be more OS-centric code.

AOSP Usage

This project is also used by Update Engine which is maintained in AOSP. However, AOSP doesn't use this codebase directly, it maintains its own libbrillo fork.

To help keep the projects in sync, we have a gsubtree set up on our GoB: https://chromium.googlesource.com/chromiumos/platform2/libbrillo/

This allows AOSP to cherry pick or merge changes directly back into their fork.