bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/5] fix exception message format for 64-bit userspace


From: Flávio Cruz
Subject: Re: [PATCH 3/5] fix exception message format for 64-bit userspace
Date: Wed, 19 Apr 2023 22:04:36 -0400

Hi Lucas,

On Wed, Apr 19, 2023 at 3:47 PM Luca Dariz <luca@orpolo.org> wrote:
* kern/exception.c: message fields need to be aligned to 8 bytes for a
  64-bit userspace, so add the required padding if needed, as done by
  MIG.
---
 kern/exception.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/kern/exception.c b/kern/exception.c
index 10435b5c..757f793e 100644
--- a/kern/exception.c
+++ b/kern/exception.c
@@ -274,8 +274,14 @@ struct mach_exception {
        mach_port_t             task;
        mach_msg_type_t         exceptionType;
        integer_t               exception;
+#if defined(__x86_64__) && ! defined(USER32)
+       char exceptionPad[4];
+#endif
        mach_msg_type_t         codeType;
        integer_t               code;
+#if defined(__x86_64__) && ! defined(USER32)
+       char codePad[4];
+#endif
        mach_msg_type_t         subcodeType;
        rpc_long_integer_t      subcode;
 };
--
2.30.2



I believe this shouldn't be necessary due to https://git.savannah.gnu.org/cgit/hurd/gnumach.git/commit/?id=8e5e86fc13732b60d2e4d14152d92db1f1ae73f9 which forces mach_msg_type_t to always be 8 byte aligned. If you check the size before and after your patch, it will be the same.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]