Skip to content

Commit fdfdd82

Browse files
lithdewmikdusan
authored andcommitted
linux-user/syscall: zero-init msghdr in do_sendrecvmsg_locked
Refer to this PR for more details about this patch: ziglang/zig#8750 Some spacing has also been added to the existing patch to adhere to QEMU's code style guide.
1 parent c08b599 commit fdfdd82

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

patch/qemu.diff

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/linux-user/signal.c b/linux-user/signal.c
2-
index 8cf51ffe..a006f7b0 100644
2+
index 73de934c6..3a944999d 100644
33
--- a/linux-user/signal.c
44
+++ b/linux-user/signal.c
55
@@ -25,6 +25,13 @@
@@ -10,17 +10,17 @@ index 8cf51ffe..a006f7b0 100644
1010
+#define __SIGRTMIN 32
1111
+#endif
1212
+#ifndef __SIGRTMAX
13-
+#define __SIGRTMAX (NSIG-1)
13+
+#define __SIGRTMAX (NSIG - 1)
1414
+#endif
1515
+
1616
static struct target_sigaction sigact_table[TARGET_NSIG];
1717

1818
static void host_signal_handler(int host_signum, siginfo_t *info,
1919
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
20-
index 6495ddc4..debb6f33 100644
20+
index 27adee908..18c692989 100644
2121
--- a/linux-user/syscall.c
2222
+++ b/linux-user/syscall.c
23-
@@ -123,6 +123,13 @@
23+
@@ -130,6 +130,13 @@
2424
#include "fd-trans.h"
2525
#include "tcg/tcg.h"
2626

@@ -34,7 +34,16 @@ index 6495ddc4..debb6f33 100644
3434
#ifndef CLONE_IO
3535
#define CLONE_IO 0x80000000 /* Clone io context */
3636
#endif
37-
@@ -6771,9 +6778,20 @@ static inline abi_long host_to_target_timex(abi_long target_addr,
37+
@@ -3310,7 +3317,7 @@ static abi_long do_sendrecvmsg_locked(int fd, struct target_msghdr *msgp,
38+
int flags, int send)
39+
{
40+
abi_long ret, len;
41+
- struct msghdr msg;
42+
+ struct msghdr msg = { 0 };
43+
abi_ulong count;
44+
struct iovec *vec;
45+
abi_ulong target_vec;
46+
@@ -7306,9 +7313,20 @@ static inline abi_long host_to_target_timex64(abi_long target_addr,
3847
}
3948
#endif
4049

@@ -44,7 +53,7 @@ index 6495ddc4..debb6f33 100644
4453
+ int sigev_signo;
4554
+ int sigev_notify;
4655
+ union {
47-
+ int _pad[64-sizeof(int) * 2 + sizeof(union sigval)];
56+
+ int _pad[64 - sizeof(int) * 2 + sizeof(union sigval)];
4857
+ int _tid;
4958
+ } _sigev_un;
5059
+};

0 commit comments

Comments
 (0)