lvmteam/lvm2

File descriptor leaked on vgchange invocation

Closed this issue · 1 comments

dkwo commented

On Void Linux x86_64-musl, the init (runit) invokes vgchange as

if [ -x /sbin/vgchange -o -x /bin/vgchange ]; then
    msg "Activating LVM devices..."
    vgchange --sysinit -a ay || emergency_shell
fi

and it produces the message

=> Activating LVM devices...
File descriptor 7 (/dev/nvme0n1) leaked on vgchange invocation. Parent PID 190: /bin/sh
  2 logical volume(s) in volume group "cryptroot" now active

Is this a bug, or the result of incorrect configuration?
Thanks.

Ref: void-linux/void-packages#42363

Hi,

the leak descriptor warning is the information for the admin that the software he is using for invoking/forking lvm2 command is actually buggy/insecure and should be reported to the upstream developer of it.

Basic problem is the the software is forking with opened more the 3 basic descriptors (stdin/out/err) and thus leaking potentially internally use fd to other application.

User can suppress this warning by setting envvar LVM_SUPPRESS_FD_WARNINGS=1 before running lvm2 command.