From owner-freebsd-bugs@freebsd.org Thu Dec 12 16:09:30 2019 Return-Path: Delivered-To: freebsd-bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C8A881D56EF for ; Thu, 12 Dec 2019 16:09:30 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 47YdzG52lJz3Kt6 for ; Thu, 12 Dec 2019 16:09:30 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id AB2CF1D56EE; Thu, 12 Dec 2019 16:09:30 +0000 (UTC) Delivered-To: bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A9D941D56ED for ; Thu, 12 Dec 2019 16:09:30 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47YdzG3ywxz3Kt5 for ; Thu, 12 Dec 2019 16:09:30 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7F3A026333 for ; Thu, 12 Dec 2019 16:09:30 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id xBCG9UN6000145 for ; Thu, 12 Dec 2019 16:09:30 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id xBCG9UIQ000144 for bugs@FreeBSD.org; Thu, 12 Dec 2019 16:09:30 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 242606] Low capacity of Variable "IPSEC_MANUAL_REQID_MAX" crashes StrongSwan IPSec/IKEV2 VPN Server Date: Thu, 12 Dec 2019 16:09:30 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 11.2-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: geovaneg@mprs.mp.br X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 16:09:30 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D242606 Bug ID: 242606 Summary: Low capacity of Variable "IPSEC_MANUAL_REQID_MAX" crashes StrongSwan IPSec/IKEV2 VPN Server Product: Base System Version: 11.2-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: geovaneg@mprs.mp.br Hi, We have a IPSec/IKEV2 Server running in PFSense 2.4.4-RELEASE-p3 (amd64). The VPN server serves an average of 40 concurrent mobile clients. Each phase 1 tunnel created has three phase 2 tunnels. When the "reqid" variable reaches the value "16384", the "trap not found" e= rror logged in the logs below occurs and users can connect but cannot traffic ov= er the VPN. In my environment this value is reached approximately every 30 days. To resolve the issue, I need to stop the VPN service and start it again for= the variable to be reset. Logs samples: Aug 18 20:12:10 vpn2 charon: 02[KNL] creating acquire job for policy serverIP/32|/0 =3D=3D=3D clientIP/32|/0 with reqid {16384} Aug 18 20:12:10 vpn2 charon: 13[CFG] trap not found, unable to acquire reqid 16384 Dec 11 11:34:34 vpn2 charon: 14[KNL] creating acquire job for policy serverIP/32|/0 =3D=3D=3D clientIP/32|/0 with reqid {16384} Dec 11 11:34:34 vpn2 charon: 01[CFG] trap not found, unable to acquire reqid 16384 Strongswan developer response: That because of IPSEC_MANUAL_REQID_MAX (0x3fff =3D=3D 16383), file "include/uapi/linux/ipsec.h". Which is a strangely low limit (at least for keying daemons like strongSwan that manage reqids themselves) since reqids = are 32-bit numbers. reqids are currently allocated sequentially using a sttic counter (source:src/libcharon/kernel/kernel_interface.c#L328). The code that alloca= tes them does not know anything about the limit above (it doesn't even know or = care that it runs on a FreeBSD kernel). My report: https://forum.netgate.com/topic/148857/ipsec-ikev2-error-trap-not-found-una= ble-to-acquire-reqid Others reports: https://wiki.strongswan.org/issues/2315 https://lists.strongswan.org/pipermail/dev/2018-August/001929.html --=20 You are receiving this mail because: You are the assignee for the bug.=