Resolves a pair of TODO's, and makes a pair of error return
code paths not return null function pointers.
Note that:
system/netd/client/NetdClient.cpp
implements this as:
int checkSocket(int socketFd) {
if (socketFd < 0) {
return -EBADF;
}
int family;
socklen_t familyLen = sizeof(family);
if (getsockopt(socketFd, SOL_SOCKET, SO_DOMAIN, &family, &familyLen) == -1) {
return -errno;
}
if (!FwmarkClient::shouldSetFwmark(family)) {
return -EAFNOSUPPORT;
}
return 0;
}
$define CHECK_SOCKET_IS_MARKABLE(sock) \
do { \
int err = checkSocket(sock); \
if (err) return err; \
} while (false)
extern "C" int tagSocket(int socketFd, uint32_t tag, uid_t uid) {
CHECK_SOCKET_IS_MARKABLE(socketFd);
FwmarkCommand command = {FwmarkCommand::TAG_SOCKET, 0, uid, tag};
return FwmarkClient().send(&command, socketFd, nullptr);
}
extern "C" int untagSocket(int socketFd) {
CHECK_SOCKET_IS_MARKABLE(socketFd);
FwmarkCommand command = {FwmarkCommand::UNTAG_SOCKET, 0, 0, 0};
return FwmarkClient().send(&command, socketFd, nullptr);
}
which means it *already* verifies that the passed in sockfd
is >= 0 and a socket via getsockopt(SOL_SOCKET, SO_DOMAIN),
as such the 'fcntl(sockfd, F_GETFD)' check is spurious.
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I91ef68be5b0cc6b1972d514c13a76eaf834a3d5d
An early return out of this function makes it harder to add new prints
after the memory maps.
Test: m, flash, look at tombstone
Change-Id: Id06e432918d69ac3307761b244473b6b7ab769e8
RemoteProvsioner is deprecated, and already disabled/non-functional
on some builds. Turn off the tests because they are causing spurious
presubmit failures.
Test: n/a
Bug: 266181756
Change-Id: I9b8d3e742ef2b2448a798b1e96b6f3e02695e2be
This fuzzer can only mutate the numerical inputs to a dm-linear table,
which is unlikely to find kernel bugs, and very unlikely to find libdm
bugs. There are a number of automated notifications from it due to
making ASSERT_EQ a no-op, which causes misuse of libdm API calls. None
of these appear to be real bugs.
Bug: 174907083
Test: N/A
Change-Id: Iaa8955eaa4423e4315b8cb74741e6425a56cc303
Take 2: remove the shell script, which wasn't working very well, and
just provide different builds of the same binary.
Bug: 208944665
Test: presubmit
Change-Id: I994a93e4e364bc210ddd2eb60025c656caa86b1c
This file contains a description of dev nodes added to the CPIO archive
for the Android ramdisks. /dev/null is a security requirement for
bionic, /dev/console is needed so the kernel can set-up stdout stderr
and stdin before running /init.
Bug: 254835242
Change-Id: I111e2db53fabd63d070b8e9ab9c52faebf484ab3
BUG : 240098675
Skip Dm-Bow load incase size is not a Multiple of 4096.
Rounding down does not hurt, since ext4 will only use full blocks
Change-Id: Ie4e6634b2c49762e4669e66d94effc91d8e581ca
Signed-off-by: Swapneel Mashalkar <quic_smashalk@quicinc.com>
Load all hard-dependent-modules even if they are not listed in *.load.
Defer softdep module loading to InsmodWithDeps, as loading it parallel
breaks the purpose of softdep which is used to load the modules
according to dependency/sequence(pre/post) added.
Test: Normal/Recovery Boot to home
Bug: 261678056
Change-Id: I0aea7580545affbf4caa9205281868aad00a2bb0
Signed-off-by: Wasim Nazir <quic_wasimn@quicinc.com>
This test was added only for behavior introduced in the 5.15 kernel, where uevents are delayed until a table is laoded.
Bug: 263291020
Test: libdm_test
Change-Id: I6236c4304d8e6b780704df405290f7361d5827cc
* changes:
BatteryMonitor: fix build error with health hal v2 updraged
fastboot: Update health AIDL HAL to V2
storage: Update health AIDL HAL to V2
BatteryMonitor: get battery health data from sys file nodes
libbatterymonitor_V1 is used for some libraries linking health
aidl_interface V1 but at the same time BatteryMonitor also uses
battery hal V2 structure, it will cause compiling error.
Folk BatteryMonitor is also required along with folk libbatterymonitor
Bug: 251425963
Test: build
Change-Id: I796db83b1a67ad63e7f75f966e829a790b5c9c89
Signed-off-by: Jack Wu <wjack@google.com>
Requirements for battery health aidl hal v2, include sysfs nodes:
- Battery state of health
- Charging state
- Charging policy
- Date of manufacturing of the battery
- Date of first use of the battery
and functions
- setChargingPolicy
- getChargingPolicy
- getBatteryHealthData
Bug: 251425963
Test: m
Change-Id: I210dc403ba95b1b75759227f84bc32f32be1bbaf
Signed-off-by: Jack Wu <wjack@google.com>
Since we cannot create a gpt table on zoned LU, we cannot make a generic symlink
from it. Instead, let's make it by uevent, "/dev/block/by-name/zoned_device".
Note that, we support only one zoned device in the system.
Bug: 265180564
Change-Id: Ie62b0fd68b77e3e43cf0f5c5cad9503150174271
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
A critical shutdown service is one that stays on right until the system
is rebooted. In order to be able to capture kernel messages right until
reboot this is required, otherwise after the console service is
terminated some messages can be lost.
Test: Reboot and verify messages show up on serial further down the reboot process
Change-Id: Iea58b5a76afe45b3346803021e3be81742b02ea0
Copy the AVB footer of the recovery.img to the end of the recovery
partition, so that it can be found when loading a recovery image
from a partition that is larger than the image.
Bug: 261673286
Test: m and flashing recovery image and bootloader can now detect
AVB footer.
Change-Id: Ib93da33c72f3a96eb8d9bcedaab5ef0c3a4d418d
Signed-off-by: Isaac J. Manjarres <isaacmanjarres@google.com>
GWP-ASan changed one of the APIs upstream to now take the fault address
as well. This is to support the recoverable mode.
Add the fault address as well.
Test: gwp_asan_unittest
Bug: N/A
Change-Id: I8a4edd3fad159d91cc036050d330bbb8f9c8d435
Move all the error reporting over to err()/errx() rather than the
current mix of errx(), fprintf()+exit(), and the homebrew die().
Also make the two "read all the lines in the file" loops match, by
copying the newer getline() style into the older fgets() loop.
Test: treehugger
Change-Id: Ia732df90588d7fd12dfe965e11c6ed72a96b098d