Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#820069: dhcpcd5: configures interface without being asked to

57 views
Skip to first unread message

Christian Pernegger

unread,
Apr 5, 2016, 4:10:03 AM4/5/16
to
Package: dhcpcd5
Version: 6.0.5-2
Severity: normal

Hi,

this box has its network interface configured statically in
/etc/network/interfaces. dhcpcd5 is installed but should not be active
at this time. (I would have liked to use DHCP, but neither dhcpcd5 nor
isc-dhcp-client work properly on a machine that only wakes once per
day for a few minutes and usessystemd. Also I sometimes use a wireless
dongle and that needs DHCP.)


Anyway, last night the box woke up and ...

Apr 05 02:00:30 mrmackey kernel: Restarting tasks ... done.
Apr 05 02:00:30 mrmackey dhcpcd[622]: eth0: carrier lost
Apr 05 02:00:30 mrmackey dhcpcd[622]: eth0: deleting host route to 192.168.0.25 via 127.0.0.1
Apr 05 02:00:30 mrmackey dhcpcd[622]: eth0: deleting route to 192.168.0.0/24
Apr 05 02:00:30 mrmackey dhcpcd[622]: eth0: deleting default route via 192.168.0.1
Apr 05 02:00:30 mrmackey systemd-timesyncd[364]: System time changed. Resyncing.
Apr 05 02:00:30 mrmackey systemd-sleep[807]: System resumed.
Apr 05 02:00:30 mrmackey systemd[1]: Requested transaction contradicts existing jobs: File exists
Apr 05 02:00:30 mrmackey systemd-logind[543]: Operation finished.
Apr 05 02:00:32 mrmackey dhcpcd[622]: eth0: carrier acquired
Apr 05 02:00:32 mrmackey kernel: r8169 0000:02:00.0 eth0: link up
Apr 05 02:00:32 mrmackey dhcpcd[622]: eth0: soliciting an IPv6 router
Apr 05 02:00:32 mrmackey dhcpcd[622]: eth0: rebinding lease of 192.168.0.25
Apr 05 02:00:41 mrmackey dhcpcd[622]: eth0: leased 192.168.0.25 for 86400 seconds
Apr 05 02:00:41 mrmackey dhcpcd[622]: eth0: adding host route to 192.168.0.25 via 127.0.0.1
Apr 05 02:00:41 mrmackey dhcpcd[622]: eth0: adding route to 192.168.0.0/24
Apr 05 02:00:41 mrmackey dhcpcd[622]: eth0: adding default route via 192.168.0.1
Apr 05 02:00:44 mrmackey dhcpcd[622]: eth0: no IPv6 Routers available

.... happily overwrote the manual interface configuration, causing the
box to get the wrong IP, breakage ensued.


There used to be log entries like:

Mär 31 10:30:43 mrmackey dhcpcd[543]: Not running dhcpcd because /etc/network/interfaces ... failed!
Mär 31 10:30:43 mrmackey dhcpcd[543]: defines some interfaces that will use a DHCP client ... failed!
Mär 31 10:30:43 mrmackey systemd[1]: dhcpcd.service: control process exited, code=exited status=6
Mär 31 10:30:43 mrmackey systemd[1]: Failed to start LSB: IPv4 DHCP client with IPv4LL support.
Mär 31 10:30:43 mrmackey systemd[1]: Unit dhcpcd.service entered failed state.

But that was the last one of this kind. dhcpcd ran without really
doing anything on the 1st and 2nd, then assigned the wrong IP on the
3rd, 4th and 5th. So it's basically on the fritz since the 8.4 update,
but the trigger may just as well have been the (rare) reboot that
followed it, not anything in the update itself.

/etc/network/interfaces is attached, I really don't see why it should
be running at all. I'm purging it for now, just to be sure, but I can
always reinstall it for tests.

Regards,
Christian



-- System Information:
Debian Release: 8.4
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.3.0-0.bpo.1-amd64 (SMP w/2 CPU cores)
Locale: LANG=de_AT.UTF-8, LC_CTYPE=de_AT.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages dhcpcd5 depends on:
ii libc6 2.19-18+deb8u4

