git: f0af21824331 - main - aio: fix alignment of struct (o)aiocb32 on non-amd64

From: Robert Clausecker <fuz_at_FreeBSD.org>
Date: Fri, 14 Nov 2025 01:03:22 UTC
The branch main has been updated by fuz:

URL: https://cgit.FreeBSD.org/src/commit/?id=f0af21824331648a41b4e5d3323bea9216bcb7e2

commit f0af21824331648a41b4e5d3323bea9216bcb7e2
Author:     Robert Clausecker <fuz@FreeBSD.org>
AuthorDate: 2025-11-14 00:55:59 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2025-11-14 00:56:12 +0000

    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)
---
 sys/kern/vfs_aio.c | 8 ++++++++
 1 file changed, 8 insertions(+)

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];