From nobody Fri Mar 11 12:21:43 2022 X-Original-To: net@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id CF5D11A05F14 for ; Fri, 11 Mar 2022 12:22:05 +0000 (UTC) (envelope-from Alexander@leidinger.net) Received: from mailgate.Leidinger.net (bastille.leidinger.net [89.238.82.207]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature ECDSA (P-256)) (Client CN "mailgate.leidinger.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KFQ6N5zZtz3JWZ for ; Fri, 11 Mar 2022 12:22:04 +0000 (UTC) (envelope-from Alexander@leidinger.net) Received: from outgoing.leidinger.net (p5b165562.dip0.t-ipconnect.de [91.22.85.98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-256) client-signature ECDSA (P-256)) (Client CN "outgoing.leidinger.net", Issuer "R3" (verified OK)) by mailgate.Leidinger.net (Postfix) with ESMTPSA id BCCBD1CC; Fri, 11 Mar 2022 13:22:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leidinger.net; s=outgoing-alex; t=1647001322; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=iXsWoSOB3DwmPcx0kPLZ9OBx4kzQBTZur8yrEH9Wbrw=; b=IEXSfvlTKu8Tncvk9d1nGMaszrOAViD6tnaglK7o02vrfv2Ocipo4vSq8NKnNM0TwLXLQm 8ReywgZAY6fntp+TvzfFuuu6xSkwzG0JoKxJ2iQlrXua7b38KrGYwGua8kffCQCtlzHL3k EItzMe5bqk0N5cDu4BWHu0spSy3aO4J18yjMpn94Ql4I5OwqGY8fZ/3m+C7MnN7uQwwsJA 2gUokYJp1mv6kNrULySYUdP3VghVdpup3Vv922rLAc7PqC4FhsSyjnj+VKS857KnJPkPCC lowj26sH6Dcml6tKqCI00oesV9nT2NKwQkNjEQA/aAd5+ZbG1QP+yCv9Yb8a1A== Received: from webmail.leidinger.net (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-256) server-digest SHA256) (Client did not present a certificate) by outgoing.leidinger.net (Postfix) with ESMTPS id EE660A290; Fri, 11 Mar 2022 13:21:44 +0100 (CET) Date: Fri, 11 Mar 2022 13:21:43 +0100 Message-ID: <20220311132143.Horde.JhU6vehr3ihMGo93zIP0MN7@webmail.leidinger.net> From: Alexander Leidinger To: net@freebsd.org, jails@freebsd.org Subject: Logging jid and uid for listen queue overflow? (resend) Accept-Language: de,en Content-Type: multipart/signed; boundary="=_opYhSpos5neXsfnlSa4U3kx"; protocol="application/pgp-signature"; micalg=pgp-sha256 List-Id: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@freebsd.org MIME-Version: 1.0 X-Rspamd-Queue-Id: 4KFQ6N5zZtz3JWZ X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=leidinger.net header.s=outgoing-alex header.b=IEXSfvlT; dmarc=pass (policy=quarantine) header.from=leidinger.net; spf=pass (mx1.freebsd.org: domain of Alexander@leidinger.net designates 89.238.82.207 as permitted sender) smtp.mailfrom=Alexander@leidinger.net X-Spamd-Result: default: False [-6.10 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[leidinger.net:s=outgoing-alex]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+mx:c]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; TO_DN_NONE(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MID_RHS_MATCH_FROMTLD(0.00)[]; DKIM_TRACE(0.00)[leidinger.net:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[leidinger.net,quarantine]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MLMMJ_DEST(0.00)[net]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:34240, ipnet:89.238.64.0/18, country:DE]; RCVD_TLS_ALL(0.00)[]; SUBJECT_HAS_QUESTION(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[91.22.85.98:received] X-ThisMailContainsUnwantedMimeParts: N This message is in MIME format and has been PGP signed. --=_opYhSpos5neXsfnlSa4U3kx Content-Type: text/plain; charset=utf-8; format=flowed; DelSp=Yes Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, sorry jails@ resend after subscription to net@ to have this mail not reject= ed. Any opinion about logging the jid and uid in case a jailed process is=20=20 causing=20listen queue overflows? Any strong objections about committing=20= =20 something=20like this? Code (tabs are most probably mangled up): ---snip--- diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index ab8e5d6e1b6..8fba46d7d03 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -699,12 +699,24 @@ sonewconn(struct socket *head, int connstatus) } KASSERT(sbuf_len(&descrsb) > 0, ("%s: sbuf creation failed", __func__)); - log(LOG_DEBUG, - "%s: pcb %p (%s): Listen queue overflow: " - "%i already in queue awaiting acceptance " - "(%d occurrences)\n", - __func__, head->so_pcb, sbuf_data(&descrsb), - qlen, overcount); + if (head->so_cred =3D=3D 0) { + log(LOG_DEBUG, + "%s: pcb %p (%s): Listen queue overflow: " + "%i already in queue awaiting acceptance " + "(%d occurrences)\n", + __func__, head->so_pcb, sbuf_data(&descrsb)= , + qlen, overcount); + } else { + log(LOG_DEBUG, "%s: pcb %p (%s):=20=20 Listen=20queue overflow: " + "%i already in queue awaiting acceptanc= e " + "(%d occurrences), euid %d, rgid=20=20 %d,=20jail %s\n", + __func__, head->so_pcb,=20=20 sbuf_data(&descrsb), +=20 qlen, overcount, + head->so_cred->cr_uid,=20=20 head->so_cred->cr_rgid, +=20 head->so_cred->cr_prison ? + head->so_cred->cr_prison->pr_name : + "not_jailed"); + } sbuf_delete(&descrsb); overcount =3D 0; ---snip--- --=20 http://www.Leidinger.net=20Alexander@Leidinger.net: PGP 0x8F31830F9F2772BF http://www.FreeBSD.org netchild@FreeBSD.org : PGP 0x8F31830F9F2772BF --=20 http://www.Leidinger.net=20Alexander@Leidinger.net: PGP 0x8F31830F9F2772BF http://www.FreeBSD.org netchild@FreeBSD.org : PGP 0x8F31830F9F2772BF --=_opYhSpos5neXsfnlSa4U3kx Content-Type: application/pgp-signature Content-Description: Digitale PGP-Signatur Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIzBAABCAAdFiEER9UlYXp1PSd08nWXEg2wmwP42IYFAmIrPtYACgkQEg2wmwP4 2IbsMw/+LEq5EyADztfO0AEdWjgpJwKeWwN11p/OBfz5cxfS4TR2Mps8WFV/UZeH /h7eEAxmAQOws2O7KjCf94WK21EZB9h8a4y8vCRh9JXWdrKbESMA8emntEuwoq9c QotsZxOV9OlDP96I1dj273gL4t36/Vy1DP7JvdX0ZREKj5RKQYH/QxcnJbKMpfel HPzYpaMxu4hIvOQkCAusKXmJV4rayqFbQmts81IGlqhGcgMS3QWX1KY7ZtwG+NOG B+s/1tKa1FNMyw3AUjEDP1PIGrPYP8MmUrvqq0xV2bewNh+6/UauCLbJCbNSWX8R iQ/EkxrrpWShxfPrb6rfyS7hHHdWlOHWHMWUJvy2cgX6P37Z4R46gt/sBXr9UOUe WAEx4C8tHWEoHbKVzgKaDwJvplFLoGR/Grx2fyKq32x9vGFZLtmSgqpHuaA1f7W0 81nW8nr07M4vARA0fnvAiuLOlUS0hsyjUFzEksEV+ooNXiYqU0LdGU0oFTEOseib 19JNJZ6kxadn1BnLtMC5lb4t1IFJa/b8fXRJT/qyYEb6gpJP3q3KPqeb3BVKsPzu QuQ8V9hxMhjw5A4wNNACcUo0lOCklycizjdmW19eNGEspZ9mhAzSYDTNos4NosiX rRhwiDXP4NMEUuQnfeJoLP8go4Pxwm08rB69YNHXH1FYhgkpceo= =7QAF -----END PGP SIGNATURE----- --=_opYhSpos5neXsfnlSa4U3kx--