diff options
| author | Robert Clausecker <fuz@FreeBSD.org> | 2025-11-14 00:55:59 +0000 |
|---|---|---|
| committer | Robert Clausecker <fuz@FreeBSD.org> | 2025-11-14 00:56:12 +0000 |
| commit | f0af21824331648a41b4e5d3323bea9216bcb7e2 (patch) | |
| tree | a9c4c1aeb399e5abc838073006736a97f5d08bb0 | |
| parent | ce5692bf009ed5607d3b880eec4055697479c13d (diff) | |
aio: fix alignment of struct (o)aiocb32 on non-amd64
Only i386 has a four-byte alignment for uint64_t, others have
eight-byte alignment. This causes the structure to mismatch
on armv7 binaries running under aarch64, breaking the aio interface.
Fixes: 3858a1f4f501d00000447309aae14029f8133946
Approved by: markj (mentor)
Reported by: Mark Millard <marklmi26-fbsd@yahoo.com>
Discussed with: jrtc27
PR: 290962
MFC after: immediately (for 15.0)
| -rw-r--r-- | sys/kern/vfs_aio.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c index 02d4b8426757..2a790237d30e 100644 --- a/sys/kern/vfs_aio.c +++ b/sys/kern/vfs_aio.c @@ -2752,7 +2752,11 @@ struct __aiocb_private32 { #ifdef COMPAT_FREEBSD6 typedef struct oaiocb32 { int aio_fildes; /* File descriptor */ +#ifdef __amd64__ uint64_t aio_offset __packed; /* File offset for I/O */ +#else + uint64_t aio_offset; /* File offset for I/O */ +#endif uint32_t aio_buf; /* I/O buffer in process space */ uint32_t aio_nbytes; /* Number of bytes for I/O */ struct osigevent32 aio_sigevent; /* Signal to deliver */ @@ -2764,7 +2768,11 @@ typedef struct oaiocb32 { typedef struct aiocb32 { int32_t aio_fildes; /* File descriptor */ +#ifdef __amd64__ uint64_t aio_offset __packed; /* File offset for I/O */ +#else + uint64_t aio_offset; /* File offset for I/O*/ +#endif uint32_t aio_buf; /* I/O buffer in process space */ uint32_t aio_nbytes; /* Number of bytes for I/O */ int __spare__[2]; |
