diff options
author | Xin Ouyang <Xin.Ouyang@windriver.com> | 2012-02-16 15:17:58 +0800 |
---|---|---|
committer | Xin Ouyang <Xin.Ouyang@windriver.com> | 2012-02-16 15:17:58 +0800 |
commit | 190aab31464252838b93065a3dc2e058e0d00200 (patch) | |
tree | 100905396e63d9bd469c35f5e9dc1c31c6becd3e | |
parent | fb56a7119e24596f1cad6c7694c5d9b3f6dfb679 (diff) | |
download | meta-selinux-190aab31464252838b93065a3dc2e058e0d00200.tar.gz |
libsemanage: Add a patch to fix a segfault bug.
-rw-r--r-- | recipes-security/selinux/libsemanage-2.1.6/Fix-segfault-for-standard-policy.patch | 37 | ||||
-rw-r--r-- | recipes-security/selinux/libsemanage_2.1.6.bb | 2 |
2 files changed, 39 insertions, 0 deletions
diff --git a/recipes-security/selinux/libsemanage-2.1.6/Fix-segfault-for-standard-policy.patch b/recipes-security/selinux/libsemanage-2.1.6/Fix-segfault-for-standard-policy.patch new file mode 100644 index 0000000..8672b63 --- /dev/null +++ b/recipes-security/selinux/libsemanage-2.1.6/Fix-segfault-for-standard-policy.patch | |||
@@ -0,0 +1,37 @@ | |||
1 | From 64aff2c80f28280724f64628d6bf4c4722b4f75f Mon Sep 17 00:00:00 2001 | ||
2 | From: Xin Ouyang <xinpascal@gmail.com> | ||
3 | Date: Thu, 12 Jan 2012 16:58:34 +0800 | ||
4 | Subject: [PATCH] libsemanage: Fix segfault for building standard policies. | ||
5 | |||
6 | If you are building "standard" policies(not MCS/MLS), libsemanage | ||
7 | will crash, which caused by strdup() to "level" NULL pointers. | ||
8 | For example, semodule -s refpolicy -b base.pp -i a.pp | ||
9 | --- | ||
10 | src/genhomedircon.c | 4 ++++ | ||
11 | 1 files changed, 4 insertions(+), 0 deletions(-) | ||
12 | |||
13 | diff --git a/src/genhomedircon.c b/src/genhomedircon.c | ||
14 | index d2646ae..262a6cd 100644 | ||
15 | --- a/src/genhomedircon.c | ||
16 | +++ b/src/genhomedircon.c | ||
17 | @@ -778,6 +778,8 @@ static int setup_fallback_user(genhomedircon_settings_t * s) | ||
18 | { | ||
19 | prefix = semanage_user_get_prefix(u); | ||
20 | level = semanage_user_get_mlslevel(u); | ||
21 | + if (level == NULL) | ||
22 | + level = ""; | ||
23 | } | ||
24 | |||
25 | if (set_fallback_user(s, seuname, prefix, level) != 0) | ||
26 | @@ -861,6 +863,8 @@ static genhomedircon_user_entry_t *get_users(genhomedircon_settings_t * s, | ||
27 | if (u) { | ||
28 | prefix = semanage_user_get_prefix(*u); | ||
29 | level = semanage_user_get_mlslevel(*u); | ||
30 | + if (level == NULL) | ||
31 | + level = ""; | ||
32 | } else { | ||
33 | prefix = name; | ||
34 | level = "s0"; | ||
35 | -- | ||
36 | 1.7.7.3 | ||
37 | |||
diff --git a/recipes-security/selinux/libsemanage_2.1.6.bb b/recipes-security/selinux/libsemanage_2.1.6.bb index 28165f4..aabb472 100644 --- a/recipes-security/selinux/libsemanage_2.1.6.bb +++ b/recipes-security/selinux/libsemanage_2.1.6.bb | |||
@@ -15,6 +15,8 @@ SRCREV = "339f8079d7b9dd1e0b0138e2d096dc7c60b2092e" | |||
15 | S = "${WORKDIR}/git/libsemanage" | 15 | S = "${WORKDIR}/git/libsemanage" |
16 | DEPENDS += "libsepol libselinux ustr bzip2 python" | 16 | DEPENDS += "libsepol libselinux ustr bzip2 python" |
17 | 17 | ||
18 | SRC_URI += "file://Fix-segfault-for-standard-policy.patch" | ||
19 | |||
18 | PACKAGES += "${PN}-python" | 20 | PACKAGES += "${PN}-python" |
19 | FILES_${PN}-python = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/*" | 21 | FILES_${PN}-python = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/*" |
20 | FILES_${PN}-dbg += "${libdir}/python${PYTHON_BASEVERSION}/site-packages/.debug/*" | 22 | FILES_${PN}-dbg += "${libdir}/python${PYTHON_BASEVERSION}/site-packages/.debug/*" |