Compare commits
No commits in common. "imports/c8-beta/kmod-25-16.el8" and "c8" have entirely different histories.
imports/c8
...
c8
|
@ -0,0 +1,33 @@
|
|||
From c2996b5fa880e81f63c25e80a4157b2239e32c5d Mon Sep 17 00:00:00 2001
|
||||
From: Michal Suchanek <msuchanek@suse.de>
|
||||
Date: Mon, 10 Dec 2018 22:29:32 +0100
|
||||
Subject: [PATCH 1/2] depmod: prevent module dependency files missing during
|
||||
depmod invocation
|
||||
|
||||
depmod deletes the module dependency files before moving the temporary
|
||||
files in their place. This results in user seeing no dependency files
|
||||
while they are updated. Remove the unlink call. The rename call should
|
||||
suffice to move the new file in place and unlink the old one. It should
|
||||
also do both atomically so there is no window when no dependency file
|
||||
exists.
|
||||
|
||||
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
|
||||
---
|
||||
tools/depmod.c | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/tools/depmod.c b/tools/depmod.c
|
||||
index 989d9077926c..18c0d61b2db3 100644
|
||||
--- a/tools/depmod.c
|
||||
+++ b/tools/depmod.c
|
||||
@@ -2451,7 +2451,6 @@ static int depmod_output(struct depmod *depmod, FILE *out)
|
||||
break;
|
||||
}
|
||||
|
||||
- unlinkat(dfd, itr->name, 0);
|
||||
if (renameat(dfd, tmp, dfd, itr->name) != 0) {
|
||||
err = -errno;
|
||||
CRIT("renameat(%s, %s, %s, %s): %m\n",
|
||||
--
|
||||
2.33.0
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
From a06bacf500d56b72b5f9b121ebf7f6af9e3df185 Mon Sep 17 00:00:00 2001
|
||||
From: Michal Suchanek <msuchanek@suse.de>
|
||||
Date: Mon, 17 Dec 2018 23:46:28 +0100
|
||||
Subject: [PATCH 2/2] depmod: prevent module dependency files corruption due to
|
||||
parallel invocation.
|
||||
|
||||
Depmod does not use unique filename for temporary files. There is no
|
||||
guarantee the user does not attempt to run mutiple depmod processes in
|
||||
parallel. If that happens a temporary file might be created by
|
||||
depmod(1st), truncated by depmod(2nd), and renamed to final name by
|
||||
depmod(1st) resulting in corrupted file seen by user.
|
||||
|
||||
Due to missing mkstempat() this is more complex than it should be.
|
||||
Adding PID and timestamp to the filename should be reasonably reliable.
|
||||
Adding O_EXCL as mkstemp does fails creating the file rather than
|
||||
corrupting existing file.
|
||||
|
||||
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
|
||||
---
|
||||
tools/depmod.c | 9 +++++++--
|
||||
1 file changed, 7 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/tools/depmod.c b/tools/depmod.c
|
||||
index 18c0d61b2db3..0f7e33ccfd59 100644
|
||||
--- a/tools/depmod.c
|
||||
+++ b/tools/depmod.c
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
+#include <sys/time.h>
|
||||
#include <sys/utsname.h>
|
||||
|
||||
#include <shared/array.h>
|
||||
@@ -2398,6 +2399,9 @@ static int depmod_output(struct depmod *depmod, FILE *out)
|
||||
};
|
||||
const char *dname = depmod->cfg->dirname;
|
||||
int dfd, err = 0;
|
||||
+ struct timeval tv;
|
||||
+
|
||||
+ gettimeofday(&tv, NULL);
|
||||
|
||||
if (out != NULL)
|
||||
dfd = -1;
|
||||
@@ -2416,11 +2420,12 @@ static int depmod_output(struct depmod *depmod, FILE *out)
|
||||
int r, ferr;
|
||||
|
||||
if (fp == NULL) {
|
||||
- int flags = O_CREAT | O_TRUNC | O_WRONLY;
|
||||
+ int flags = O_CREAT | O_EXCL | O_WRONLY;
|
||||
int mode = 0644;
|
||||
int fd;
|
||||
|
||||
- snprintf(tmp, sizeof(tmp), "%s.tmp", itr->name);
|
||||
+ snprintf(tmp, sizeof(tmp), "%s.%i.%li.%li", itr->name, getpid(),
|
||||
+ tv.tv_usec, tv.tv_sec);
|
||||
fd = openat(dfd, tmp, flags, mode);
|
||||
if (fd < 0) {
|
||||
ERR("openat(%s, %s, %o, %o): %m\n",
|
||||
--
|
||||
2.33.0
|
||||
|
|
@ -520,26 +520,31 @@ finish_sandbox() {
|
|||
# Auxiliary functions to find symvers file
|
||||
make_kernel_file_names() {
|
||||
local krel="$1"
|
||||
local file="$2"
|
||||
local suffix="$3"
|
||||
shift
|
||||
local file="$1"
|
||||
shift
|
||||
|
||||
echo "${BASEDIR}/boot/${file}-${krel}${suffix}"
|
||||
echo "${BASEDIR}/lib/modules/${krel}/${file}${suffix}"
|
||||
for suffix in "$@"; do
|
||||
echo "${BASEDIR}/boot/${file}-${krel}${suffix}"
|
||||
echo "${BASEDIR}/lib/modules/${krel}/${file}${suffix}"
|
||||
done
|
||||
}
|
||||
|
||||
find_kernel_file() {
|
||||
local krel="$1"
|
||||
local file="$2"
|
||||
local suffix="$3"
|
||||
local print="$4"
|
||||
shift
|
||||
local file="$1"
|
||||
shift
|
||||
local print="$1"
|
||||
shift
|
||||
local i
|
||||
|
||||
if [[ "$print" != "" ]]; then
|
||||
make_kernel_file_names "$krel" "$file" "$suffix"
|
||||
make_kernel_file_names "$krel" "$file" "$@"
|
||||
return 0
|
||||
fi
|
||||
|
||||
for i in $(make_kernel_file_names "$krel" "$file" "$suffix"); do
|
||||
for i in $(make_kernel_file_names "$krel" "$file" "$@"); do
|
||||
if [[ -r "$i" ]]; then
|
||||
echo "$i"
|
||||
return 0
|
||||
|
@ -563,7 +568,7 @@ find_symvers_file() {
|
|||
local krel="$1"
|
||||
local print="$2"
|
||||
|
||||
find_kernel_file "$krel" symvers .gz "$print"
|
||||
find_kernel_file "$krel" symvers "$print" .xz .gz
|
||||
}
|
||||
|
||||
# find_systemmap_file:
|
||||
|
@ -573,7 +578,7 @@ find_systemmap_file() {
|
|||
local print="$2"
|
||||
local no_suffix=""
|
||||
|
||||
find_kernel_file "$krel" System.map "$no_suffix" "$print"
|
||||
find_kernel_file "$krel" System.map "$print" "$no_suffix"
|
||||
}
|
||||
|
||||
#### Main logic
|
||||
|
@ -615,6 +620,7 @@ update_modules_for_krel() {
|
|||
|
||||
if ! validate_weak_links $krel && [[ -z "$force_update" ]]; then
|
||||
global_link_state_restore $krel
|
||||
compatible_modules=()
|
||||
fi
|
||||
|
||||
# add compatible to installed
|
||||
|
@ -1147,7 +1153,7 @@ while :; do
|
|||
shift
|
||||
done
|
||||
|
||||
if [ ! -x "$dracut" ]
|
||||
if [ ! -x "$dracut" ] && [ -z "$no_initramfs" ]
|
||||
then
|
||||
echo "weak-modules: could not find dracut at $dracut"
|
||||
exit 1
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
Name: kmod
|
||||
Version: 25
|
||||
Release: 16%{?dist}
|
||||
Release: 20%{?dist}
|
||||
Summary: Linux kernel module management utilities
|
||||
|
||||
Group: System Environment/Kernel
|
||||
|
@ -14,6 +14,8 @@ Exclusiveos: Linux
|
|||
Patch01: kmod-signature-do-not-report-wrong-data-for-pkc-7-signatu.patch
|
||||
Patch02: kmod-libkmod-signature-implement-pkcs7-parsing-with-opens.patch
|
||||
Patch03: kmod-modprobe-ignore-builtin-module-on-recursive-removing.patch
|
||||
Patch04: 0001-depmod-prevent-module-dependency-files-missing-durin.patch
|
||||
Patch05: 0002-depmod-prevent-module-dependency-files-corruption-du.patch
|
||||
|
||||
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
|
||||
BuildRequires: chrpath
|
||||
|
@ -57,6 +59,8 @@ applications that wish to load or unload Linux kernel modules.
|
|||
%patch01 -p1
|
||||
%patch02 -p1
|
||||
%patch03 -p1
|
||||
%patch04 -p1
|
||||
%patch05 -p1
|
||||
|
||||
%build
|
||||
export V=1
|
||||
|
@ -125,6 +129,22 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf
|
|||
%{_libdir}/libkmod.so
|
||||
|
||||
%changelog
|
||||
* Wed Oct 11 2023 Eugene Syromiatnikov <esyr@redhat.com> - 25-20
|
||||
- Add symvers.xz support to weak-modules
|
||||
- Resolves: RHEL-8903
|
||||
|
||||
* Mon Nov 29 2021 Yauheni Kaliuta <ykaliuta@redhat.com> - 25-19
|
||||
- depmod: fix parallel execution issues
|
||||
Resolves: rhbz#2026938
|
||||
|
||||
* Fri Apr 16 2021 Yauheni Kaliuta <ykaliuta@redhat.com> - 25-18
|
||||
- weak-modules: do not require dracut wneh using --no-initramfs
|
||||
Resolves: rhbz#1935416
|
||||
|
||||
* Fri Dec 18 2020 Yauheni Kaliuta <ykaliuta@redhat.com> - 25-17
|
||||
- weak-modules: reset compatible_modules if configuration is not valid
|
||||
Resolves: rhbz#1907855
|
||||
|
||||
* Mon Dec 9 2019 Yauheni Kaliuta <ykaliuta@redhat.com> - 25-16
|
||||
- weak-modules: update_modules_for_krel: always finish sandbox
|
||||
- weak-modules: groupping: use dependencies of extra/ provider
|
||||
|
@ -276,7 +296,7 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf
|
|||
- Update to version 13
|
||||
|
||||
* Wed Mar 20 2013 Weiping Pan <wpan@redhat.com> - 12-3
|
||||
- Pull in weak-modules for kABI from Jon Masters <jcm@redhat.com>
|
||||
- Pull in weak-modules for kABI from Jon Masters <jcm@redhat.com>
|
||||
|
||||
* Mon Mar 18 2013 Josh Boyer <jwboyer@redhat.com>
|
||||
- Add patch to make rmmod understand built-in modules (rhbz 922187)
|
||||
|
|
Loading…
Reference in New Issue