Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=193.12.253.120 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796033462; b=cdWOiJRkTsMSgYBSA+FbF99Hujpgf28oXyU3WuShjJT2+QHVLprP5K0j+N0qvfx5QgdB uwgMZEFqhxdwNJn2G4Tbm3VK896FyWRw41Gf996cpCOw/6zdNMQ4W6azzR3x9yUNwHgQW OtqRXV5Um4/n6jJ6Ady5/uZp7ry48LOWXLrB0D1F9bNJP6x/ueDdAnkXM3/oSHNlFXS62 9i+nIn3CI2doWbINsG+x3UXTsgrEAZJbil3PEh134gZ4J5mjhBz3jaTVbuQqGhygJF8Ty F6ManCu24Py25X0CBz3tfS/RbbBOFO8Xxtars/OujKrhzlWCle0k+4HA/ZVZ8POpO8Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796033462; h=DMARC-Filter:Received:DKIM-Filter:DKIM-Signature: X-Spam-Checker-Version:X-Spam-Level:X-Spam-Status:X-Spam-ASN: X-Original-To:Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer: MIME-Version:Content-Transfer-Encoding; bh=vQnP0oqWx7o48FeDnadhF4oDTnBtSNTu2kIyhwfWnXk=; b=Bnjv7r3ozyXiBrZATOVi5ysHvXJGdmf27CgSV8Smp92q8CON/yEZmiEOQdqkAgYsuDIF GXLe8mkUg8mO2cSrl9T4uYtfHVKfanm31WxeOOQeQdHv7z6Zyk9TVhaDfOTyed1xcmdtt n8a9IGRY8h5ulHCUnTo5q8PYft9HU0OxOq+9R+VWkDUzx1o3Tu7JtsIa281nrme+C7sBF 3QZLRqD3dKd6A+QWGHdUsKQB44ueGVezheN7G4KWAWUWL1605PQQXv2e2g04B9i2Bs9GS Ohc6TDCnQ60R2uAOb3cFpuD7+64QAVS4vTz2sRzE8NQ0JPj/sRiremuqc40ZxRm9VAw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=cendio.com; spf=pass smtp.mailfrom=cendio.com; dkim=pass header.d=cendio.se header.i=@cendio.se header.a=rsa-sha256 header.s=20250112 header.b=kXCyZ7dw; arc=none smtp.remote-ip=193.12.253.120 Received: from mail.cendio.se (mail.cendio.se [193.12.253.120]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AA1C4606A320 for ; Mon, 30 Nov 2026 10:11:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org AA1C4606A320 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=cendio.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cendio.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=cendio.se header.i=@cendio.se header.a=rsa-sha256 header.s=20250112 header.b=kXCyZ7dw Received: by mail.cendio.se (Postfix, from userid 1002) id D6A2F1835BD0; Mon, 30 Nov 2026 11:10:53 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.cendio.se D6A2F1835BD0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cendio.se; s=20250112; t=1796033453; bh=vQnP0oqWx7o48FeDnadhF4oDTnBtSNTu2kIyhwfWnXk=; h=From:To:Cc:Subject:Date:From; b=kXCyZ7dwOeEdtKfeJvpGz1AKiKc+OmaPxRbRzahU76QA7n7//PmhjWtK/yMdCgm9u Td2ZrQIIuh4q7JK2roFmx4jI+ogFUEh535IhLDSfItibxWm+jDDsoUY0WT17ETidsa DQ42jXQ3+kldyma1hB+9dXUL18odlqimA/JHQBv90ADjfTmsc57AzUUHhH6mwvOots Lg4o1rQ+SKsSzydHNsAW07YCbxfuEna4MkV0wQPVqcg+lTjFawrLudlV9j0Xat6GPS fMb3MtaomOzt/LXDvosQyjovn8Btmuly5mEY8PyAyhFL97kmXgCiwQF++PsojvfE8o AK03Y0UncI66Q== X-Spam-Level: X-Spam-ASN: Received: from frifl.lkpg.cendio.se (unknown [IPv6:2a00:801:107:4700:e2be:3ff:fe9d:f5a]) by mail.cendio.se (Postfix) with ESMTPS id 13ACB1835BCF; Mon, 30 Nov 2026 11:10:52 +0100 (CET) From: Frida Flodin To: libtirpc-devel@lists.sourceforge.net Cc: linux-nfs@vger.kernel.org, Steve Dickson Subject: [PATCH] libtirpc: Use a non-variadic xdrproc_t on Apple platforms Date: Mon, 30 Nov 2026 11:10:52 +0100 Message-ID: <20261130101052.427213-1-frifl@cendio.com> X-Mailer: git-send-email 2.56.1 X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit xdrproc_t is declared as bool_t (*)(XDR *, ...), but the xdr routines called through it are ordinary non-variadic functions. That does not work on Apple arm64, where variadic arguments are passed on the stack while the xdr routines read their second argument from a register. Every RPC reply goes through such a call in xdr_union(), so an RPC server built on libtirpc cannot send any reply there. Apple's own rpc/xdr.h in the macOS SDK says about this prototype: This prototype is incorrect. One may not use a varargs function pointer in place of pointer to a function with positional parameters. All calls through xdrproc_t in libtirpc pass exactly two arguments, so use a two-argument prototype on Apple platforms. Other platforms are unchanged. The hand-written variadic prototype of svcauth_none_wrap() has to follow. resultproc_t has the same problem, but its callers pass different numbers of arguments, so it is left alone here. Signed-off-by: Frida Flodin --- src/svc_auth_none.c | 2 +- tirpc/rpc/xdr.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/svc_auth_none.c b/src/svc_auth_none.c index 5ca98e9..db67dff 100644 --- a/src/svc_auth_none.c +++ b/src/svc_auth_none.c @@ -38,7 +38,7 @@ #include static bool_t svcauth_none_destroy(SVCAUTH *); -static bool_t svcauth_none_wrap(SVCAUTH *, XDR *, bool_t (*)(XDR *, ...), char *); +static bool_t svcauth_none_wrap(SVCAUTH *, XDR *, xdrproc_t, char *); struct svc_auth_ops svc_auth_none_ops = { svcauth_none_wrap, diff --git a/tirpc/rpc/xdr.h b/tirpc/rpc/xdr.h index 80b35ce..8c8e738 100644 --- a/tirpc/rpc/xdr.h +++ b/tirpc/rpc/xdr.h @@ -136,6 +136,9 @@ typedef struct __rpc_xdr { */ #ifdef _KERNEL typedef bool_t (*xdrproc_t)(XDR *, void *, u_int); +#elif defined(__APPLE__) +/* See the note on xdrproc_t in Apple's rpc/xdr.h */ +typedef bool_t (*xdrproc_t)(XDR *, void *); #else /* * XXX can't actually prototype it, because some take three args!!! -- 2.56.0