From 5d7086de66ee90797bfcc8ce2506d3b22b62d387 Mon Sep 17 00:00:00 2001 From: claudio Date: Sun, 22 Sep 2024 08:40:37 +0000 Subject: [PATCH] Increase the default buffer size for AF_UNIX from 8192 to 32768. Using 8k for socketpairs was always on the low end side. Also this avoid a fatal error in sshd that can be triggered when the network stack is pushed hard enough to consume most of the allowed memory. By increasing the default buffer size a bit the error in sshd is avoided which is good enough for now. Long term a better solution for sonewconn() and especially sbchecklowmem() needs to be found. m_pool_used() returns not the right information for them. OK deraadt@ otto@ --- sys/kern/uipc_usrreq.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 1b5117b97bf..33e27319ea1 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_usrreq.c,v 1.209 2024/08/06 20:13:58 mvs Exp $ */ +/* $OpenBSD: uipc_usrreq.c,v 1.210 2024/09/22 08:40:37 claudio Exp $ */ /* $NetBSD: uipc_usrreq.c,v 1.18 1996/02/09 19:00:50 christos Exp $ */ /* @@ -234,13 +234,13 @@ uipc_setaddr(const struct unpcb *unp, struct mbuf *nam) * and don't really want to reserve the sendspace. Their recvspace should * be large enough for at least one max-size datagram plus address. */ -#define PIPSIZ 8192 +#define PIPSIZ 32768 u_int unpst_sendspace = PIPSIZ; /* [a] */ u_int unpst_recvspace = PIPSIZ; /* [a] */ u_int unpsq_sendspace = PIPSIZ; /* [a] */ u_int unpsq_recvspace = PIPSIZ; /* [a] */ -u_int unpdg_sendspace = 2*1024; /* [a] really max datagram size */ -u_int unpdg_recvspace = 16*1024; /* [a] */ +u_int unpdg_sendspace = 8192; /* [a] really max datagram size */ +u_int unpdg_recvspace = PIPSIZ; /* [a] */ const struct sysctl_bounded_args unpstctl_vars[] = { { UNPCTL_RECVSPACE, &unpst_recvspace, 0, SB_MAX }, -- 2.20.1