| 6be581ae | 04-Sep-2026 |
Chris Gellermann <christian.gellermann@codasip.com> |
selftests/nci: Fix out-of-bounds store on thread join
The NCI test collects the exit status of its helper threads by passing the address of an int to pthread_join():
int status; ... pthread_join
selftests/nci: Fix out-of-bounds store on thread join
The NCI test collects the exit status of its helper threads by passing the address of an int to pthread_join():
int status; ... pthread_join(thread_t, (void **) &status);
pthread_join() stores a void pointer to the memory location. On 64-bit systems, a void pointer is wider than an int, so the store overruns the 4 bytes of space allocated on the stack for the integer and corrupts the adjacent stack. On our CHERI system, this caused a fault due to a capability bounds violation.
Fix this by introducing a helper that joins a thread through a void pointer and converts the result back to an integer, which is what the helper threads return.
While here, also fix the logic in disconnect_tag() if the helper thread creation failed. Previously, it would have joined a thread that was never created when pthread_create() failed.
Fixes: f595cf1242f3 ("selftests: Add nci suite") Signed-off-by: Chris Gellermann <christian.gellermann@codasip.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20260904095915.3372241-1-christian.gellermann@codasip.com Signed-off-by: David Heidelberg <david@ixit.cz>
show more ...
|
| eda518d2 | 01-Sep-2026 |
Chaithanya Lagisetty <nagachaithanya9911@gmail.com> |
selftests: nci: Fix uninitialized family ID on missing attribute
get_family_id() walks the generic netlink CTRL_CMD_GETFAMILY reply looking for the CTRL_ATTR_FAMILY_ID attribute and returns the pars
selftests: nci: Fix uninitialized family ID on missing attribute
get_family_id() walks the generic netlink CTRL_CMD_GETFAMILY reply looking for the CTRL_ATTR_FAMILY_ID attribute and returns the parsed value in the local variable "id". If the reply does not carry that attribute, the parsing loop never assigns "id" and the function returns an indeterminate stack value, which the caller stores in self->fid and uses for subsequent netlink requests.
Initialize "id" to 0 so a missing attribute yields a deterministic (invalid) family ID instead of a garbage value.
Fixes: f595cf1242f3 ("selftests: Add nci suite") Signed-off-by: Chaithanya Lagisetty <nagachaithanya9911@gmail.com> Reviewed-by: Hangbin Liu <liuhangbin@kylinos.cn> Link: https://patch.msgid.link/20260901070618.3299012-1-nagachaithanya9911@gmail.com Signed-off-by: David Heidelberg <david@ixit.cz>
show more ...
|
| 61612511 | 17-Aug-2021 |
Bongsu Jeon <bongsu.jeon@samsung.com> |
selftests: nci: Add the NCI testcase reading T4T Tag
Add the NCI testcase reading T4T Tag that has NFC TEST in plain text. the virtual device application acts as T4T Tag in this testcase.
Signed-of
selftests: nci: Add the NCI testcase reading T4T Tag
Add the NCI testcase reading T4T Tag that has NFC TEST in plain text. the virtual device application acts as T4T Tag in this testcase.
Signed-off-by: Bongsu Jeon <bongsu.jeon@samsung.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
| 72696bd8 | 17-Aug-2021 |
Bongsu Jeon <bongsu.jeon@samsung.com> |
selftests: nci: Extract the start/stop discovery function
To reuse the start/stop discovery code in other testcase, extract the code.
Signed-off-by: Bongsu Jeon <bongsu.jeon@samsung.com> Signed-off
selftests: nci: Extract the start/stop discovery function
To reuse the start/stop discovery code in other testcase, extract the code.
Signed-off-by: Bongsu Jeon <bongsu.jeon@samsung.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
| 6ebbc968 | 17-Aug-2021 |
Bongsu Jeon <bongsu.jeon@samsung.com> |
selftests: nci: Add the flags parameter for the send_cmd_mt_nla
To reuse the send_cmd_mt_nla for NLM_F_REQUEST and NLM_F_DUMP flag, add the flags parameter to the function.
Signed-off-by: Bongsu Je
selftests: nci: Add the flags parameter for the send_cmd_mt_nla
To reuse the send_cmd_mt_nla for NLM_F_REQUEST and NLM_F_DUMP flag, add the flags parameter to the function.
Signed-off-by: Bongsu Jeon <bongsu.jeon@samsung.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
| 1d5b8d01 | 17-Aug-2021 |
Bongsu Jeon <bongsu.jeon@samsung.com> |
selftests: nci: Fix the wrong condition
memcpy should be executed only in case nla_len's value is greater than 0.
Signed-off-by: Bongsu Jeon <bongsu.jeon@samsung.com> Signed-off-by: David S. Miller
selftests: nci: Fix the wrong condition
memcpy should be executed only in case nla_len's value is greater than 0.
Signed-off-by: Bongsu Jeon <bongsu.jeon@samsung.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
| 78a7b2a8 | 17-Aug-2021 |
Bongsu Jeon <bongsu.jeon@samsung.com> |
selftests: nci: Fix the code for next nlattr offset
nlattr could have a padding for 4 bytes alignment. So next nla's offset should be calculated with a padding.
Signed-off-by: Bongsu Jeon <bongsu.j
selftests: nci: Fix the code for next nlattr offset
nlattr could have a padding for 4 bytes alignment. So next nla's offset should be calculated with a padding.
Signed-off-by: Bongsu Jeon <bongsu.jeon@samsung.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|