if-up might fail when triggered before temporary directory available
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ifupdown (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
It seems that if-up.d is activated before any temporary directory is available. On affected setup that caused a bash here-tag to fail, thus security settings were not applied to the interface leaving it open to attacks.
Documentation seems to be unclear, if any script should expect, that temporary directory would work. At least here it was quite unexpected that data processing in scripts without explicit request for disk operation failed due to that.
In my opinion, a CAVEAT in the interfaces (5) documentation might be sufficient in most cases.
A workaround for the affected setup was to create a separate temporary directory on /var/run (which is a tmpfs instance) and export it using TEMPDIR.
To reproduce:
cat <<OUTEREOF > /etc/network/
#!/bin/bash
echo "mounts"
cat /proc/mounts
echo "touch"
touch /tmp/xxx
cat <<EOF
Here document test
EOF
echo "mounts again"
cat /proc/mounts
OUTEREOF
chmod 0755 /etc/network/
touch /forcefsck
reboot
# cat /var/log/
mounts
...
tmpfs /run tmpfs rw,nosuid,
/dev/disk/
...
touch
touch: cannot touch '/tmp/xxx': Read-only file system
/etc/network/
mounts again
...
/dev/disk/
...
# lsb_release -rd
Description: Ubuntu 14.04.2 LTS
Release: 14.04
# apt-cache policy ifupdown
ifupdown:
Installed: 0.7.47.2ubuntu4.1
Candidate: 0.7.47.2ubuntu4.1
Version table:
*** 0.7.47.2ubuntu4.1 0
500 http://
100 /var/lib/
0.
500 http://
tags: | added: trusty |