Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.bugs.dist > #1111088

Bug#1016103: lvm2: do not copy security attributes in initramfs hook

From Christian Göttsche <cgzones@googlemail.com>
Newsgroups linux.debian.bugs.dist
Subject Bug#1016103: lvm2: do not copy security attributes in initramfs hook
Date 2022-07-27 12:30 +0200
Message-ID <ENMsF-e9xa-1@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Package: lvm2
Version: 2.03.16-1
User: selinux-devel@lists.alioth.debian.org
Usertags: selinux

When copying files into the temporary working directory do not copy the
security context but use the default one for the target path.
Otherwise, e.g. when using SELinux, the context might not be allowed on
the destination filesystem and the process needs elevated access to the
original context.

(An alternative would be to use cp -dRp, which would be equivalent to
cp -a except not copying any extended attributes.)


diff --git a/debian/initramfs-tools/lvm2/hooks/lvm2
b/debian/initramfs-tools/lvm2/hooks/lvm2
index 6c186dc5a..f2588b625 100755
--- a/debian/initramfs-tools/lvm2/hooks/lvm2
+++ b/debian/initramfs-tools/lvm2/hooks/lvm2
@@ -16,7 +16,7 @@ esac

. /usr/share/initramfs-tools/hook-functions

-cp -a /etc/lvm/ ${DESTDIR}/etc/lvm/
+cp -aZ /etc/lvm/ ${DESTDIR}/etc/lvm/

mkdir -p $DESTDIR/lib/udev/rules.d/
for rules in 56-lvm.rules 69-lvm-metad.rules; do


See also https://salsa.debian.org/lvm-team/lvm2/-/merge_requests/3

Back to linux.debian.bugs.dist | Previous | Next | Find similar | Unroll thread


Thread

Bug#1016103: lvm2: do not copy security attributes in initramfs hook Christian Göttsche <cgzones@googlemail.com> - 2022-07-27 12:30 +0200

csiph-web