summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch')
-rw-r--r--meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch15
1 files changed, 6 insertions, 9 deletions
diff --git a/meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch b/meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch
index 7c0a27510b..b722183b68 100644
--- a/meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch
+++ b/meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch
@@ -1,7 +1,4 @@
1From 4b68940b1ed46c54a5a0bdf6bb9d4599bc64e6f4 Mon Sep 17 00:00:00 2001 1Subject: Change to calling bswap_* instead of htobe* and be*toh
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Wed, 24 Dec 2014 10:12:40 +0800
4Subject: [PATCH] Change to calling bswap_* instead of htobe* and be*toh
5 2
6We can't use htobe* and be*toh functions because they are not 3We can't use htobe* and be*toh functions because they are not
7available on older versions of glibc, For example, shipped on Centos 5.5. 4available on older versions of glibc, For example, shipped on Centos 5.5.
@@ -17,10 +14,10 @@ Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
17 1 file changed, 2 insertions(+), 1 deletion(-) 14 1 file changed, 2 insertions(+), 1 deletion(-)
18 15
19diff --git a/libkmod/libkmod-signature.c b/libkmod/libkmod-signature.c 16diff --git a/libkmod/libkmod-signature.c b/libkmod/libkmod-signature.c
20index 2b976a5..ffe58c2 100644 17index 6fc06fc..912185a 100644
21--- a/libkmod/libkmod-signature.c 18--- a/libkmod/libkmod-signature.c
22+++ b/libkmod/libkmod-signature.c 19+++ b/libkmod/libkmod-signature.c
23@@ -19,6 +19,7 @@ 20@@ -18,6 +18,7 @@
24 */ 21 */
25 22
26 #include <endian.h> 23 #include <endian.h>
@@ -28,15 +25,15 @@ index 2b976a5..ffe58c2 100644
28 #include <inttypes.h> 25 #include <inttypes.h>
29 #include <stdio.h> 26 #include <stdio.h>
30 #include <stdlib.h> 27 #include <stdlib.h>
31@@ -124,7 +125,7 @@ bool kmod_module_signature_info(const struct kmod_file *file, struct kmod_signat 28@@ -127,7 +128,7 @@ bool kmod_module_signature_info(const struct kmod_file *file, struct kmod_signat
32 modsig->hash >= PKEY_HASH__LAST || 29 modsig->hash >= PKEY_HASH__LAST ||
33 modsig->id_type >= PKEY_ID_TYPE__LAST) 30 modsig->id_type >= PKEY_ID_TYPE__LAST)
34 return false; 31 return false;
35- sig_len = be32toh(get_unaligned(&modsig->sig_len)); 32- sig_len = be32toh(get_unaligned(&modsig->sig_len));
36+ sig_len = bswap_32(get_unaligned(&modsig->sig_len)); 33+ sig_len = bswap_32(get_unaligned(&modsig->sig_len));
37 if (size < (off_t)(modsig->signer_len + modsig->key_id_len + sig_len)) 34 if (sig_len == 0 ||
35 size < (int64_t)(modsig->signer_len + modsig->key_id_len + sig_len))
38 return false; 36 return false;
39
40-- 37--
411.9.1 381.9.1
42 39