Versions of packages dhcpcd5 recommends:
pn openresolv | resolvconf <none>

Versions of packages dhcpcd5 suggests:
pn dhcpcd-gtk <none>

-- no debconf information
interfaces

Adam McKenna

unread,
Jan 16, 2019, 11:30:03 PM1/16/19
to
severity 820069 important
tags 820069 security

I was hit by this bug last night.  After plugging a new Internet provider into my local network, my Debian router automatically added an IP address and default route to the new device.  This resulted in my entire home's Internet access being disrupted as the router tried to route traffic via the new device.  What's worse is that when the default route is removed it's automatically added back.

dhcpcd is STILL bringing up this interface even after disabling the DHCP server on the AT&T device.  The IP address that dhcpcd added is not visible in ifconfig.  It only shows up when you run 'ip addr list'.

This is very serious security bug.  This bug could easily be exploited by an attacker to force routing of traffic via the attacker's device.

Relevant logs/config files:

Jan 17 03:56:32 raspberrypi dhcpcd[16922]: eth0: Router Advertisement from fe80:[removed]
Jan 17 03:56:32 raspberrypi dhcpcd[16922]: eth0: adding address [removed ipv6 address]
Jan 17 03:56:32 raspberrypi dhcpcd[16922]: eth0: soliciting a DHCPv6 lease
Jan 17 03:56:35 raspberrypi dhcpcd[16922]: eth0: leased 192.168.1.67 for 86400 seconds
Jan 17 03:56:35 raspberrypi dhcpcd[16922]: eth0: adding route to 192.168.1.0/24
Jan 17 03:56:35 raspberrypi dhcpcd[16922]: eth0: adding default route via 192.168.1.254

/etc/network/interfaces.d/eth0
==============================
auto eth0
iface eth0 inet static
    address [removed]
    netmask 255.255.255.0

auto eth0:0
allow-hotplug eth0:0
iface eth0:0 inet static
    address 192.168.1.1
    netmask 255.255.255.0


/etc/dhcpcd.conf
===============
ddns-update-style none;
default-lease-time 600;
max-lease-time 7200;
authoritative;
log-facility local7;

subnet [removed] netmask 255.255.255.0 {
  range [removed] [removed];
  option broadcast-address [removed];
  option routers [removed];
  default-lease-time 600;
  max-lease-time 7200;
  option domain-name "local-network";
  option domain-name-servers 8.8.8.8, 8.8.4.4;
}

interface eth0
static ip_address [removed]
static domain_name_servers=8.8.8.8 8.8.4.4

Scott Leggett

unread,
Feb 8, 2019, 5:50:03 AM2/8/19
to
On Wed, 16 Jan 2019 20:20:04 -0800 Adam McKenna <ad...@flounder.net> wrote:
> I was hit by this bug last night. After plugging a new Internet provider
> into my local network, my Debian router automatically added an IP address
> and default route to the new device. This resulted in my entire home's
> Internet access being disrupted as the router tried to route traffic via
> the new device. What's worse is that when the default route is removed
> it's automatically added back.

Hi Adam,

Thanks for the report.

Do I understand correctly that you plugged some kind of USB modem into
your router which was running dhcpcd, so that the modem showed up as a
new network interface?

In that situation, as you found, dhcpcd will run in master mode by
default - see the manpage for what that means.

> dhcpcd is STILL bringing up this interface even after disabling the DHCP
> server on the AT&T device. The IP address that dhcpcd added is not visible
> in ifconfig. It only shows up when you run 'ip addr list'.

Yes, ifconfig is deprecated - please only use `ip ...`.
You can avoid this issue by adding `allowinterfaces ...` or
`denyinterfaces ...` as appropriate to the /etc/dhcpcd.conf file.

--
Regards,
Scott Leggett.
signature.asc

Scott Leggett

unread,
May 15, 2020, 11:00:05 AM5/15/20
to
Hi Adam,

On Fri, 8 Feb 2019 21:29:45 +1100 Scott Leggett <sc...@sl.id.au> wrote:
>
> You can avoid this issue by adding `allowinterfaces ...` or
> `denyinterfaces ...` as appropriate to the /etc/dhcpcd.conf file.

