strace/0190-tests-sockopt-timestamp.c-use-k_getsockopt-and-k_set.patch
Eugene Syromiatnikov 0442751b1d Fix incorrect syscall name reporting in restart_syscall() on attach
* 0183-syscall-do-not-use-uninitialized-parts-of-struct-ptr.patch
* 0184-startup_tcb-add-a-comment.patch
* 0185-tests-add-another-test-of-restart_syscall-decoding.patch
* 0186-tests-workaround-net-yy-inet-for-new-kernels.patch
* 0187-tests-avoid-linkat-secontext_mismatch-failures-on-se.patch
* 0188-linux-s390-get_scno.c-use-NT_S390_SYSTEM_CALL-if-gpr.patch
* 0189-tests-move-k_setsockopt-definition-into-a-separate-f.patch
* 0190-tests-sockopt-timestamp.c-use-k_getsockopt-and-k_set.patch
* strace.spec (Patch183, Patch184, Patch185, Patch186, Patch187,
Patch188, Patch189, Patch190): New patches.
(%prep): Aply them.
(%changelog): Add a record.

Resolves: RHEL-65109
Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com>
2024-10-31 15:08:18 +01:00

61 lines
1.9 KiB
Diff

From cbda4efac4d55f8b3bf6622cdb764d2375a2cf3a Mon Sep 17 00:00:00 2001
From: Eugene Syromyatnikov <evgsyr@gmail.com>
Date: Thu, 31 Oct 2024 13:31:14 +0100
Subject: [PATCH 190/190] tests/sockopt-timestamp.c: use k_getsockopt and
k_setsockopt
Avoid using glibc wrappers as these performs additional actions
that lead to the following issues:
- Test segfault on 32-bit compat when an attempt to use
SO_RCVTIMEO_NEW/SO_SNDTIMEO_NEW with opt pointing to unavailable
memory is made;
- Additional calls to SO_TIMESTAMP{,NS}_OLD when SO_TIMESTAMP{NS}_NEW
are called:
-getsockopt(3, SOL_SOCKET, SO_TIMESTAMP_NEW, [0], [4]) = 0
[...]
+getsockopt(3, SOL_SOCKET, SO_TIMESTAMP_NEW, 0xf7d3cffc, [4]) = -1 ENOPROTOOPT (Protocol not available)
+getsockopt(3, SOL_SOCKET, SO_TIMESTAMP_OLD, [0], [4]) = 0
* tests/sockopt-sol_socket.c: Include "k_sockopt.h".
{get_sockopt): Use k_getsockopt() instead of getsockopt().
{set_sockopt): Use k_setsockopt() instead of setsockopt().
---
tests/sockopt-sol_socket.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tests/sockopt-sol_socket.c b/tests/sockopt-sol_socket.c
index 833aee6e1904..ee7a866c4385 100644
--- a/tests/sockopt-sol_socket.c
+++ b/tests/sockopt-sol_socket.c
@@ -13,6 +13,8 @@
#include <sys/socket.h>
#include <sys/un.h>
+#include "k_sockopt.h"
+
#define XLAT_MACROS_ONLY
# include "xlat/sock_options.h"
#undef XLAT_MACROS_ONLY
@@ -34,7 +36,7 @@ struct intstr {
static int
get_sockopt(int fd, int name, void *val, socklen_t *len)
{
- rc = getsockopt(fd, SOL_SOCKET, name, val, len);
+ rc = k_getsockopt(fd, SOL_SOCKET, name, val, len);
errstr = sprintrc(rc);
return rc;
}
@@ -42,7 +44,7 @@ get_sockopt(int fd, int name, void *val, socklen_t *len)
static int
set_sockopt(int fd, int name, void *val, socklen_t len)
{
- rc = setsockopt(fd, SOL_SOCKET, name, val, len);
+ rc = k_setsockopt(fd, SOL_SOCKET, name, val, len);
errstr = sprintrc(rc);
return rc;
}
--
2.28.0