diff options
Diffstat (limited to 'meta/recipes-kernel/kmod')
-rw-r--r-- | meta/recipes-kernel/kmod/kmod-native_git.bb | 1 | ||||
-rw-r--r-- | meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch | 39 |
2 files changed, 40 insertions, 0 deletions
diff --git a/meta/recipes-kernel/kmod/kmod-native_git.bb b/meta/recipes-kernel/kmod/kmod-native_git.bb index f22efc0615..d008cbf7c4 100644 --- a/meta/recipes-kernel/kmod/kmod-native_git.bb +++ b/meta/recipes-kernel/kmod/kmod-native_git.bb | |||
@@ -6,6 +6,7 @@ inherit native | |||
6 | 6 | ||
7 | SRC_URI += "file://fix-undefined-O_CLOEXEC.patch \ | 7 | SRC_URI += "file://fix-undefined-O_CLOEXEC.patch \ |
8 | file://0001-Fix-build-with-older-gcc-4.6.patch \ | 8 | file://0001-Fix-build-with-older-gcc-4.6.patch \ |
9 | file://Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch \ | ||
9 | " | 10 | " |
10 | 11 | ||
11 | do_install_append (){ | 12 | do_install_append (){ |
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 new file mode 100644 index 0000000000..82b83b36b7 --- /dev/null +++ b/meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch | |||
@@ -0,0 +1,39 @@ | |||
1 | From 0c4dbadc9db3cda1cfca64e44ea08c6e89919ea7 Mon Sep 17 00:00:00 2001 | ||
2 | From: Ting Liu <b28495@freescale.com> | ||
3 | Date: Tue, 10 Sep 2013 13:44:18 +0800 | ||
4 | Subject: [PATCH] Change to calling bswap_* instead of htobe* and be*toh | ||
5 | |||
6 | We can't use htobe* and be*toh functions because they are not | ||
7 | available on older versions of glibc, For example, shipped on Centos 5.5. | ||
8 | |||
9 | Change to directly calling bswap_* as defined in+byteswap.h. | ||
10 | |||
11 | Signed-off-by: Ting Liu <b28495@freescale.com> | ||
12 | --- | ||
13 | libkmod/libkmod-signature.c | 3 ++- | ||
14 | 1 files changed, 2 insertions(+), 1 deletions(-) | ||
15 | |||
16 | diff --git a/libkmod/libkmod-signature.c b/libkmod/libkmod-signature.c | ||
17 | index 6b80caa..3544a36 100644 | ||
18 | --- a/libkmod/libkmod-signature.c | ||
19 | +++ b/libkmod/libkmod-signature.c | ||
20 | @@ -19,6 +19,7 @@ | ||
21 | */ | ||
22 | |||
23 | #include <endian.h> | ||
24 | +#include <byteswap.h> | ||
25 | #include <stdint.h> | ||
26 | #include <stdlib.h> | ||
27 | #include <string.h> | ||
28 | @@ -121,7 +122,7 @@ bool kmod_module_signature_info(const struct kmod_file *file, struct kmod_signat | ||
29 | modsig->hash >= PKEY_HASH__LAST || | ||
30 | modsig->id_type >= PKEY_ID_TYPE__LAST) | ||
31 | return false; | ||
32 | - sig_len = be32toh(modsig->sig_len); | ||
33 | + sig_len = bswap_32(modsig->sig_len); | ||
34 | if (size < (off_t)(modsig->signer_len + modsig->key_id_len + sig_len)) | ||
35 | return false; | ||
36 | |||
37 | -- | ||
38 | 1.7.5.4 | ||
39 | |||