import kmod-25-16.el8
This commit is contained in:
commit
5235acb8c4
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
SOURCES/kmod-25.tar.xz
|
1
.kmod.metadata
Normal file
1
.kmod.metadata
Normal file
@ -0,0 +1 @@
|
||||
761ee76bc31f5db10d470dad607a5f9d68acef68 SOURCES/kmod-25.tar.xz
|
6
SOURCES/depmod.conf.dist
Normal file
6
SOURCES/depmod.conf.dist
Normal file
@ -0,0 +1,6 @@
|
||||
#
|
||||
# depmod.conf
|
||||
#
|
||||
|
||||
# override default search ordering for kmod packaging
|
||||
search updates extra built-in weak-updates
|
@ -0,0 +1,328 @@
|
||||
From 391b4714b495183baefa9cb10ac8e1600c166a59 Mon Sep 17 00:00:00 2001
|
||||
From: Yauheni Kaliuta <yauheni.kaliuta@redhat.com>
|
||||
Date: Fri, 1 Feb 2019 22:20:02 +0200
|
||||
Subject: [PATCH] libkmod-signature: implement pkcs7 parsing with openssl
|
||||
|
||||
The patch adds data fetching from the PKCS#7 certificate using
|
||||
openssl library (which is used by scripts/sign-file.c in the linux
|
||||
kernel to sign modules).
|
||||
|
||||
In general the certificate can contain many signatures, but since
|
||||
kmod (modinfo) supports only one signature at the moment, only first
|
||||
one is taken.
|
||||
|
||||
With the current sign-file.c certificate doesn't contain signer
|
||||
key's fingerprint, so "serial number" is used for the key id.
|
||||
|
||||
Signed-off-by: Yauheni Kaliuta <yauheni.kaliuta@redhat.com>
|
||||
---
|
||||
Makefile.am | 4 +-
|
||||
configure.ac | 11 ++
|
||||
libkmod/libkmod-internal.h | 3 +
|
||||
libkmod/libkmod-module.c | 3 +
|
||||
libkmod/libkmod-signature.c | 197 +++++++++++++++++++++++++++++++++++-
|
||||
5 files changed, 213 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/Makefile.am b/Makefile.am
|
||||
index 1ab1db585316..de1026f8bd46 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -35,6 +35,8 @@ SED_PROCESS = \
|
||||
-e 's,@liblzma_LIBS\@,${liblzma_LIBS},g' \
|
||||
-e 's,@zlib_CFLAGS\@,${zlib_CFLAGS},g' \
|
||||
-e 's,@zlib_LIBS\@,${zlib_LIBS},g' \
|
||||
+ -e 's,@openssl_CFLAGS\@,${openssl_CFLAGS},g' \
|
||||
+ -e 's,@openssl_LIBS\@,${openssl_LIBS},g' \
|
||||
< $< > $@ || rm $@
|
||||
|
||||
%.pc: %.pc.in Makefile
|
||||
@@ -87,7 +89,7 @@ libkmod_libkmod_la_DEPENDENCIES = \
|
||||
${top_srcdir}/libkmod/libkmod.sym
|
||||
libkmod_libkmod_la_LIBADD = \
|
||||
shared/libshared.la \
|
||||
- ${liblzma_LIBS} ${zlib_LIBS}
|
||||
+ ${liblzma_LIBS} ${zlib_LIBS} ${openssl_LIBS}
|
||||
|
||||
noinst_LTLIBRARIES += libkmod/libkmod-internal.la
|
||||
libkmod_libkmod_internal_la_SOURCES = $(libkmod_libkmod_la_SOURCES)
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index fbc7391b2d1b..2e33380a0cc2 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -106,6 +106,17 @@ AS_IF([test "x$with_zlib" != "xno"], [
|
||||
])
|
||||
CC_FEATURE_APPEND([with_features], [with_zlib], [ZLIB])
|
||||
|
||||
+AC_ARG_WITH([openssl],
|
||||
+ AS_HELP_STRING([--with-openssl], [handle PKCS7 signatures @<:@default=disabled@:>@]),
|
||||
+ [], [with_openssl=no])
|
||||
+AS_IF([test "x$with_openssl" != "xno"], [
|
||||
+ PKG_CHECK_MODULES([openssl], [openssl])
|
||||
+ AC_DEFINE([ENABLE_OPENSSL], [1], [Enable openssl for modinfo.])
|
||||
+], [
|
||||
+ AC_MSG_NOTICE([openssl support not requested])
|
||||
+])
|
||||
+CC_FEATURE_APPEND([with_features], [with_openssl], [OPENSSL])
|
||||
+
|
||||
AC_ARG_WITH([bashcompletiondir],
|
||||
AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completions directory]),
|
||||
[],
|
||||
diff --git a/libkmod/libkmod-internal.h b/libkmod/libkmod-internal.h
|
||||
index 346579c71aab..a65ddd156f18 100644
|
||||
--- a/libkmod/libkmod-internal.h
|
||||
+++ b/libkmod/libkmod-internal.h
|
||||
@@ -188,5 +188,8 @@ struct kmod_signature_info {
|
||||
const char *algo, *hash_algo, *id_type;
|
||||
const char *sig;
|
||||
size_t sig_len;
|
||||
+ void (*free)(void *);
|
||||
+ void *private;
|
||||
};
|
||||
bool kmod_module_signature_info(const struct kmod_file *file, struct kmod_signature_info *sig_info) _must_check_ __attribute__((nonnull(1, 2)));
|
||||
+void kmod_module_signature_info_free(struct kmod_signature_info *sig_info) __attribute__((nonnull));
|
||||
diff --git a/libkmod/libkmod-module.c b/libkmod/libkmod-module.c
|
||||
index 889f26479a98..bffe715cdef4 100644
|
||||
--- a/libkmod/libkmod-module.c
|
||||
+++ b/libkmod/libkmod-module.c
|
||||
@@ -2357,6 +2357,9 @@ KMOD_EXPORT int kmod_module_get_info(const struct kmod_module *mod, struct kmod_
|
||||
ret = count;
|
||||
|
||||
list_error:
|
||||
+ /* aux structures freed in normal case also */
|
||||
+ kmod_module_signature_info_free(&sig_info);
|
||||
+
|
||||
if (ret < 0) {
|
||||
kmod_module_info_free_list(*list);
|
||||
*list = NULL;
|
||||
diff --git a/libkmod/libkmod-signature.c b/libkmod/libkmod-signature.c
|
||||
index 429ffbd8a957..48d0145a7552 100644
|
||||
--- a/libkmod/libkmod-signature.c
|
||||
+++ b/libkmod/libkmod-signature.c
|
||||
@@ -19,6 +19,10 @@
|
||||
|
||||
#include <endian.h>
|
||||
#include <inttypes.h>
|
||||
+#ifdef ENABLE_OPENSSL
|
||||
+#include <openssl/cms.h>
|
||||
+#include <openssl/ssl.h>
|
||||
+#endif
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -115,15 +119,194 @@ static bool fill_default(const char *mem, off_t size,
|
||||
return true;
|
||||
}
|
||||
|
||||
-static bool fill_unknown(const char *mem, off_t size,
|
||||
- const struct module_signature *modsig, size_t sig_len,
|
||||
- struct kmod_signature_info *sig_info)
|
||||
+#ifdef ENABLE_OPENSSL
|
||||
+
|
||||
+struct pkcs7_private {
|
||||
+ CMS_ContentInfo *cms;
|
||||
+ unsigned char *key_id;
|
||||
+ BIGNUM *sno;
|
||||
+};
|
||||
+
|
||||
+static void pkcs7_free(void *s)
|
||||
+{
|
||||
+ struct kmod_signature_info *si = s;
|
||||
+ struct pkcs7_private *pvt = si->private;
|
||||
+
|
||||
+ CMS_ContentInfo_free(pvt->cms);
|
||||
+ BN_free(pvt->sno);
|
||||
+ free(pvt->key_id);
|
||||
+ free(pvt);
|
||||
+ si->private = NULL;
|
||||
+}
|
||||
+
|
||||
+static int obj_to_hash_algo(const ASN1_OBJECT *o)
|
||||
+{
|
||||
+ int nid;
|
||||
+
|
||||
+ nid = OBJ_obj2nid(o);
|
||||
+ switch (nid) {
|
||||
+ case NID_md4:
|
||||
+ return PKEY_HASH_MD4;
|
||||
+ case NID_md5:
|
||||
+ return PKEY_HASH_MD5;
|
||||
+ case NID_sha1:
|
||||
+ return PKEY_HASH_SHA1;
|
||||
+ case NID_ripemd160:
|
||||
+ return PKEY_HASH_RIPE_MD_160;
|
||||
+ case NID_sha256:
|
||||
+ return PKEY_HASH_SHA256;
|
||||
+ case NID_sha384:
|
||||
+ return PKEY_HASH_SHA384;
|
||||
+ case NID_sha512:
|
||||
+ return PKEY_HASH_SHA512;
|
||||
+ case NID_sha224:
|
||||
+ return PKEY_HASH_SHA224;
|
||||
+ default:
|
||||
+ return -1;
|
||||
+ }
|
||||
+ return -1;
|
||||
+}
|
||||
+
|
||||
+static const char *x509_name_to_str(X509_NAME *name)
|
||||
+{
|
||||
+ int i;
|
||||
+ X509_NAME_ENTRY *e;
|
||||
+ ASN1_STRING *d;
|
||||
+ ASN1_OBJECT *o;
|
||||
+ int nid = -1;
|
||||
+ const char *str;
|
||||
+
|
||||
+ for (i = 0; i < X509_NAME_entry_count(name); i++) {
|
||||
+ e = X509_NAME_get_entry(name, i);
|
||||
+ o = X509_NAME_ENTRY_get_object(e);
|
||||
+ nid = OBJ_obj2nid(o);
|
||||
+ if (nid == NID_commonName)
|
||||
+ break;
|
||||
+ }
|
||||
+ if (nid == -1)
|
||||
+ return NULL;
|
||||
+
|
||||
+ d = X509_NAME_ENTRY_get_data(e);
|
||||
+ str = (const char *)ASN1_STRING_get0_data(d);
|
||||
+
|
||||
+ return str;
|
||||
+}
|
||||
+
|
||||
+static bool fill_pkcs7(const char *mem, off_t size,
|
||||
+ const struct module_signature *modsig, size_t sig_len,
|
||||
+ struct kmod_signature_info *sig_info)
|
||||
+{
|
||||
+ const char *pkcs7_raw;
|
||||
+ CMS_ContentInfo *cms;
|
||||
+ STACK_OF(CMS_SignerInfo) *sis;
|
||||
+ CMS_SignerInfo *si;
|
||||
+ int rc;
|
||||
+ ASN1_OCTET_STRING *key_id;
|
||||
+ X509_NAME *issuer;
|
||||
+ ASN1_INTEGER *sno;
|
||||
+ ASN1_OCTET_STRING *sig;
|
||||
+ BIGNUM *sno_bn;
|
||||
+ X509_ALGOR *dig_alg;
|
||||
+ X509_ALGOR *sig_alg;
|
||||
+ const ASN1_OBJECT *o;
|
||||
+ BIO *in;
|
||||
+ int len;
|
||||
+ unsigned char *key_id_str;
|
||||
+ struct pkcs7_private *pvt;
|
||||
+ const char *issuer_str;
|
||||
+
|
||||
+ size -= sig_len;
|
||||
+ pkcs7_raw = mem + size;
|
||||
+
|
||||
+ in = BIO_new_mem_buf(pkcs7_raw, sig_len);
|
||||
+
|
||||
+ cms = d2i_CMS_bio(in, NULL);
|
||||
+ if (cms == NULL) {
|
||||
+ BIO_free(in);
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ BIO_free(in);
|
||||
+
|
||||
+ sis = CMS_get0_SignerInfos(cms);
|
||||
+ if (sis == NULL)
|
||||
+ goto err;
|
||||
+
|
||||
+ si = sk_CMS_SignerInfo_value(sis, 0);
|
||||
+ if (si == NULL)
|
||||
+ goto err;
|
||||
+
|
||||
+ rc = CMS_SignerInfo_get0_signer_id(si, &key_id, &issuer, &sno);
|
||||
+ if (rc == 0)
|
||||
+ goto err;
|
||||
+
|
||||
+ sig = CMS_SignerInfo_get0_signature(si);
|
||||
+ if (sig == NULL)
|
||||
+ goto err;
|
||||
+
|
||||
+ CMS_SignerInfo_get0_algs(si, NULL, NULL, &dig_alg, &sig_alg);
|
||||
+
|
||||
+ sig_info->sig = (const char *)ASN1_STRING_get0_data(sig);
|
||||
+ sig_info->sig_len = ASN1_STRING_length(sig);
|
||||
+
|
||||
+ sno_bn = ASN1_INTEGER_to_BN(sno, NULL);
|
||||
+ if (sno_bn == NULL)
|
||||
+ goto err;
|
||||
+
|
||||
+ len = BN_num_bytes(sno_bn);
|
||||
+ key_id_str = malloc(len);
|
||||
+ if (key_id_str == NULL)
|
||||
+ goto err2;
|
||||
+ BN_bn2bin(sno_bn, key_id_str);
|
||||
+
|
||||
+ sig_info->key_id = (const char *)key_id_str;
|
||||
+ sig_info->key_id_len = len;
|
||||
+
|
||||
+ issuer_str = x509_name_to_str(issuer);
|
||||
+ if (issuer_str != NULL) {
|
||||
+ sig_info->signer = issuer_str;
|
||||
+ sig_info->signer_len = strlen(issuer_str);
|
||||
+ }
|
||||
+
|
||||
+ X509_ALGOR_get0(&o, NULL, NULL, dig_alg);
|
||||
+
|
||||
+ sig_info->hash_algo = pkey_hash_algo[obj_to_hash_algo(o)];
|
||||
+ sig_info->id_type = pkey_id_type[modsig->id_type];
|
||||
+
|
||||
+ pvt = malloc(sizeof(*pvt));
|
||||
+ if (pvt == NULL)
|
||||
+ goto err3;
|
||||
+
|
||||
+ pvt->cms = cms;
|
||||
+ pvt->key_id = key_id_str;
|
||||
+ pvt->sno = sno_bn;
|
||||
+ sig_info->private = pvt;
|
||||
+
|
||||
+ sig_info->free = pkcs7_free;
|
||||
+
|
||||
+ return true;
|
||||
+err3:
|
||||
+ free(key_id_str);
|
||||
+err2:
|
||||
+ BN_free(sno_bn);
|
||||
+err:
|
||||
+ CMS_ContentInfo_free(cms);
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
+#else /* ENABLE OPENSSL */
|
||||
+
|
||||
+static bool fill_pkcs7(const char *mem, off_t size,
|
||||
+ const struct module_signature *modsig, size_t sig_len,
|
||||
+ struct kmod_signature_info *sig_info)
|
||||
{
|
||||
sig_info->hash_algo = "unknown";
|
||||
sig_info->id_type = pkey_id_type[modsig->id_type];
|
||||
return true;
|
||||
}
|
||||
|
||||
+#endif /* ENABLE OPENSSL */
|
||||
+
|
||||
#define SIG_MAGIC "~Module signature appended~\n"
|
||||
|
||||
/*
|
||||
@@ -167,8 +350,14 @@ bool kmod_module_signature_info(const struct kmod_file *file, struct kmod_signat
|
||||
|
||||
switch (modsig->id_type) {
|
||||
case PKEY_ID_PKCS7:
|
||||
- return fill_unknown(mem, size, modsig, sig_len, sig_info);
|
||||
+ return fill_pkcs7(mem, size, modsig, sig_len, sig_info);
|
||||
default:
|
||||
return fill_default(mem, size, modsig, sig_len, sig_info);
|
||||
}
|
||||
}
|
||||
+
|
||||
+void kmod_module_signature_info_free(struct kmod_signature_info *sig_info)
|
||||
+{
|
||||
+ if (sig_info->free)
|
||||
+ sig_info->free(sig_info);
|
||||
+}
|
||||
--
|
||||
2.20.1
|
||||
|
@ -0,0 +1,83 @@
|
||||
From 52a0ba82e1ad180f9f91920db70a758fac49466a Mon Sep 17 00:00:00 2001
|
||||
From: Yauheni Kaliuta <yauheni.kaliuta@redhat.com>
|
||||
Date: Thu, 31 Oct 2019 20:12:53 +0200
|
||||
Subject: [PATCH] modprobe: ignore builtin module on recursive removing
|
||||
|
||||
If there are built-in dependencies and any of them is built-in in
|
||||
the kernel, modprobe -r fails with
|
||||
|
||||
modprobe: FATAL: Module module_name is builtin.
|
||||
|
||||
It makes sense to ignore such dependencies for the case when
|
||||
removing is called for non-top level module.
|
||||
|
||||
Example: cifs module, it declares bunch of softdeps and the first
|
||||
one fails on some kernel configs:
|
||||
|
||||
modprobe: FATAL: Module gcm is builtin.
|
||||
|
||||
Signed-off-by: Yauheni Kaliuta <yauheni.kaliuta@redhat.com>
|
||||
---
|
||||
tools/modprobe.c | 18 ++++++++++++------
|
||||
1 file changed, 12 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/tools/modprobe.c b/tools/modprobe.c
|
||||
index a9e2331567af..44cd15c2bf57 100644
|
||||
--- a/tools/modprobe.c
|
||||
+++ b/tools/modprobe.c
|
||||
@@ -353,7 +353,8 @@ static int rmmod_do_remove_module(struct kmod_module *mod)
|
||||
return err;
|
||||
}
|
||||
|
||||
-static int rmmod_do_module(struct kmod_module *mod, bool do_dependencies);
|
||||
+static int rmmod_do_module(struct kmod_module *mod, bool do_dependencies,
|
||||
+ bool ignore_builtin);
|
||||
|
||||
static int rmmod_do_deps_list(struct kmod_list *list, bool stop_on_errors)
|
||||
{
|
||||
@@ -361,7 +362,7 @@ static int rmmod_do_deps_list(struct kmod_list *list, bool stop_on_errors)
|
||||
|
||||
kmod_list_foreach_reverse(l, list) {
|
||||
struct kmod_module *m = kmod_module_get_module(l);
|
||||
- int r = rmmod_do_module(m, false);
|
||||
+ int r = rmmod_do_module(m, false, true);
|
||||
kmod_module_unref(m);
|
||||
|
||||
if (r < 0 && stop_on_errors)
|
||||
@@ -371,7 +372,8 @@ static int rmmod_do_deps_list(struct kmod_list *list, bool stop_on_errors)
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static int rmmod_do_module(struct kmod_module *mod, bool do_dependencies)
|
||||
+static int rmmod_do_module(struct kmod_module *mod, bool do_dependencies,
|
||||
+ bool ignore_builtin)
|
||||
{
|
||||
const char *modname = kmod_module_get_name(mod);
|
||||
struct kmod_list *pre = NULL, *post = NULL;
|
||||
@@ -401,8 +403,12 @@ static int rmmod_do_module(struct kmod_module *mod, bool do_dependencies)
|
||||
}
|
||||
goto error;
|
||||
} else if (state == KMOD_MODULE_BUILTIN) {
|
||||
- LOG("Module %s is builtin.\n", modname);
|
||||
- err = -ENOENT;
|
||||
+ if (ignore_builtin) {
|
||||
+ err = 0;
|
||||
+ } else {
|
||||
+ LOG("Module %s is builtin.\n", modname);
|
||||
+ err = -ENOENT;
|
||||
+ }
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
@@ -462,7 +468,7 @@ static int rmmod(struct kmod_ctx *ctx, const char *alias)
|
||||
|
||||
kmod_list_foreach(l, list) {
|
||||
struct kmod_module *mod = kmod_module_get_module(l);
|
||||
- err = rmmod_do_module(mod, true);
|
||||
+ err = rmmod_do_module(mod, true, false);
|
||||
kmod_module_unref(mod);
|
||||
if (err < 0)
|
||||
break;
|
||||
--
|
||||
2.24.0
|
||||
|
@ -0,0 +1,116 @@
|
||||
From a11057201ed326a9e65e757202da960735e45799 Mon Sep 17 00:00:00 2001
|
||||
From: Yauheni Kaliuta <yauheni.kaliuta@redhat.com>
|
||||
Date: Fri, 16 Nov 2018 10:56:34 +0200
|
||||
Subject: [PATCH] signature: do not report wrong data for pkc#7 signature
|
||||
|
||||
when PKC#7 signing method is used the old structure doesn't contain
|
||||
any useful data, but the data are encoded in the certificate.
|
||||
|
||||
The info getting/showing code is not aware of that at the moment and
|
||||
since 0 is a valid constant, shows, for example, wrong "md4" for the
|
||||
hash algo.
|
||||
|
||||
The patch splits the 2 mothods of gethering the info and reports
|
||||
"unknown" for the algo.
|
||||
|
||||
Signed-off-by: Yauheni Kaliuta <yauheni.kaliuta@redhat.com>
|
||||
---
|
||||
libkmod/libkmod-module.c | 2 +-
|
||||
libkmod/libkmod-signature.c | 56 +++++++++++++++++++++++++------------
|
||||
2 files changed, 39 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/libkmod/libkmod-module.c b/libkmod/libkmod-module.c
|
||||
index ee420f4ec2bf..889f26479a98 100644
|
||||
--- a/libkmod/libkmod-module.c
|
||||
+++ b/libkmod/libkmod-module.c
|
||||
@@ -2273,7 +2273,7 @@ KMOD_EXPORT int kmod_module_get_info(const struct kmod_module *mod, struct kmod_
|
||||
struct kmod_elf *elf;
|
||||
char **strings;
|
||||
int i, count, ret = -ENOMEM;
|
||||
- struct kmod_signature_info sig_info;
|
||||
+ struct kmod_signature_info sig_info = {};
|
||||
|
||||
if (mod == NULL || list == NULL)
|
||||
return -ENOENT;
|
||||
diff --git a/libkmod/libkmod-signature.c b/libkmod/libkmod-signature.c
|
||||
index 1f3e26dea203..429ffbd8a957 100644
|
||||
--- a/libkmod/libkmod-signature.c
|
||||
+++ b/libkmod/libkmod-signature.c
|
||||
@@ -92,6 +92,38 @@ struct module_signature {
|
||||
uint32_t sig_len; /* Length of signature data (big endian) */
|
||||
};
|
||||
|
||||
+static bool fill_default(const char *mem, off_t size,
|
||||
+ const struct module_signature *modsig, size_t sig_len,
|
||||
+ struct kmod_signature_info *sig_info)
|
||||
+{
|
||||
+ size -= sig_len;
|
||||
+ sig_info->sig = mem + size;
|
||||
+ sig_info->sig_len = sig_len;
|
||||
+
|
||||
+ size -= modsig->key_id_len;
|
||||
+ sig_info->key_id = mem + size;
|
||||
+ sig_info->key_id_len = modsig->key_id_len;
|
||||
+
|
||||
+ size -= modsig->signer_len;
|
||||
+ sig_info->signer = mem + size;
|
||||
+ sig_info->signer_len = modsig->signer_len;
|
||||
+
|
||||
+ sig_info->algo = pkey_algo[modsig->algo];
|
||||
+ sig_info->hash_algo = pkey_hash_algo[modsig->hash];
|
||||
+ sig_info->id_type = pkey_id_type[modsig->id_type];
|
||||
+
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
+static bool fill_unknown(const char *mem, off_t size,
|
||||
+ const struct module_signature *modsig, size_t sig_len,
|
||||
+ struct kmod_signature_info *sig_info)
|
||||
+{
|
||||
+ sig_info->hash_algo = "unknown";
|
||||
+ sig_info->id_type = pkey_id_type[modsig->id_type];
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
#define SIG_MAGIC "~Module signature appended~\n"
|
||||
|
||||
/*
|
||||
@@ -112,7 +144,6 @@ bool kmod_module_signature_info(const struct kmod_file *file, struct kmod_signat
|
||||
const struct module_signature *modsig;
|
||||
size_t sig_len;
|
||||
|
||||
-
|
||||
size = kmod_file_get_size(file);
|
||||
mem = kmod_file_get_contents(file);
|
||||
if (size < (off_t)strlen(SIG_MAGIC))
|
||||
@@ -134,21 +165,10 @@ bool kmod_module_signature_info(const struct kmod_file *file, struct kmod_signat
|
||||
size < (int64_t)(modsig->signer_len + modsig->key_id_len + sig_len))
|
||||
return false;
|
||||
|
||||
- size -= sig_len;
|
||||
- sig_info->sig = mem + size;
|
||||
- sig_info->sig_len = sig_len;
|
||||
-
|
||||
- size -= modsig->key_id_len;
|
||||
- sig_info->key_id = mem + size;
|
||||
- sig_info->key_id_len = modsig->key_id_len;
|
||||
-
|
||||
- size -= modsig->signer_len;
|
||||
- sig_info->signer = mem + size;
|
||||
- sig_info->signer_len = modsig->signer_len;
|
||||
-
|
||||
- sig_info->algo = pkey_algo[modsig->algo];
|
||||
- sig_info->hash_algo = pkey_hash_algo[modsig->hash];
|
||||
- sig_info->id_type = pkey_id_type[modsig->id_type];
|
||||
-
|
||||
- return true;
|
||||
+ switch (modsig->id_type) {
|
||||
+ case PKEY_ID_PKCS7:
|
||||
+ return fill_unknown(mem, size, modsig, sig_len, sig_info);
|
||||
+ default:
|
||||
+ return fill_default(mem, size, modsig, sig_len, sig_info);
|
||||
+ }
|
||||
}
|
||||
--
|
||||
2.20.1
|
||||
|
1199
SOURCES/weak-modules
Normal file
1199
SOURCES/weak-modules
Normal file
File diff suppressed because it is too large
Load Diff
369
SPECS/kmod.spec
Normal file
369
SPECS/kmod.spec
Normal file
@ -0,0 +1,369 @@
|
||||
Name: kmod
|
||||
Version: 25
|
||||
Release: 16%{?dist}
|
||||
Summary: Linux kernel module management utilities
|
||||
|
||||
Group: System Environment/Kernel
|
||||
License: GPLv2+
|
||||
URL: http://git.kernel.org/?p=utils/kernel/kmod/kmod.git;a=summary
|
||||
Source0: https://www.kernel.org/pub/linux/utils/kernel/kmod/%{name}-%{version}.tar.xz
|
||||
Source1: weak-modules
|
||||
Source2: depmod.conf.dist
|
||||
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
|
||||
|
||||
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
|
||||
BuildRequires: chrpath
|
||||
BuildRequires: zlib-devel
|
||||
BuildRequires: xz-devel
|
||||
BuildRequires: libxslt
|
||||
BuildRequires: openssl-devel
|
||||
# Remove it as soon as no need for Patch02 anymore (Makefile.am updated)
|
||||
BuildRequires: automake autoconf libtool
|
||||
|
||||
Provides: module-init-tools = 4.0-1
|
||||
Obsoletes: module-init-tools < 4.0-1
|
||||
Provides: /sbin/modprobe
|
||||
|
||||
%description
|
||||
The kmod package provides various programs needed for automatic
|
||||
loading and unloading of modules under 2.6, 3.x, and later kernels, as well
|
||||
as other module management programs. Device drivers and filesystems are two
|
||||
examples of loaded and unloaded modules.
|
||||
|
||||
%package libs
|
||||
Summary: Libraries to handle kernel module loading and unloading
|
||||
License: LGPLv2+
|
||||
Group: System Environment/Libraries
|
||||
|
||||
%description libs
|
||||
The kmod-libs package provides runtime libraries for any application that
|
||||
wishes to load or unload Linux kernel modules from the running system.
|
||||
|
||||
%package devel
|
||||
Summary: Header files for kmod development
|
||||
Group: Development/Libraries
|
||||
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
|
||||
|
||||
%description devel
|
||||
The kmod-devel package provides header files used for development of
|
||||
applications that wish to load or unload Linux kernel modules.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch01 -p1
|
||||
%patch02 -p1
|
||||
%patch03 -p1
|
||||
|
||||
%build
|
||||
export V=1
|
||||
aclocal
|
||||
autoreconf --install --symlink
|
||||
%configure \
|
||||
--with-zlib \
|
||||
--with-xz \
|
||||
--with-openssl
|
||||
make %{?_smp_mflags}
|
||||
|
||||
%install
|
||||
make install DESTDIR=$RPM_BUILD_ROOT
|
||||
pushd $RPM_BUILD_ROOT/%{_mandir}/man5
|
||||
ln -s modprobe.d.5.gz modprobe.conf.5.gz
|
||||
popd
|
||||
|
||||
rm -rf $RPM_BUILD_ROOT%{_libdir}/*.la
|
||||
mkdir -p $RPM_BUILD_ROOT%{_sbindir}
|
||||
ln -sf ../bin/kmod $RPM_BUILD_ROOT%{_sbindir}/modprobe
|
||||
ln -sf ../bin/kmod $RPM_BUILD_ROOT%{_sbindir}/modinfo
|
||||
ln -sf ../bin/kmod $RPM_BUILD_ROOT%{_sbindir}/insmod
|
||||
ln -sf ../bin/kmod $RPM_BUILD_ROOT%{_sbindir}/rmmod
|
||||
ln -sf ../bin/kmod $RPM_BUILD_ROOT%{_sbindir}/depmod
|
||||
ln -sf ../bin/kmod $RPM_BUILD_ROOT%{_sbindir}/lsmod
|
||||
|
||||
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d
|
||||
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d
|
||||
mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/modprobe.d
|
||||
|
||||
mkdir -p $RPM_BUILD_ROOT/sbin
|
||||
install -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_sbindir}/weak-modules
|
||||
install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf
|
||||
|
||||
%post libs -p /sbin/ldconfig
|
||||
|
||||
%postun libs -p /sbin/ldconfig
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%dir %{_sysconfdir}/depmod.d
|
||||
%dir %{_sysconfdir}/modprobe.d
|
||||
%dir %{_prefix}/lib/modprobe.d
|
||||
%{_bindir}/kmod
|
||||
%{_sbindir}/modprobe
|
||||
%{_sbindir}/modinfo
|
||||
%{_sbindir}/insmod
|
||||
%{_sbindir}/rmmod
|
||||
%{_sbindir}/lsmod
|
||||
%{_sbindir}/depmod
|
||||
%{_sbindir}/weak-modules
|
||||
%{_datadir}/bash-completion/
|
||||
%{_sysconfdir}/depmod.d/dist.conf
|
||||
%attr(0644,root,root) %{_mandir}/man5/*.5*
|
||||
%attr(0644,root,root) %{_mandir}/man8/*.8*
|
||||
%doc NEWS README TODO
|
||||
|
||||
%files libs
|
||||
%{!?_licensedir:%global license %%doc}
|
||||
%license COPYING
|
||||
%{_libdir}/libkmod.so.*
|
||||
|
||||
%files devel
|
||||
%{_includedir}/libkmod.h
|
||||
%{_libdir}/pkgconfig/libkmod.pc
|
||||
%{_libdir}/libkmod.so
|
||||
|
||||
%changelog
|
||||
* 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
|
||||
Resolves: rhbz#1778889
|
||||
|
||||
* Mon Dec 9 2019 Yauheni Kaliuta <ykaliuta@redhat.com> - 25-15
|
||||
- weak-modules: reverse checking order for add-kernel
|
||||
Resolves: rhbz#1755196
|
||||
|
||||
* Mon Dec 2 2019 Yauheni Kaliuta <ykaliuta@redhat.com> - 25-14
|
||||
- modprobe: do not fail on built-in modules
|
||||
Resolves: rhbz#1767513
|
||||
|
||||
* Tue Apr 16 2019 Yauheni Kaliuta <ykaliuta@redhat.com> - 25-13
|
||||
- weak-modules: handle independent modules in one run
|
||||
Resolves: rhbz#1695763
|
||||
|
||||
* Tue Apr 2 2019 Yauheni Kaliuta <ykaliuta@redhat.com> - 25-12
|
||||
- weak-modules: use asterisk for kernel version in sandbox
|
||||
Resolves: rhbz#1689052
|
||||
|
||||
* Tue Feb 5 2019 Yauheni Kaliuta <ykaliuta@redhat.com> - 25-11
|
||||
- add PKCS7/openssl support.
|
||||
Resolves: rhbz#1668459.
|
||||
|
||||
* Tue Dec 11 2018 Yauheni Kaliuta <ykaliuta@redhat.com> - 25-10
|
||||
- weak-modules: group modules on add-kernel
|
||||
- weak-modules: do not make groups if there are no extra modules
|
||||
Resolves: rhbz#1649211
|
||||
|
||||
* Tue Oct 2 2018 Yauheni Kaliuta <ykaliuta@redhat.com> - 25-9
|
||||
- Rebuild with updated flags.
|
||||
Resolves: rhbz#1630574.
|
||||
|
||||
* Tue Sep 4 2018 Yauheni Kaliuta <ykaliuta@redhat.com> - 25-8
|
||||
- weak-modules: fix initial state creation for dry-run
|
||||
- weak-modules: check compatibility in a temporary directory
|
||||
Resolves: rhbz#1622990.
|
||||
|
||||
* Tue Aug 28 2018 Yauheni Kaliuta <ykaliuta@redhat.com> - 25-7
|
||||
- weak-modules: use is_kernel_installed wrapper in update_modules_for_krel.
|
||||
- weak-modules: more abstract symvers search implementation.
|
||||
- weak-modules: use additional paths for System.map file.
|
||||
Resolves: rhbz#1621306.
|
||||
|
||||
* Thu Aug 09 2018 Eugene Syromiatnikov <esyr@redhat.com> - 25-6
|
||||
- weak-modules: check also for /lib/modules/$krel/symvers.gz as a possible
|
||||
symvers file path.
|
||||
Resolves: rhbz#1614119.
|
||||
|
||||
* Mon Jul 30 2018 Yauheni Kaliuta <ykaliuta@redhat.com> - 25-5
|
||||
- weak-modules: handle versions with + and other special regex symbols
|
||||
- weak-modules: fix misleading message when cannot find dracut.
|
||||
Resolves: rhbz#1609372.
|
||||
|
||||
* Fri Jul 27 2018 Yauheni Kaliuta <ykaliuta@redhat.com> - 25-4
|
||||
- fix dracut path, /usr/bin/dracut
|
||||
|
||||
* Wed Jul 25 2018 Yauheni Kaliuta <ykaliuta@redhat.com> - 25-3
|
||||
- Add depmod.d/dist.conf.
|
||||
- Update weak-modules to RHEL version.
|
||||
|
||||
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 25-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
|
||||
|
||||
* Tue Jan 09 2018 Josh Boyer <jwboyer@fedoraproject.org> - 25-1
|
||||
- Update to version 25 (rhbz 1532597)
|
||||
|
||||
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 24-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
|
||||
|
||||
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 24-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
|
||||
|
||||
* Fri Feb 24 2017 Josh Boyer <jwboyer@fedoraproject.org> - 24-1
|
||||
- Update to version 24 (rhbz 1426589)
|
||||
|
||||
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 23-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
|
||||
|
||||
* Fri Jul 22 2016 Josh Boyer <jwboyer@fedoraproject.org> - 23-1
|
||||
- Update to version 23
|
||||
|
||||
* Thu Feb 25 2016 Peter Robinson <pbrobinson@fedoraproject.org> 22-4
|
||||
- Add powerpc patch to fix ToC on 4.5 ppc64le kernel
|
||||
|
||||
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 22-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
|
||||
|
||||
* Thu Jan 07 2016 Josh Boyer <jwboyer@fedoraproject.org> - 22-2
|
||||
- Fix path to dracut in weak-modules (rhbz 1295038)
|
||||
|
||||
* Wed Nov 18 2015 Josh Boyer <jwboyer@fedoraproject.org> - 22-1
|
||||
- Update to version 22
|
||||
|
||||
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 21-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
|
||||
|
||||
* Mon Jun 15 2015 Ville Skyttä <ville.skytta@iki.fi> - 21-2
|
||||
- Own bash completion dirs not owned by anything in dep chain
|
||||
|
||||
* Tue Jun 09 2015 Josh Boyer <jwboyer@fedoraproject.org> - 21-1
|
||||
- Update to verion 21
|
||||
|
||||
* Mon Mar 02 2015 Josh Boyer <jwboyer@fedoraproject.org> - 20.1
|
||||
- Update to version 20
|
||||
|
||||
* Sat Feb 21 2015 Till Maas <opensource@till.name> - 19-2
|
||||
- Rebuilt for Fedora 23 Change
|
||||
https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code
|
||||
|
||||
* Sun Nov 16 2014 Josh Boyer <jwboyer@fedoraproject.org> - 19-1
|
||||
- Update to version 19
|
||||
|
||||
* Wed Oct 29 2014 Josh Boyer <jwboyer@fedoraproject.org> - 18-4
|
||||
- Backport patch to fix device node permissions (rhbz 1147248)
|
||||
|
||||
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 18-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
|
||||
|
||||
* Sat Jul 12 2014 Tom Callaway <spot@fedoraproject.org> - 18-2
|
||||
- fix license handling
|
||||
|
||||
* Tue Jun 24 2014 Josh Boyer <jwboyer@fedoraproject.org> - 18-1
|
||||
- Update to version 18
|
||||
|
||||
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 17-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
|
||||
|
||||
* Wed Apr 09 2014 Josh Boyer <jwboyer@fedoraproject.org> - 17-1
|
||||
- Update to version 17
|
||||
|
||||
* Thu Jan 02 2014 Václav Pavlín <vpavlin@redhat.com> - 16-1
|
||||
- Update to version 16
|
||||
|
||||
* Thu Aug 22 2013 Josh Boyer <jwboyer@fedoraproject.org> - 15-1
|
||||
- Update to version 15
|
||||
|
||||
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 14-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
|
||||
|
||||
* Fri Jul 05 2013 Josh Boyer <jwboyer@redhat.com> - 14-1
|
||||
- Update to version 14
|
||||
|
||||
* Fri Apr 19 2013 Václav Pavlín <vpavlin@redhat.com> - 13-2
|
||||
- Main package should require -libs
|
||||
|
||||
* Wed Apr 10 2013 Josh Boyer <jwboyer@redhat.com> - 13-1
|
||||
- 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>
|
||||
|
||||
* Mon Mar 18 2013 Josh Boyer <jwboyer@redhat.com>
|
||||
- Add patch to make rmmod understand built-in modules (rhbz 922187)
|
||||
|
||||
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 12-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
|
||||
|
||||
* Thu Dec 06 2012 Josh Boyer <jwboyer@redhat.com>
|
||||
- Update to version 12
|
||||
|
||||
* Thu Nov 08 2012 Josh Boyer <jwboyer@redhat.com>
|
||||
- Update to version 11
|
||||
|
||||
* Fri Sep 07 2012 Josh Boyer <jwboyer@redaht.com>
|
||||
- Update to version 10
|
||||
|
||||
* Mon Aug 27 2012 Josh Boyer <jwboyer@redhat.com>
|
||||
- Update to version 9
|
||||
|
||||
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 8-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
|
||||
|
||||
* Wed May 23 2012 Josh Boyer <jwboyer@redhat.com> - 8-2
|
||||
- Provide modprobe.conf(5) (rhbz 824552)
|
||||
|
||||
* Tue May 08 2012 Josh Boyer <jwboyer@redhat.com> - 8-1
|
||||
- Update to version 8
|
||||
|
||||
* Mon Mar 19 2012 Kay Sievers <kay@redhat.com> - 7-1
|
||||
- update to version 7
|
||||
- fix issue with --show-depends, where built-in
|
||||
modules of the running kernel fail to include
|
||||
loadable modules of the kernel specified
|
||||
|
||||
* Sun Mar 04 2012 Kay Sievers <kay@redhat.com> - 6-1
|
||||
- update to version 6
|
||||
- remove all patches, they are included in the release
|
||||
|
||||
* Fri Feb 24 2012 Kay Sievers <kay@redhat.com> - 5-8
|
||||
- try to address brc#771285
|
||||
|
||||
* Sun Feb 12 2012 Kay Sievers <kay@redhat.com> - 5-7
|
||||
- fix infinite loop with softdeps
|
||||
|
||||
* Thu Feb 09 2012 Harald Hoyer <harald@redhat.com> 5-6
|
||||
- add upstream patch to fix "modprobe --ignore-install --show-depends"
|
||||
otherwise dracut misses a lot of modules, which are already loaded
|
||||
|
||||
* Wed Feb 08 2012 Harald Hoyer <harald@redhat.com> 5-5
|
||||
- add "lsmod"
|
||||
|
||||
* Tue Feb 7 2012 Kay Sievers <kay@redhat.com> - 5-4
|
||||
- remove temporarily added fake-provides
|
||||
|
||||
* Tue Feb 7 2012 Kay Sievers <kay@redhat.com> - 5-3
|
||||
- temporarily add fake-provides to be able to bootstrap
|
||||
the new udev which pulls the old udev into the buildroot
|
||||
|
||||
* Tue Feb 7 2012 Kay Sievers <kay@redhat.com> - 5-1
|
||||
- Update to version 5
|
||||
- replace the module-init-tools package and provide all tools
|
||||
as compatibility symlinks
|
||||
|
||||
* Mon Jan 16 2012 Kay Sievers <kay@redhat.com> - 4-1
|
||||
- Update to version 4
|
||||
- set --with-rootprefix=
|
||||
- enable zlib and xz support
|
||||
|
||||
* Thu Jan 05 2012 Jon Masters <jcm@jonmasters.org> - 3-1
|
||||
- Update to latest upstream (adds new depmod replacement utility)
|
||||
- For the moment, use the "kmod" utility to test the various functions
|
||||
|
||||
* Fri Dec 23 2011 Jon Masters <jcm@jonmasters.org> - 2-6
|
||||
- Update kmod-2-with-rootlibdir patch with rebuild automake files
|
||||
|
||||
* Fri Dec 23 2011 Jon Masters <jcm@jonmasters.org> - 2-5
|
||||
- Initial build for Fedora following package import
|
||||
|
||||
* Thu Dec 22 2011 Jon Masters <jcm@jonmasters.org> - 2-4
|
||||
- There is no generic macro for non-multilib "/lib", hardcode like others
|
||||
|
||||
* Thu Dec 22 2011 Jon Masters <jcm@jonmasters.org> - 2-3
|
||||
- Update package incorporating fixes from initial review feedback
|
||||
- Cleaups to SPEC, rpath, documentation, library and binary locations
|
||||
|
||||
* Thu Dec 22 2011 Jon Masters <jcm@jonmasters.org> - 2-2
|
||||
- Update package for posting to wider test audience (initial review submitted)
|
||||
|
||||
* Thu Dec 22 2011 Jon Masters <jcm@jonmasters.org> - 2-1
|
||||
- Initial Fedora package for module-init-tools replacement (kmod) library
|
Loading…
Reference in New Issue
Block a user