Unnamed repository
59934ba188
We only allow one instance of kdump service running at each time by flock /var/lock/kdump which is opened as fd 9 in kdumpctl script. However a leaking fd issue has been discovered by SELinux: When executing a specific shell command (not the shell built-in but provided by other packages, in this case - restorecon) in kdumpctl, current shell will fork a new subshell for executing and the subshell will inherit open fd 9 from parent shell. And SELinux detects that subshell is holding the open fd and consider fd 9 is leaked. To avoid this kind of leaking, the most easy way seems to be breaking our kdumpctl code out into two parts: - A top level parent shell, which is only used to deal with the lock and invoking the subshell below. - A 2nd tier level subshell, which is closing the inherited open fd at very first and doing the rest of the kdumpctl job. So that it isn't leaking fd to its subshell when executing like restorecon, etc. To be easy to understand, the callgraph is roughly like below: [..] --> open(9) --> flock(9) --> fork --> close(9) <-- we close 9 right here --> main() <-- we're now doing the real job --> [..] --> fork() --> restorecon <-- we don't leak fd 9 to child process --> [..] --> [..] As shown above, a wrapper main() is added as the 2nd tier level shell in this kind of call model. So we can completely avoid leaking fd to subshell. Signed-off-by: WANG Chao <chaowang@redhat.com> Acked-by: Vivek Goyal <vgoyal@redhat.com> |
||
---|---|---|
po | ||
.gitignore | ||
98-kexec.rules | ||
dracut-kdump.sh | ||
dracut-module-setup.sh | ||
dracut-monitor_dd_progress | ||
firstboot_kdump.py | ||
kdump-lib.sh | ||
kdump.conf | ||
kdump.conf.5 | ||
kdump.init | ||
kdump.service | ||
kdump.sysconfig | ||
kdump.sysconfig.i386 | ||
kdump.sysconfig.ia64 | ||
kdump.sysconfig.ppc64 | ||
kdump.sysconfig.s390x | ||
kdump.sysconfig.x86_64 | ||
kdumpctl | ||
kexec-kdump-howto.txt | ||
kexec-tools-2.0.3-build-makedumpfile-eppic-shared-object.patch | ||
kexec-tools-2.0.3-disable-kexec-test.patch | ||
kexec-tools-2.0.4-kdump-x86-Process-multiple-Crash-kernel-in-proc-iome.patch | ||
kexec-tools-2.0.4-kexec-i386-Add-cmdline_add_memmap_internal-to-reduce.patch | ||
kexec-tools-2.0.4-makedumpfile-Add-vmap_area_list-definition-for-ppc-ppc64.patch | ||
kexec-tools-2.0.4-makedumpfile-cache-Allocate-buffers-at-initialization-t.patch | ||
kexec-tools-2.0.4-makedumpfile-cache-Reuse-entry-in-pending-list.patch | ||
kexec-tools-2.0.4-makedumpfile-disable-mmap.patch | ||
kexec-tools-2.0.4-makedumpfile-Fix-max_mapnr-issue-on-system-has-over-44-b.patch | ||
kexec-tools-2.0.4-makedumpfile-PATCH-Support-newer-kernels.patch | ||
kexec-tools-2.0.4-makedumpfile-Update-pfn_cyclic-when-the-cyclic-buffer-size-.patch | ||
kexec-tools-2.0.4-makedumpfile-Use-divideup-to-calculate-maximum-required-bit.patch | ||
kexec-tools-2.0.4-Revert-kexec-include-reserved-e820-sections-in-crash.patch | ||
kexec-tools-2.0.4-Revert-kexec-lengthen-the-kernel-command-line-image.patch | ||
kexec-tools.spec | ||
mkdumprd | ||
mkdumprd.8 | ||
rhcrashkernel-param | ||
sources | ||
zanata-notes.txt |