Revert "fortify: allow diagnostics without run-time checks"
This reverts commit d7e11b88531665de59de466bbc9ee6c480b00a4f.
Reason for revert: Breaks aosp_x86_64-eng. Will look into it and
unbreak when it's not almost midnight. :)
Change-Id: I21f76efe4d19c70d0b14630e441376d359a45b49
diff --git a/libc/include/bits/fortify/poll.h b/libc/include/bits/fortify/poll.h
index 30fdce4..7a727a4 100644
--- a/libc/include/bits/fortify/poll.h
+++ b/libc/include/bits/fortify/poll.h
@@ -44,13 +44,13 @@
__overloadable
__clang_error_if(__bos_unevaluated_lt(__bos(fds), sizeof(*fds) * fd_count),
"in call to 'poll', fd_count is larger than the given buffer") {
-#if __ANDROID_API__ >= __ANDROID_API_M__ && __BIONIC_FORTIFY_RUNTIME_CHECKS_ENABLED
+#if __ANDROID_API__ >= __ANDROID_API_M__
size_t bos_fds = __bos(fds);
if (!__bos_fd_count_trivially_safe(bos_fds, fds, fd_count)) {
return __poll_chk(fds, fd_count, timeout, bos_fds);
}
-#endif
+#endif /* __ANDROID_API__ >= __ANDROID_API_M__ */
return __call_bypassing_fortify(poll)(fds, fd_count, timeout);
}
@@ -60,13 +60,13 @@
__overloadable
__clang_error_if(__bos_unevaluated_lt(__bos(fds), sizeof(*fds) * fd_count),
"in call to 'ppoll', fd_count is larger than the given buffer") {
-#if __ANDROID_API__ >= __ANDROID_API_M__ && __BIONIC_FORTIFY_RUNTIME_CHECKS_ENABLED
+#if __ANDROID_API__ >= __ANDROID_API_M__
size_t bos_fds = __bos(fds);
if (!__bos_fd_count_trivially_safe(bos_fds, fds, fd_count)) {
return __ppoll_chk(fds, fd_count, timeout, mask, bos_fds);
}
-#endif
+#endif /* __ANDROID_API__ >= __ANDROID_API_M__ */
return __call_bypassing_fortify(ppoll)(fds, fd_count, timeout, mask);
}
#endif /* __ANDROID_API__ >= __ANDROID_API_L__ */
@@ -77,13 +77,11 @@
__overloadable
__clang_error_if(__bos_unevaluated_lt(__bos(fds), sizeof(*fds) * fd_count),
"in call to 'ppoll64', fd_count is larger than the given buffer") {
-#if __BIONIC_FORTIFY_RUNTIME_CHECKS_ENABLED
size_t bos_fds = __bos(fds);
if (!__bos_fd_count_trivially_safe(bos_fds, fds, fd_count)) {
return __ppoll64_chk(fds, fd_count, timeout, mask, bos_fds);
}
-#endif
return __call_bypassing_fortify(ppoll64)(fds, fd_count, timeout, mask);
}
#endif /* __ANDROID_API__ >= __ANDROID_API_P__ */