[LTP] [PATCH 2/2] setsockopt10: Use lapi/{socket, tcp}.h to fix compilation

Martin Doucha mdoucha@suse.cz
Fri Oct 20 16:34:28 CEST 2023


Hi,
I've checked that setsockopt10 will compile on SLE-15SP1. For both patches:

Reviewed-by: Martin Doucha <mdoucha@suse.cz>

On 20. 10. 23 13:09, Petr Vorel wrote:
> Distros with glibc-2.26 and older will fail due missing SOL_TLS
> in <sys/socket.h> and TCP_ULP in <netinet/tcp.h>. Use fallback
> definitions in lapi/socket.h and lapi/tcp.h.
> 
> Also replace quotes ("") with sharp brackets (<>) for <netinet/in.h>
> (it's a system header, the same was for netinet/tcp.h, but it was
> replaced with lapi).
> 
> Fixes: bdb37aab9 ("Add setsockopt10 TLS ULP UAF CVE-2023-0461")
> Reported-by: Martin Doucha <mdoucha@suse.cz>
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
>   testcases/kernel/syscalls/setsockopt/setsockopt10.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/testcases/kernel/syscalls/setsockopt/setsockopt10.c b/testcases/kernel/syscalls/setsockopt/setsockopt10.c
> index afd2c40a1..4e7e44938 100644
> --- a/testcases/kernel/syscalls/setsockopt/setsockopt10.c
> +++ b/testcases/kernel/syscalls/setsockopt/setsockopt10.c
> @@ -49,10 +49,11 @@
>   #ifdef HAVE_LINUX_TLS_H
>   
>   #include <linux/tls.h>
> -#include "netinet/in.h"
> -#include "netinet/tcp.h"
> +#include <netinet/in.h>
>   
>   #include "lapi/sched.h"
> +#include "lapi/socket.h"
> +#include "lapi/tcp.h"
>   #include "tst_checkpoint.h"
>   #include "tst_net.h"
>   #include "tst_safe_net.h"

-- 
Martin Doucha   mdoucha@suse.cz
SW Quality Engineer
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic



More information about the ltp mailing list