The branch stable/15 has been updated by fuz:

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

commit ea26fd52a949116d03f59066d364eee2af6c9f51
Author:     Robert Clausecker <[email protected]>
AuthorDate: 2025-11-14 00:55:59 +0000
Commit:     Robert Clausecker <[email protected]>
CommitDate: 2025-11-14 01:03:44 +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 <[email protected]>
    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 60916a9fbd32..65d7ffc9b742 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];

Reply via email to