Hello community, here is the log from the commit of package kmod for openSUSE:Factory checked in at 2014-04-15 07:35:27 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kmod (Old) and /work/SRC/openSUSE:Factory/.kmod.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "kmod" Changes: -------- --- /work/SRC/openSUSE:Factory/kmod/kmod.changes 2014-03-01 14:38:44.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.kmod.new/kmod.changes 2014-04-15 07:35:28.000000000 +0200 @@ -1,0 +2,48 @@ +Sat Apr 12 12:33:16 UTC 2014 - matwey.kornilov@gmail.com + +- Add 0001-Fix-recursion-loop-in-mod_count_all_dependencies-whe.patch +* Fix segfault at cycled deps (bnc#872715) + +------------------------------------------------------------------- +Tue Apr 8 08:36:22 UTC 2014 - mmarek@suse.cz + +- Remove the now obsolete test-files.tar.xz tarball + +------------------------------------------------------------------- +Mon Apr 7 19:07:17 UTC 2014 - mmarek@suse.com + +- Updated to kmod 17 +* Do not require xsltproc for build +* Parse softdeps stored in kernel modules +* Add experimental python bindings (not enabled in the package yet) +* Misc bugfixes +- Deleted patches that went upstream. Only the unsupported modules + feature remains: + 0002-modprobe-Recognize-allow-unsupported-modules-on-comm.patch + 0003-libkmod-config-Recognize-allow_unsupported_modules-i.patch + 0009-libkmod-Implement-filtering-of-unsupported-modules-o.patch + 0010-modprobe-Implement-allow-unsupported-modules.patch + +------------------------------------------------------------------- +Tue Mar 11 13:38:23 UTC 2014 - mmarek@suse.cz + +- Provide and obsolete module-init-tools (bnc#867442) + +------------------------------------------------------------------- +Fri Mar 7 09:25:02 UTC 2014 - mmarek@suse.cz + +- testsuite: Fix uname() during glibc startup + +------------------------------------------------------------------- +Wed Mar 5 14:50:34 UTC 2014 - mmarek@suse.cz + +- testsuite: Check the list of loaded modules after a test +- testsuite: Add test for modprobe --force +- testsuite: Do not provide finit_module(2) on older kernels +- Add some tests for kernels without finit_module(2) +- libkmod-module: Simplify kmod_module_insert_module() +- libkmod: Implement filtering of unsupported modules (fate#316971) +- modprobe: Implement --allow-unsupported-modules (fate#316971) +- make the %check section fatal + +------------------------------------------------------------------- Old: ---- 0001-Remove-rmmod-w-documentation-and-getopt-entry.patch kmod-16.tar.sign kmod-16.tar.xz New: ---- 0001-Fix-recursion-loop-in-mod_count_all_dependencies-whe.patch 0009-libkmod-Implement-filtering-of-unsupported-modules-o.patch 0010-modprobe-Implement-allow-unsupported-modules.patch kmod-17.tar.sign kmod-17.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kmod.spec ++++++ --- /var/tmp/diff_new_pack.A8Ytz4/_old 2014-04-15 07:35:29.000000000 +0200 +++ /var/tmp/diff_new_pack.A8Ytz4/_new 2014-04-15 07:35:29.000000000 +0200 @@ -21,7 +21,7 @@ Summary: Utilities to load modules into the kernel License: LGPL-2.1+ and GPL-2.0+ Group: System/Kernel -Version: 16 +Version: 17 Release: 0 Url: http://www.jonmasters.org/blog/2011/12/20/libkmod-replaces-module-init-tools... #Announce: https://lwn.net/Articles/577962/ @@ -30,18 +30,15 @@ #Git-Clone: git://git.kernel.org/pub/scm/utils/kernel/kmod/kmod Source: ftp://ftp.kernel.org/pub/linux/utils/kernel/kmod/%name-%version.tar.xz Source2: ftp://ftp.kernel.org/pub/linux/utils/kernel/kmod/%name-%version.tar.sign -Patch1: 0001-Remove-rmmod-w-documentation-and-getopt-entry.patch +Patch1: 0001-Fix-recursion-loop-in-mod_count_all_dependencies-whe.patch Patch2: 0002-modprobe-Recognize-allow-unsupported-modules-on-comm.patch Patch3: 0003-libkmod-config-Recognize-allow_unsupported_modules-i.patch +Patch9: 0009-libkmod-Implement-filtering-of-unsupported-modules-o.patch +Patch10: 0010-modprobe-Implement-allow-unsupported-modules.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: autoconf BuildRequires: automake BuildRequires: libtool -%if 0%{?suse_version} >= 1220 -BuildRequires: libxslt-tools -%else -BuildRequires: libxslt -%endif BuildRequires: pkgconfig >= 0.21 BuildRequires: xz %if 0%{?sles_version} @@ -67,8 +64,9 @@ License: GPL-2.0+ Group: System/Kernel Requires: kmod +Obsoletes: module-init-tools < 3.16 +Provides: module-init-tools = 3.16 Provides: modutils -Conflicts: module-init-tools %description compat kmod is a set of tools to handle common tasks with Linux kernel @@ -103,9 +101,10 @@ %{?gpg_verify: xz -dk "%{S:0}"; %gpg_verify %{S:2}} %setup -q %patch1 -p1 -touch man/rmmod.8 %patch2 -p1 %patch3 -p1 +%patch9 -p1 +%patch10 -p1 %build autoreconf -fi @@ -155,11 +154,11 @@ ln -s "%_bindir/kmod" "$b/bin/"; %if "%_libdir" != "/%_lib" ln -s "%_libdir/libkmod.so.2" "$b/%_lib/"; -ln -s "%_libdir/libkmod.so.2.2.6" "$b/%_lib/"; +ln -s "%_libdir/libkmod.so.2.2.7" "$b/%_lib/"; %endif %check -make check V=1 || :; +make check %post -n %lname -p /sbin/ldconfig ++++++ 0001-Fix-recursion-loop-in-mod_count_all_dependencies-whe.patch ++++++
From 48d4d7ba1acbb5c0955f75c6bdda9cf0935240fd Mon Sep 17 00:00:00 2001 From: "Matwey V. Kornilov" <matwey.kornilov@gmail.com> Date: Fri, 11 Apr 2014 19:43:18 +0400 Subject: [PATCH] Fix recursion loop in mod_count_all_dependencies() when subgraph has a cycle.
When cycle is detected in mod_count_all_dependencies, use total count of modules as an upper bound of needed memory. Correct number of nodes is determined by subsequent call of mod_fill_all_unique_dependencies(). --- tools/depmod.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/tools/depmod.c b/tools/depmod.c index 1aedaaf..c83dee1 100644 --- a/tools/depmod.c +++ b/tools/depmod.c @@ -1682,12 +1682,20 @@ static int depmod_load(struct depmod *depmod) return 0; } -static size_t mod_count_all_dependencies(const struct mod *mod) +static size_t mod_count_all_dependencies(const struct mod *mod, size_t upper_bound) { size_t i, count = 0; + /* cycle is detected */ + if (mod->dep_loop) + return upper_bound; + for (i = 0; i < mod->deps.count; i++) { const struct mod *d = mod->deps.array[i]; - count += 1 + mod_count_all_dependencies(d); + const size_t child = mod_count_all_dependencies(d, upper_bound); + if(child == upper_bound) + return child; + + count += 1 + child; } return count; } @@ -1722,12 +1730,12 @@ static int mod_fill_all_unique_dependencies(const struct mod *mod, const struct return err; } -static const struct mod **mod_get_all_sorted_dependencies(const struct mod *mod, size_t *n_deps) +static const struct mod **mod_get_all_sorted_dependencies(const struct mod *mod, size_t *n_deps, size_t count) { const struct mod **deps; size_t last = 0; - *n_deps = mod_count_all_dependencies(mod); + *n_deps = mod_count_all_dependencies(mod, count); if (*n_deps == 0) return NULL; @@ -1771,7 +1779,7 @@ static int output_deps(struct depmod *depmod, FILE *out) if (mod->deps.count == 0) goto end; - deps = mod_get_all_sorted_dependencies(mod, &n_deps); + deps = mod_get_all_sorted_dependencies(mod, &n_deps, depmod->modules.count); if (deps == NULL) { ERR("could not get all sorted dependencies of %s\n", p); goto end; @@ -1819,7 +1827,7 @@ static int output_deps_bin(struct depmod *depmod, FILE *out) continue; } - deps = mod_get_all_sorted_dependencies(mod, &n_deps); + deps = mod_get_all_sorted_dependencies(mod, &n_deps, depmod->modules.count); if (deps == NULL && n_deps > 0) { ERR("could not get all sorted dependencies of %s\n", p); continue; -- 1.8.1.4 ++++++ 0002-modprobe-Recognize-allow-unsupported-modules-on-comm.patch ++++++ --- /var/tmp/diff_new_pack.A8Ytz4/_old 2014-04-15 07:35:29.000000000 +0200 +++ /var/tmp/diff_new_pack.A8Ytz4/_new 2014-04-15 07:35:29.000000000 +0200 @@ -1,13 +1,14 @@ -From 472b40d53f6a9121ade7b969151b5b14268d1172 Mon Sep 17 00:00:00 2001 +From 820ce4a006eeb230ee597e7565b17cec464ef15d Mon Sep 17 00:00:00 2001 From: Michal Marek <mmarek@suse.cz> Date: Wed, 26 Feb 2014 13:48:55 +0100 -Subject: [PATCH 2/3] modprobe: Recognize --allow-unsupported-modules on +Subject: [PATCH 02/10] modprobe: Recognize --allow-unsupported-modules on commandline The option does not do anything yet, but it does not return error either. References: fate#316971 +Patch-mainline: never --- tools/modprobe.c | 5 +++++ 1 file changed, 5 insertions(+) ++++++ 0003-libkmod-config-Recognize-allow_unsupported_modules-i.patch ++++++ --- /var/tmp/diff_new_pack.A8Ytz4/_old 2014-04-15 07:35:29.000000000 +0200 +++ /var/tmp/diff_new_pack.A8Ytz4/_new 2014-04-15 07:35:29.000000000 +0200 @@ -1,10 +1,11 @@ -From da1cb1dd16edb2533ac431793e5bb3d01b243cae Mon Sep 17 00:00:00 2001 +From 717e10547654bceebbcb84144be72a40d78e577a Mon Sep 17 00:00:00 2001 From: Michal Marek <mmarek@suse.cz> Date: Wed, 26 Feb 2014 13:53:38 +0100 -Subject: [PATCH 3/3] libkmod-config: Recognize allow_unsupported_modules in +Subject: [PATCH 03/10] libkmod-config: Recognize allow_unsupported_modules in the configuration References: fate#316971 +Patch-mainline: never --- libkmod/libkmod-config.c | 3 +++ 1 file changed, 3 insertions(+) ++++++ 0009-libkmod-Implement-filtering-of-unsupported-modules-o.patch ++++++
From 36bb8bc7f4100d7ffc4d6d0436e36e48fa7c075f Mon Sep 17 00:00:00 2001 From: Michal Marek <mmarek@suse.cz> Date: Wed, 5 Mar 2014 14:40:14 +0100 Subject: [PATCH 09/10] libkmod: Implement filtering of unsupported modules (off by default)
References: fate#316971 Patch-mainline: never --- libkmod/libkmod-config.c | 12 ++++++++++-- libkmod/libkmod-internal.h | 1 + libkmod/libkmod-module.c | 31 +++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 2 deletions(-) diff --git a/libkmod/libkmod-config.c b/libkmod/libkmod-config.c index 3950923..385a224 100644 --- a/libkmod/libkmod-config.c +++ b/libkmod/libkmod-config.c @@ -663,8 +663,16 @@ static int kmod_config_parse(struct kmod_config *config, int fd, ERR(ctx, "%s: command %s is deprecated and not parsed anymore\n", filename, cmd); } else if (streq(cmd, "allow_unsupported_modules")) { - /* dummy option for now */ - ; + char *param = strtok_r(NULL, "\t ", &saveptr); + + if (param == NULL) + goto syntax_error; + if (streq(param, "yes") || streq(param, "1")) + config->block_unsupported = 0; + else if (streq(param, "no") || streq(param, "0")) + config->block_unsupported = 1; + else + goto syntax_error; } else { syntax_error: ERR(ctx, "%s line %u: ignoring bad line starting with '%s'\n", diff --git a/libkmod/libkmod-internal.h b/libkmod/libkmod-internal.h index 0180124..596db5d 100644 --- a/libkmod/libkmod-internal.h +++ b/libkmod/libkmod-internal.h @@ -118,6 +118,7 @@ struct kmod_config { struct kmod_list *softdeps; struct kmod_list *paths; + int block_unsupported; }; int kmod_config_new(struct kmod_ctx *ctx, struct kmod_config **config, const char * const *config_paths) __attribute__((nonnull(1, 2,3))); diff --git a/libkmod/libkmod-module.c b/libkmod/libkmod-module.c index b94abd4..ee52b97 100644 --- a/libkmod/libkmod-module.c +++ b/libkmod/libkmod-module.c @@ -769,6 +769,24 @@ KMOD_EXPORT int kmod_module_remove_module(struct kmod_module *mod, extern long init_module(const void *mem, unsigned long len, const char *args); +static int check_module_supported(struct kmod_module *mod) +{ + char **strings; + int i, count; + struct kmod_elf *elf; + + elf = kmod_file_get_elf(mod->file); + count = kmod_elf_get_strings(elf, ".modinfo", &strings); + if (count < 0) + return count; + for (i = 0; i < count; i++) + if (streq(strings[i], "supported=yes") || + streq(strings[i], "supported=external")) { + return 1; + } + return 0; +} + /** * kmod_module_insert_module: * @mod: kmod module @@ -794,6 +812,7 @@ KMOD_EXPORT int kmod_module_insert_module(struct kmod_module *mod, struct kmod_elf *elf; const char *path; const char *args = options ? options : ""; + const struct kmod_config *config = kmod_get_config(mod->ctx); if (mod == NULL) return -ENOENT; @@ -810,6 +829,18 @@ KMOD_EXPORT int kmod_module_insert_module(struct kmod_module *mod, return err; } + if (config->block_unsupported) { + err = check_module_supported(mod); + if (err < 0) + return err; + else if (err == 0) { + ERR(mod->ctx, "module '%s' is unsupported\n", mod->name); + ERR(mod->ctx, "Use --allow-unsupported or set allow_unsupported_modules 1 in\n"); + ERR(mod->ctx, "/etc/modprobe.d/10-unsupported-modules.conf\n"); + return -EPERM; + } + } + if (kmod_file_get_direct(mod->file)) { unsigned int kernel_flags = 0; -- 1.8.4.5 ++++++ 0010-modprobe-Implement-allow-unsupported-modules.patch ++++++
From 714b9b5241f5fc6120c74f35d6a374e032bad6df Mon Sep 17 00:00:00 2001 From: Michal Marek <mmarek@suse.cz> Date: Wed, 5 Mar 2014 15:02:44 +0100 Subject: [PATCH 10/10] modprobe: Implement --allow-unsupported-modules
References: fate#316971 Patch-mainline: never --- Makefile.am | 4 +++- libkmod/libkmod-unsupported.c | 9 +++++++++ libkmod/libkmod-unsupported.h | 8 ++++++++ tools/modprobe.c | 7 ++++++- 4 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 libkmod/libkmod-unsupported.c create mode 100644 libkmod/libkmod-unsupported.h diff --git a/Makefile.am b/Makefile.am index 46b7652..9986730 100644 --- a/Makefile.am +++ b/Makefile.am @@ -78,7 +78,9 @@ libkmod_libkmod_la_LIBADD = libkmod/libkmod-util.la \ ${liblzma_LIBS} ${zlib_LIBS} noinst_LTLIBRARIES += libkmod/libkmod-internal.la -libkmod_libkmod_internal_la_SOURCES = $(libkmod_libkmod_la_SOURCES) +libkmod_libkmod_internal_la_SOURCES = $(libkmod_libkmod_la_SOURCES) \ + libkmod/libkmod-unsupported.c \ + libkmod/libkmod-unsupported.h libkmod_libkmod_internal_la_LDFLAGS = $(AM_LDFLAGS) \ -Wl,--version-script=$(top_srcdir)/libkmod/libkmod.sym libkmod_libkmod_internal_la_DEPENDENCIES = $(libkmod_libkmod_la_DEPENDENCIES) diff --git a/libkmod/libkmod-unsupported.c b/libkmod/libkmod-unsupported.c new file mode 100644 index 0000000..7ef9fc8 --- /dev/null +++ b/libkmod/libkmod-unsupported.c @@ -0,0 +1,9 @@ +#include "libkmod-internal.h" +#include "libkmod-unsupported.h" + +void kmod_internal_allow_unsupported(struct kmod_ctx *ctx) +{ + struct kmod_config *config = (struct kmod_config *)kmod_get_config(ctx); + + config->block_unsupported = 0; +} diff --git a/libkmod/libkmod-unsupported.h b/libkmod/libkmod-unsupported.h new file mode 100644 index 0000000..a95b4a2 --- /dev/null +++ b/libkmod/libkmod-unsupported.h @@ -0,0 +1,8 @@ +#pragma once + +/* + * This function implements the --allow-unsupported-modules modprobe + * option. It is not part of the kmod API and not exported by the shared + * library + */ +void kmod_internal_allow_unsupported(struct kmod_ctx *ctx); diff --git a/tools/modprobe.c b/tools/modprobe.c index 589cc07..7d0949d 100644 --- a/tools/modprobe.c +++ b/tools/modprobe.c @@ -33,6 +33,7 @@ #include "libkmod.h" #include "libkmod-array.h" +#include "libkmod-unsupported.h" #include "macro.h" #include "kmod.h" @@ -755,6 +756,7 @@ static int do_modprobe(int argc, char **orig_argv) int do_remove = 0; int do_show_config = 0; int do_show_modversions = 0; + int allow_unsupported = 0; int err; argv = prepend_options_from_env(&argc, orig_argv); @@ -838,7 +840,7 @@ static int do_modprobe(int argc, char **orig_argv) kversion = optarg; break; case 128: - /* --allow-unsupported-modules does nothing for now */ + allow_unsupported = 1; break; case 's': env_modprobe_options_append("-s"); @@ -910,6 +912,9 @@ static int do_modprobe(int argc, char **orig_argv) log_setup_kmod_log(ctx, verbose); + if (allow_unsupported) + kmod_internal_allow_unsupported(ctx); + kmod_load_resources(ctx); if (do_show_config) -- 1.8.4.5 ++++++ kmod-16.tar.xz -> kmod-17.tar.xz ++++++ ++++ 25045 lines of diff (skipped) -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@hilbert.suse.de