diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2021-04-29 01:02:03 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2021-04-29 01:02:03 +0000 |
commit | a7bf99d067c399de969ff0c871666e5736261fd0 (patch) | |
tree | d70484daa8d68cfcf718c84d4154721a071bdd5d | |
parent | 691f4bca15c41f3905ca05f2e3db989ea929838e (diff) | |
parent | 20295b94e5714ddc0701ffd651fc555b908acaf7 (diff) | |
download | crosvm-a7bf99d067c399de969ff0c871666e5736261fd0.tar.gz |
Snap for 7321546 from 20295b94e5714ddc0701ffd651fc555b908acaf7 to sc-d1-release
Change-Id: I64480f791c0bbbacb2e20ad4839b5ab700b982fc
-rw-r--r-- | devices/src/proxy.rs | 3 | ||||
-rw-r--r-- | devices/src/virtio/fs/worker.rs | 24 | ||||
-rw-r--r-- | libcrosvm_control/Android.bp | 9 |
3 files changed, 19 insertions, 17 deletions
diff --git a/devices/src/proxy.rs b/devices/src/proxy.rs index 5e22786d6..4afa7b38c 100644 --- a/devices/src/proxy.rs +++ b/devices/src/proxy.rs @@ -158,9 +158,6 @@ impl ProxyDevice { let debug_label_trimmed = &debug_label.as_bytes()[..std::cmp::min(max_len, debug_label.len())]; let thread_name = CString::new(debug_label_trimmed).unwrap(); - // TODO(crbug.com/1199487): remove this once libc provides the wrapper for all - // targets - #[cfg(all(target_os = "linux", target_env = "gnu"))] let _ = libc::pthread_setname_np(libc::pthread_self(), thread_name.as_ptr()); device.on_sandboxed(); child_proc(child_tube, &mut device); diff --git a/devices/src/virtio/fs/worker.rs b/devices/src/virtio/fs/worker.rs index 65a47a9c6..19fec1159 100644 --- a/devices/src/virtio/fs/worker.rs +++ b/devices/src/virtio/fs/worker.rs @@ -188,22 +188,18 @@ impl<F: FileSystem + Sync> Worker<F> { // cases. const SECBIT_NO_SETUID_FIXUP: i32 = 1 << 2; - // TODO(crbug.com/1199487): Remove this once libc provides the wrapper for all targets. - #[cfg(target_os = "linux")] - { - // Safe because this doesn't modify any memory and we check the return value. - let mut securebits = unsafe { libc::prctl(libc::PR_GET_SECUREBITS) }; - if securebits < 0 { - return Err(Error::GetSecurebits(io::Error::last_os_error())); - } + // Safe because this doesn't modify any memory and we check the return value. + let mut securebits = unsafe { libc::prctl(libc::PR_GET_SECUREBITS) }; + if securebits < 0 { + return Err(Error::GetSecurebits(io::Error::last_os_error())); + } - securebits |= SECBIT_NO_SETUID_FIXUP; + securebits |= SECBIT_NO_SETUID_FIXUP; - // Safe because this doesn't modify any memory and we check the return value. - let ret = unsafe { libc::prctl(libc::PR_SET_SECUREBITS, securebits) }; - if ret < 0 { - return Err(Error::SetSecurebits(io::Error::last_os_error())); - } + // Safe because this doesn't modify any memory and we check the return value. + let ret = unsafe { libc::prctl(libc::PR_SET_SECUREBITS, securebits) }; + if ret < 0 { + return Err(Error::SetSecurebits(io::Error::last_os_error())); } #[derive(PollToken)] diff --git a/libcrosvm_control/Android.bp b/libcrosvm_control/Android.bp index fdeb88068..314461106 100644 --- a/libcrosvm_control/Android.bp +++ b/libcrosvm_control/Android.bp @@ -3,6 +3,15 @@ +package { + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "external_crosvm_license" + // to get the below license kinds: + // SPDX-license-identifier-BSD + default_applicable_licenses: ["external_crosvm_license"], +} + rust_defaults { name: "libcrosvm_control_defaults", defaults: ["crosvm_defaults"], |