Have you tried updating the config file this way?

--
Regards,
Scott Leggett.
signature.asc

Martin-Éric Racine

unread,
Jun 23, 2022, 8:50:03 AM6/23/22
to
Package: dhcpcd5
Version: 9.4.1-0.2
Followup-For: Bug #820069

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

This bug happens because dhcpcd5 ships both an init.d script and systemd unit. In order for dhcpcd5 to correctly work as an ifupdown backend via /etc/network/interfaces, it should ship neither file.

Personally, I vote for removing both files. This way, dhcpcd5 could become a replacement for the ISC dhclient for anything that requires DHCP via /etc/network/interfaces. Those who want something controlled by systemd can always install networkd or even use network-manager.

Martin-Éric

- -- System Information:
Debian Release: bookworm/sid
APT prefers testing-debug
APT policy: (500, 'testing-debug'), (500, 'stable-security'), (500, 'testing')
Architecture: i386 (i586)

Kernel: Linux 5.18.0-2-686 (SMP w/1 CPU thread; PREEMPT)
Locale: LANG=fi_FI.UTF-8, LC_CTYPE=fi_FI.UTF-8 (charmap=UTF-8), LANGUAGE=fi:en


Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

LSM: AppArmor: enabled

Versions of packages dhcpcd5 depends on:

ii libc6 2.33-7
ii libudev1 251.2-5
ii lsb-base 11.2

Versions of packages dhcpcd5 recommends:
pn openresolv | resolvconf <none>

Versions of packages dhcpcd5 suggests:
pn dhcpcd-gtk <none>

pn dhcpcd-ui <none>

- -- Configuration Files:
/etc/dhcpcd.conf changed [not included]

- -- no debconf information

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEyJACx3qL7GpObXOQrh+Cd8S017YFAmK0XjkACgkQrh+Cd8S0
17aiuA//RdUPMCPkxIDzWQQNqOOymEjWfmeetA4Xrzkjbh4BTcddYqUbkjFQxbik
e/FdTgeNYa7FkfaWrraDwmbN3wN32Ri6aoR0cOkRoWrgViQIPk/XUk6OyLgFFiFP
osGTP1cEjrGWYMCKLVnRPQZk5w42iUBuHHB5k9X7ENgFZc8d0ASCUcRyN+33CDXB
N+v4Ab5RMlXd/eUrKiJSPF9I+rOj7CGGi2YoxbH06fc2F+odB/jU+Yc5N0nZpIjc
97q6IyVGnyF3WsCYYhSVivwm+ACmlyv2jolmH5hWSA4oY0sEy7W35/N7K/ajJpxb
1RINS6kuKRXg71uf8kRSM4EG/Lhe0dxFJJwEXonyhXCxeKys59a5kyvLbpcNftZO
8E9k2rffAKTvqpmrbt/Hk+gDXF9q43994hWsD8mtfDOx14ecfA3ZwgypspPq9lcq
YrBEYaOy29uS/hTYndUWE2L1MDM8P+AVtH2by6T9H5CXEeH2YHGATG8i7HSClJBL
cNyRJ8F+dSNMrgvfQrYT3hhcIAPchUPf9xOddYGF8GL+ANf1CtzyQTERUlQ30Th1
3KC8siTP+RjqZpifHiGxmZQVsUsgUCozZt9OyUYMvr01C4ZfDsVz7LUiQ4MM2HrH
OPIAWdnk5TazC0Ho9JmOTqQd7MWsebg4+ZIHxFL4PCp3bTfcjJ8=
=gMbF
-----END PGP SIGNATURE-----

Martin-Éric Racine

unread,
Jun 27, 2022, 11:40:04 AM6/27/22
to
I'm adopting this package.

This issue will be resolved by splitting the binaries, exit hooks and
manual pages into dhcpcd-base (provides: dhcp-client) and leaving only
the init.d script and systemd unit in dhcpcd5.

This way, those who only need the binaries as a backend for
/etc/network/interfaces (ifupdown) can install dhcpcd-base, while
those who also need the daemonized automation can install dhcpcd5.

Martin-Éric
0 new messages