From nobody Wed Jul 27 17:14:38 2022 X-Original-To: bugs@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 4LtL4H69vmz4X7DX for ; Wed, 27 Jul 2022 17:14:39 +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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LtL4H582gz42wR for ; Wed, 27 Jul 2022 17:14:39 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4LtL4H4CRpzQ2P for ; Wed, 27 Jul 2022 17:14:39 +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 26RHEdu2046573 for ; Wed, 27 Jul 2022 17:14:39 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 26RHEdIh046571 for bugs@FreeBSD.org; Wed, 27 Jul 2022 17:14:39 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 262743] Memory leak in security/strongswan's charon daemon when communicating over vici socket. Date: Wed, 27 Jul 2022 17:14:38 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: misc X-Bugzilla-Version: 13.1-RELEASE X-Bugzilla-Keywords: needs-qa X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: mskalski13@gmail.com X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658942079; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vv3WH7W0GGQv9UDiWxHJYDkeiP7RFlS2fPyJexuwrY8=; b=Mt8BQVB29AnVK04pcSpnDzq9mQh6vIzAunTf5qksDrn95lVj8QM2+/jDnB1W/xKiWKZRw0 CggtQ1+KKKgIvOvudnk+sJ9ylAkWSvTdQNMdw7aAJl9QE9n8knnC9Wn/SfmH0FLBwASp69 7EHvVjxpRnM+b0KsmLniuJYbzTRxJaFHnHB6R8rYaPr7pEd7hfYYQ29/d1yClZDnBU2U09 Gdq5vc6sPqteACXPz3phWRJ/YVidCVZCD7gFV6t9TFgKANnJoQTHMi7q6KEdW8hjdZiahA Vo/Rlp8I7if9K09w+ITSSx6yD4ZK5aPTiOAVKuMmxHKh0H6EBlWatLbMbHuH1g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658942079; a=rsa-sha256; cv=none; b=GJmKyxGIdYz+FGKjG5lWpVQMQEEfV+waYC/buI2PS+LEvs+gtBvI6Gpg7ddQukP4bMYJDu oHWBSZ+EuMMqyuU+fy+iAeY7WzQq0LCrQg4SzspZr5QkQkVaemiqBSkNelgyNYOH5ZSJuZ wcN5l1VsmraRxGKyAxoBKiuArY/Sa03KK09NzjWzES9CH5nrCYhhM0xnuViKw7MZW5Pa+E Nod0OyE5bQIn7C528atoEOKHz3n2PCKbpL/HaV6RbxlNdauQYpYQs1qAtbs84g/3cP3itD xsJhN9EvTaNEBoc2bnGo0rF/IFizolbh7BdLBdNHdoLClMlrJnYYZWvXGLOjnA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D262743 --- Comment #5 from Micha=C5=82 Skalski --- Thank you very much for the clues (In reply to Mark Millard from comment #4) Yes, using default value 12 (I used stock qemu VM image): # sysctl vm.pageout_oom_seq vm.pageout_oom_seq: 12 (In reply to Kubilay Kocak from comment #3) Result of `uname -a` (vm image FreeBSD-13.1-RELEASE)| FreeBSD freebsd 13.1-RELEASE FreeBSD 13.1-RELEASE releng/13.1-n250148-fc952ac2212 GENERIC amd64 and the same is for: FreeBSD freebsd 13.1-RELEASE FreeBSD 13.1-RELEASE releng/13.1-n250148-fc952ac2212 GENERIC arm64 Indeed, the packaged version (strongswan-5.9.6_2, either installed from bin= ary package or built from ports) behaves different. Still memory usage increase= s, but only RSS one (VMS does not change in observable period) and in much low= er scale, raise is rather logarithmic than linear. I compared then configure options for strongswan port and among other differences `--with-printf-hooks=3Dbuiltin` option is specified by default = for the port version.=20 So I tested again sources of strongswan 5.9.6 - the same as used for ports = and when the strongswan is configured with: ./configure --disable-kernel-netlink --enable-kernel-pfroute --enable-kernel-pfkey --disable-gmp --enable-openssl \ --enable-mediation --disable-scripts --with-group=3Dwheel --enable-gcm --enable-ccm --enable-pkcs11 \ --with-printf-hooks=3Dbuiltin (only `--with-printf-hooks=3Dbuiltin` is added) the memory usage is similar= to packaged version even for unpatched original sources. Without this option (= or when port version is compiled with `libc` printf-hook which I believe is default one) memory usage raises quickly as in this bug report. I must have missed that on previous tests, I didn't notice that VMS does not rise, and RSS raises on much smaller scale. Also checked for `printf-hooks=3Dvstr` and it is memory usage increase is slightly bigger than for `builtin`, but still VMS is constant. I'm still not sure if for `printf-hooks=3Dbuiltin` memory does not raise too much, I will check it. --=20 You are receiving this mail because: You are the assignee for the bug.=