Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Dec 2022 18:15:52 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 268378] parsing error in network.subr can result in infinite loop on bootup
Message-ID:  <bug-268378-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
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.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-268378-227>