From owner-freebsd-bugs@freebsd.org Tue Mar 30 00:06:43 2021 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 D2F755B13C8 for ; Tue, 30 Mar 2021 00:06:43 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 4F8V9b5R1qz3CKQ for ; Tue, 30 Mar 2021 00:06:43 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id B8A025B1586; Tue, 30 Mar 2021 00:06:43 +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 B862A5B13C7 for ; Tue, 30 Mar 2021 00:06:43 +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 4F8V9b4pF1z3CDt for ; Tue, 30 Mar 2021 00:06:43 +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 9265B1C6BB for ; Tue, 30 Mar 2021 00:06:43 +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 12U06hCg007667 for ; Tue, 30 Mar 2021 00:06:43 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 12U06h41007666 for bugs@FreeBSD.org; Tue, 30 Mar 2021 00:06:43 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 254649] 12.2-RELEASE: possible memory overrun in the loader(8) Date: Tue, 30 Mar 2021 00:06:43 +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: 12.2-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: eugen@freebsd.org 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 cc 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.34 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2021 00:06:43 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D254649 Bug ID: 254649 Summary: 12.2-RELEASE: possible memory overrun in the loader(8) Product: Base System Version: 12.2-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: eugen@freebsd.org CC: imp@FreeBSD.org, kevans@freebsd.org, tsoome@freebsd.org Hi! I've found that adding loading of several kernel modules to /boot/loader.co= nf can result in failure to mount ZFS root file system at boot time and going = to=20 mountroot> prompt. I've faced to problem after successfully installing and running FreeBSD 12.2/amd64 as VM guest at some hoster providing cheap 1GB RAM/20GB HDD plan. I've reproduced the problem using my own VirtualBox. How to repeat: Use any hypervisor to create new VM for FreeBSD 12.2-RELEASE/amd64 with 102= 4MB RAM and 20GB HDD (thin provisioning is OK, network is not required nor used= ). Attach official FreeBSD-12.2-RELEASE-amd64-disc1.iso image to virtual CD and boot it. Do not use bsdinstall installation procedures but enter Shell dire= ctly to perform installation this way (maybe replace ada0 with da0 or vtbd0 depending on hypervisor): # make MBR with two slices, first one for swap (2GB), the rest for ZFS boot pool gpart destroy -F ada0 gpart create -s MBR ada0 gpart add -b 504 -t freebsd -s 2g ada0 glabel label swap ada0s1 gpart add -t freebsd ada0 # install bootloaders according to zfsboot(8) manual page gpart bootcode -b /boot/boot0 ada0 gpart set -a active -i 2 ada0 boot0cfg -s 2 ada0 dd if=3D/dev/zero of=3D/dev/ada0s2 count=3D2 dd if=3D/boot/zfsboot of=3D/dev/ada0s2 count=3D1 dd if=3D/boot/zfsboot of=3D/dev/ada0s2 iseek=3D1 oseek=3D1024 # create and populate ZFS boot pool named "os" zpool create -f -O reservation=3D100m -O compression=3Dlz4 -O atime=3Doff -= m / -R /mnt os /dev/ada0s2 cd /mnt tar xf /usr/freebsd-dist/kernel.txz tar xf /usr/freebsd-dist/base.txz cat > boot/loader.conf < etc/rc.conf < etc/fstab < To recover, one needs to escape to loader prompt at boot time and use "unlo= ad" command then manually load kernel, opensolaris.ko and zfs.ko then proceed w= ith booting. --=20 You are receiving this mail because: You are the assignee for the bug.=