Summary: | dhcpd-3.0_p2-r1 writes lease file before dropping root causing infinite loop | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Henry Yang <henryy> |
Component: | [OLD] Server | Assignee: | Max Kalika (RETIRED) <max> |
Status: | RESOLVED FIXED | ||
Severity: | major | CC: | maxwang_tw |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 31840 |
Description
Henry Yang
2003-08-12 22:45:43 UTC
I had a discussion with our networking guy and we came to the conclusion that creating/mucking with the leases file during install is a really bad idea. I'm removing the creation of the lease files from the ebuild (the ebuild will only make the /var/lib/dhcp dir). The dhcpd.leases file will be created *if needed* and with proper permissions in the startup script. Let me test this locally and I'll commit if all checks out. Should be fixed, please try it. the lease file is still owned by root even after using the new rc script. It seems that dhcpd will make a copy of dhcpd.lease BEFORE dropping root. Maybe a patch to the code is needed to drop to root BEFORE doing anything to the lease file. I'm now experiencing the same exact problem as the first comment. My DHCP server has been running fine for quite sometime, but the last 2 days, I've seen the same syslog messages: Feb 1 10:26:06 foo dhcpd: Wrote 0 deleted host decls to leases file. Feb 1 10:26:06 foo dhcpd: Wrote 0 new dynamic host decls to leases file. Feb 1 10:26:06 foo dhcpd: Wrote 0 deleted host decls to leases file. Feb 1 10:26:06 foo dhcpd: Wrote 0 new dynamic host decls to leases file. I'm always unable to restart the dhcpd server when this occurs and the only option is to reboot. I'm not running chroot'd enviro. My only change is that I implemented GRSecurity in the kernel set to MEDIUM. I've recompiled the kernel without GRSecurity support today.. not sure if things will improve. Lastnight I removed my dhcp distfiles and preformed a re-emerge on it.. no change today, still experienced the error this morning while my laptop was trying to start eth0 and get an IP. My System: Linux foo 2.4.22-gentoo-r5 #5 Thu Jan 22 20:16:51 MST 2004 i686 Pentium II (Deschutes) GenuineIntel GNU/Linux DHCP version: dhcp-3.0_p2-r2 Noticed on reboot that ownership of dhcpd.leases was changed before dhcpd start * Setting ownership on dhcpd.leases ... * Starting dhcpd ... checking the permissions in /var/lib/dhcp, noticed that dhcpd.leases is still owned by root -rw-r--r-- 1 root root 2062 Feb 1 11:48 dhcpd.leases -rw-r--r-- 1 dhcp dhcp 467 Jan 31 09:20 dhcpd.leases.1075566007 -rw-r--r-- 1 dhcp dhcp 467 Jan 31 09:20 dhcpd.leases.1075566008 -rw-r--r-- 1 dhcp dhcp 467 Jan 31 09:20 dhcpd.leases.1075566009 -rw-r--r-- 1 dhcp dhcp 467 Jan 31 09:20 dhcpd.leases.1075566010 -rw-r--r-- 1 dhcp dhcp 467 Jan 31 09:20 dhcpd.leases.1075566011 -rw-r--r-- 1 dhcp dhcp 467 Jan 31 09:20 dhcpd.leases.1075566012 -rw-r--r-- 1 dhcp dhcp 467 Jan 31 09:20 dhcpd.leases.1075566013 -rw-r--r-- 1 dhcp dhcp 467 Jan 31 09:20 dhcpd.leases.1075566014 -rw-r--r-- 1 dhcp dhcp 467 Jan 31 09:20 dhcpd.leases.1075566015 -rw-r--r-- 1 dhcp dhcp 467 Jan 31 09:20 dhcpd.leases.1075566016 -rw-r--r-- 1 dhcp dhcp 467 Jan 31 09:20 dhcpd.leases.1075566017 -rw-r--r-- 1 dhcp dhcp 467 Jan 31 09:20 dhcpd.leases.1075566018 -rw-r--r-- 1 dhcp dhcp 467 Jan 31 09:20 dhcpd.leases.1075566019 -rw-r--r-- 1 dhcp dhcp 467 Jan 31 22:46 dhcpd.leases.1075614384 -rw-r--r-- 1 dhcp dhcp 467 Jan 31 22:46 dhcpd.leases.1075614385 -rw-r--r-- 1 dhcp dhcp 467 Jan 31 22:46 dhcpd.leases.1075614386 -rw-r--r-- 1 dhcp dhcp 467 Jan 31 22:46 dhcpd.leases.1075614387 -rw-r--r-- 1 dhcp dhcp 467 Jan 31 22:46 dhcpd.leases.1075614388 -rw-r--r-- 1 dhcp dhcp 467 Jan 31 22:46 dhcpd.leases.1075614389 -rw-r--r-- 1 dhcp dhcp 467 Jan 31 22:46 dhcpd.leases.1075614390 -rw-r--r-- 1 dhcp dhcp 467 Jan 31 22:46 dhcpd.leases.1075614391 -rw-r--r-- 1 dhcp dhcp 467 Jan 31 22:46 dhcpd.leases.1075614392 -rw-r--r-- 1 dhcp dhcp 467 Jan 31 22:46 dhcpd.leases.1075614393 -rw-r--r-- 1 dhcp dhcp 467 Jan 31 22:46 dhcpd.leases.1075614394 -rw-r--r-- 1 dhcp dhcp 467 Jan 31 22:46 dhcpd.leases.1075614395 -rw-r--r-- 1 dhcp dhcp 467 Jan 31 22:46 dhcpd.leases.1075614396 -rw-r--r-- 1 dhcp dhcp 467 Feb 1 10:25 dhcpd.leases.1075656354 -rw-r--r-- 1 dhcp dhcp 467 Feb 1 10:25 dhcpd.leases.1075656355 -rw-r--r-- 1 dhcp dhcp 467 Feb 1 10:25 dhcpd.leases.1075656356 -rw-r--r-- 1 dhcp dhcp 467 Feb 1 10:25 dhcpd.leases.1075656357 -rw-r--r-- 1 dhcp dhcp 467 Feb 1 10:25 dhcpd.leases.1075656358 -rw-r--r-- 1 dhcp dhcp 467 Feb 1 10:26 dhcpd.leases.1075656359 -rw-r--r-- 1 dhcp dhcp 467 Feb 1 10:26 dhcpd.leases.1075656360 -rw-r--r-- 1 dhcp dhcp 467 Feb 1 10:26 dhcpd.leases.1075656361 -rw-r--r-- 1 dhcp dhcp 467 Feb 1 10:26 dhcpd.leases.1075656362 -rw-r--r-- 1 dhcp dhcp 467 Feb 1 10:26 dhcpd.leases.1075656363 -rw-r--r-- 1 dhcp dhcp 467 Feb 1 10:26 dhcpd.leases.1075656364 -rw-r--r-- 1 dhcp dhcp 467 Feb 1 10:26 dhcpd.leases.1075656365 -rw-r--r-- 1 dhcp dhcp 467 Feb 1 10:26 dhcpd.leases.1075656366 -rw-r--r-- 1 dhcp dhcp 2260 Feb 1 11:02 dhcpd.leases~ Thanks That problem may be caused by the grsecurity "hard link restriction", which is part of the LOW security setting. Thats why dhcpd was not able to create a hard link to the root owned lease file. The rc script should be checked again to see if it's compatible with grsecurity. please try -r3 and report your findings. this should be fixed in -r3. |