From nobody Wed Dec 14 18:15:52 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 4NXNpJ5Q72z4kDfx for ; Wed, 14 Dec 2022 18:15:52 +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 4NXNpJ3QBGz3qXv for ; Wed, 14 Dec 2022 18:15:52 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1671041752; 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; bh=YMOItgT9RZo/kkvL+zGLNaiPXl9tn9kS8b3mr3KuAs8=; b=rx/i+7PswBgFGiuumorzOlxA91/qg3i84uQn1z9ntDN1xSQar0vGSGErDOnnpZsGioVe40 zYdRz6KabaEZRadKdtryuQBIzE9WgdzbNi8RxUnqDd82XJ2Vqx0Or851/ggUu8C5pNFYZv G3MdMW6bwNuLOkJXCBykbNpmsFhhpnCM3iqCe8M1VcT8tSBdOZV0+wCQZfwbWpJD3bwlhj kY4FCbHEXFkCPG/6mLpHmg+zLmz0uw48lvtpExl25URUYe6EIjqZZphvhV44z7BWYPLYDt RZEXbsAfxVjm5dHikyTUJrN6i2EnmcSEDIkGS35CVDiiJLcz0xDmbmr7lzR5PQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1671041752; a=rsa-sha256; cv=none; b=iHzoRcs47vk+S7URSx3BghpQ+kLD07AI7DntEobTYV5p4u05c+ofpcN2t71kNm0ZgpZhyI A0LIm3E3pvmALRcps1KyixPhYrZmDkVC0JQHeBMfte9DFHlkkZx430GpuwehaPLETHWtj7 b99e9Bn0pNAUOkBZt4b4mQ+i9w+I20ymuuEOhBcjUKDA3Ii0TSM7RbfbXeOszF1zltGS7m RJkDb56nQdWPyKqsty2mBzT7lre659KRF88C+vHz8lInfnLmzixZ6rF+bi9mL3rqdCNmLe JMBtWg4JSAt9KnsigoAM+wMMMrYQj2y3Z6nr7M1h4LgZ8Tw0zGIF20RfsHBMsQ== 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 4NXNpJ2SDRz13lS for ; Wed, 14 Dec 2022 18:15:52 +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 2BEIFqVH041107 for ; Wed, 14 Dec 2022 18:15:52 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 2BEIFqVq041106 for bugs@FreeBSD.org; Wed, 14 Dec 2022 18:15:52 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 268378] parsing error in network.subr can result in infinite loop on bootup Date: Wed, 14 Dec 2022 18:15:52 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: conf X-Bugzilla-Version: 13.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: jyoung15@gmail.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 attachments.created 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=3D268378 Bug ID: 268378 Summary: parsing error in network.subr can result in infinite loop on bootup Product: Base System Version: 13.1-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: conf Assignee: bugs@FreeBSD.org Reporter: jyoung15@gmail.com Created attachment 238789 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D238789&action= =3Dedit network.subr ifalias_af_common_handler patch While testing CARP as described in the handbook (https://docs.freebsd.org/en/books/handbook/advanced-networking/#carp), I discovered the system hangs on bootup if the passphrase contains only hex characters and a hyphen (-). Example from the handbook: ifconfig_em0=3D"inet 192.168.1.3 netmask 255.255.255.0" ifconfig_em0_alias0=3D"inet vhid 1 pass testpass alias 192.168.1.50/32" If instead of "testpass" something like "abc-def" is used, it will trigger = this issue. The issue was traced to ifalias_af_common_handler in network.subr. Line 1050 seems to have a typo with a miscellaneous closing brace ("$_tmpargs}"), however the issue is with the shell pattern matching at line 1052: ${_af}\ *[0-9a-fA-F]-*) This is intended to match the address range specification as described in rc.conf(5) (see man page starting at "It also possible to configure multipl= e IP addresses"). However, it also matches other scenarios such as the CARP example above. Due to the limitations of shell pattern matching, it may be better to use regular expression matching using expr(1). Attached is a proposed patch fi= le with more strict matching based on the examples in the rc.conf(5) descripti= on. --=20 You are receiving this mail because: You are the assignee for the bug.=