OpenAFS Master Repository branch, master, updated. openafs-devel-1_9_1-261-g8a2d4fa

Gerrit Code Review
Thu, 11 May 2023 12:25:52 -0400

The following commit has been merged in the master branch:
commit 8a2d4faa73d0f2e03a4016d7f84c5d5437040cec
Author: Ben Huntsman <>
Date:   Thu May 4 10:00:43 2023 -0700

    AIX: AFS_SMALLOCSIZ too small on newer OS releases
    Addresses a situation where a write in AFS space can cause a kernel
    panic.  In src/afs/afs_osi_uio.c in the function afsio_partialcopy:
        size_t space_len = sizeof(struct uio) +
                           sizeof(struct iovec) * AFS_MAXIOVCNT;
        /* Allocate a block that can contain both the UIO and the iovec */
        space = osi_AllocSmallSpace(space_len);
    On newer AIX systems (since at least 6.1), space_len is larger than
    AFS_SMALLOCSIZ.  When osi_AllocSmallSpace is called, the following
    test in src/afs/afs_osi_alloc.c causes a kernel panic:
        if (size > AFS_SMALLOCSIZ)
            osi_Panic("osi_AllocSmallS: size=%d\n", (int)size);
    This is due to the following definition in src/config/afs_args.h:
     * Note that the AFS_*ALLOCSIZ values should be multiples of sizeof(void*) to
     * accomodate pointer alignment.
    /* Used in rx.c as well as afs directory. */
    #if     defined(AFS_AIX32_ENV) || defined(AFS_HPUX_ENV)
    /* XXX Because of rxkad_cprivate... XXX */
    #define AFS_SMALLOCSIZ  (38*sizeof(void *))     /* "Small" allocated size */
    #define AFS_SMALLOCSIZ  (64*sizeof(void *))     /*  "Small" allocated size */
    All the supported AIX platforms define AFS_AIX32_ENV in
    src/config/param.rs_aixXX.h, where XX is the AIX version.  Therefore,
    all the AIX platforms end up with AFS_SMALLOCSIZ = 152 bytes instead
    of 256.  To resolve this, we will modify the preprocessor test to use
    the second case for AIX versions greater than 6.1.  This issue may be
    present on earlier releases of AIX as well, but AIX 5.3 and older
    test systems were not available at this time.
    Also, a spelling error in the comment was fixed.
    Change-Id: Id6b094e28e1be1cfb71296c5c31e60592ba91395
    Reviewed-by: Mark Vitale <>
    Tested-by: BuildBot <>
    Reviewed-by: Cheyenne Wills <>
    Reviewed-by: Benjamin Kaduk <>

 src/config/afs_args.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

OpenAFS Master Repository