From nobody Sun Sep 05 12:29:35 2021 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 4A00917A3F82 for ; Sun, 5 Sep 2021 12:29:35 +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 4H2W7M06PBz3mRN for ; Sun, 5 Sep 2021 12:29:35 +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 D53912DD9 for ; Sun, 5 Sep 2021 12:29:34 +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 185CTYoh014878 for ; Sun, 5 Sep 2021 12:29:34 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 185CTYrc014877 for bugs@FreeBSD.org; Sun, 5 Sep 2021 12:29:34 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 258287] [jail] Easily exhaust host kernel's numvnodes or dp_dirty_total in a jail which may cause Dos attack Date: Sun, 05 Sep 2021 12:29:35 +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: Unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: 1203405394@qq.com 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 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 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D258287 Bug ID: 258287 Summary: [jail] Easily exhaust host kernel's numvnodes or dp_dirty_total in a jail which may cause Dos attack Product: Base System Version: Unspecified Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: 1203405394@qq.com Hello=EF=BC=8Cwe find two underlying jails security issues to exhaust host'= s kernel's resources which may cause Dos attack. The first one is we can easily exhaust the host's `numvnodes` and reach the `maxvnodes` limit in a jail. Thecsecond one is we can keep produce dirty data in a jail and make the `dp_dirty_total` reachs `zfs_dirty_data_max` limit. As a result, other writ= ing request may delay. Reproduction steps: 1. We set up jails following the FreeBSD's handbook. 2. Use `ezjail-admin create` commands to create a normal malicious jail. 3. For numvnodes, we just keep creating directories using `Mkdir` command in the malicious jail. Host's numvnodes will keep rising until it reach the maxvnodes limit. 4. For `dp_dirty_total`, we observed that the `zfs_dirty_data_max` limit is 800Mi, we keep writing data to a file at high speed. As a result, the host's `dp_dirty_total` will reach the `zfs_dirty_data_max` limit and cause other writing request being delayed. Although it seems that there is no serious performance and functional impac= t on host, I wonder if there should be some ways to limit the per-jail `vnodes` = or `dp_dirty_total` like `rctl` which can avoid malicious jails to launch Dos attack. --=20 You are receiving this mail because: You are the assignee for the bug.=