Just landed on _next_. Thanks for the series!
--- BR B.
On Mon, Nov 21, 2022 at 03:16:08PM +0000, Tudor Cretu wrote:
Accessing elements in an empty va_list is undefined behaviour. Therefore, remove the variadicness from safe_* wrappers that always call the functions with the optional argument included.
Adapt the SAFE_OPEN, SAFE_OPENAT, SAFE_SEMCTL macros to handle the change by passing a default arguments if they're omitted.
v5:
- Simplified the SAFE_ macros
- Removed the SAFE_COND_HANDLER
v4:
- Updated the commit message of Patch 1 and some comments
- Renamed safe_vararg_macros.h -> tst_safe_vararg_macros.h
- Renamed SAFE_WRAPPER_COND_HANDLER -> SAFE_COND_HANDLER
- Improved alignment to make macros more readable
v3:
- Combined the open/openat patch with the semctl one into a single series.
- Split the open/openat patch into two patches.
- Introduced a new PATCH (i.e. 1/4) that implements a common handler chooser for open/openat/semctl cases.
- Removed an unused va_list variable.
v2:
- Added parenthesis around macro arguments
Review branch: https://git.morello-project.org/tudcre01/morello-linux-ltp/-/commits/review/...
Tudor Cretu (3): safe_open: Fix undefined behaviour in vararg handling safe_openat: Fix undefined behaviour in vararg handling safe_semctl: Fix undefined behaviour in vararg handling
include/old/safe_macros.h | 6 ++++-- include/safe_macros_fn.h | 3 ++- include/tst_safe_file_at.h | 10 ++++++---- include/tst_safe_macros.h | 6 ++++-- include/tst_safe_sysv_ipc.h | 14 +++++++++----- lib/safe_macros.c | 13 +------------ lib/tst_safe_file_at.c | 11 +++-------- lib/tst_safe_sysv_ipc.c | 10 +--------- 8 files changed, 30 insertions(+), 43 deletions(-)
-- 2.25.1
linux-morello-ltp mailing list -- linux-morello-ltp@op-lists.linaro.org To unsubscribe send an email to linux-morello-ltp-leave@op-lists.linaro.org