From: Silvan Nagl <mail@53c70r.de>
To: wireguard@lists.zx2c4.com
Subject: CentOS improper mount labeling on SELinux enabled systems
Date: Sat, 16 Jun 2018 22:47:14 +0200 [thread overview]
Message-ID: <5301fd31-01bb-3434-b8d2-837ffbaa04fe@53c70r.de> (raw)
Hello,
herewith I'm requesting a bug fix in the bash script 'wg-quick'. When
'DNS' is set in the interfaces configuration file 'wg-quick' will mount
the modified 'resolv.conf' with improper set SELinux labels which leads
to services not being able to access the 'resolv.conf' correctly. In my
test case it was 'syslogd_t' not being able to do the syscalls 'getattr
read' because the normal mount will be labeled as
'unconfined_u:object_r:user_tmp_t:s0' when i execute the script
manually. The fix would be easily done by adding the correct mount
labels as mount option:
mount -o context="system_u:object_r:net_conf_t:s0" -t tmpfs none /dev/shm
Greetings
Silvan
*** /bin/wg-quick 2018-06-13 19:29:40.000000000 +0200
--- wg-quick 2018-06-16 21:58:05.020633893 +0200
***************
*** 331,337 ****
} | unshare -m --propagation shared bash -c "$(cat <<-_EOF
set -e
mount --make-private /dev/shm
! mount -t tmpfs none /dev/shm
cat > /dev/shm/resolv.conf
mount -o remount,ro /dev/shm
mount -o bind,ro /dev/shm/resolv.conf /etc/resolv.conf
--- 331,337 ----
} | unshare -m --propagation shared bash -c "$(cat <<-_EOF
set -e
mount --make-private /dev/shm
! mount -o context="system_u:object_r:net_conf_t:s0" -t
tmpfs none /dev/shm
cat > /dev/shm/resolv.conf
mount -o remount,ro /dev/shm
mount -o bind,ro /dev/shm/resolv.conf /etc/resolv.conf
next reply other threads:[~2018-06-16 20:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-16 20:47 Silvan Nagl [this message]
2018-06-16 22:24 ` Jason A. Donenfeld
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5301fd31-01bb-3434-b8d2-837ffbaa04fe@53c70r.de \
--to=mail@53c70r.de \
--cc=wireguard@lists.zx2c4.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).