platform_system_core/init/fuzzer/Android.bp
Eric Biggers 5d7c35ce20 init: remove session keyring workaround for old kernels
The android-4.14-stable and later kernels support the
FS_IOC_ADD_ENCRYPTION_KEY and FS_IOC_REMOVE_ENCRYPTION_KEY ioctls.  This
has superseded the old way of adding fscrypt keys to the kernel, which
was to use the add_key() syscall to add keys to the "session" keyring.
On kernels that support the ioctls, Android doesn't use the obsolete
way.  Since upgrading even just to Android 14 requires at minimum a
android-4.14-stable kernel (according to
https://source.android.com/docs/core/architecture/kernel/android-common#compatibility-matrix),
there is no need to support the obsolete way anymore.

Therefore, this commit removes the code from init that created a keyring
named "fscrypt" in the session keyring.  It also removes the code that
created the session keyring itself, since the only reason that Android
even created a session keyring was just to hold the "fscrypt" keyring.

Flag: N/A for the following reasons:
      - Removing obsolete code, which is fairly safe
      - Very early code, so runtime flag cannot be used
      - Even a build-time flag cannot be used, since init needs
        recovery_available, which aconfig libraries do not support

Bug: 311736104
Test: Build and boot Cuttlefish
Change-Id: Id9a184c68cf16d5c4b1d889444cf637c95a91413
2023-11-27 23:43:49 +00:00

75 lines
1.8 KiB
Text

/*
* Copyright (C) 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package {
default_applicable_licenses: ["system_core_init_license"],
}
cc_defaults {
name: "libinit_fuzzer_defaults",
static_libs: [
"libc++fs",
"liblmkd_utils",
"libmodprobe",
"libprotobuf-cpp-lite",
"libpropertyinfoparser",
"libsnapshot_init",
"libinit",
],
shared_libs: [
"libbase",
"libfs_mgr",
"libhidl-gen-utils",
"liblog",
"libprocessgroup",
"libselinux",
],
header_libs: ["libinit_headers"],
fuzz_config: {
cc: [
"android-media-fuzzing-reports@google.com",
],
componentid: 155276,
},
}
cc_fuzz {
name: "init_parser_fuzzer",
srcs: [
"init_parser_fuzzer.cpp",
],
shared_libs: ["libhidlmetadata",],
defaults: [
"libinit_fuzzer_defaults",
],
}
cc_fuzz {
name: "init_property_fuzzer",
srcs: [
"init_property_fuzzer.cpp",
],
defaults: ["libinit_fuzzer_defaults"],
}
cc_fuzz {
name: "init_ueventHandler_fuzzer",
srcs: [
"init_ueventHandler_fuzzer.cpp",
],
defaults: [
"libinit_fuzzer_defaults",
],
}