diff options
author | Nick Kralevich <nnk@google.com> | 2014-07-12 10:22:09 -0700 |
---|---|---|
committer | Nick Kralevich <nnk@google.com> | 2014-07-14 09:10:14 -0700 |
commit | 2066a66a2ab0c1b7d691d5a180b0ec1e47b0fb12 (patch) | |
tree | 999dde66dead2b826e3b58d08cc8d7f0b6afb92a | |
parent | c71644b06ebd417ef060f3f07472125516f86c41 (diff) | |
download | libsepol-l-preview.tar.gz |
Fix for binary policy modules.android-wear-5.0.0_r1android-l-preview_r2android-cts-5.0_r9android-cts-5.0_r8android-cts-5.0_r7android-cts-5.0_r6android-cts-5.0_r5android-cts-5.0_r4android-cts-5.0_r3android-5.0.2_r3android-5.0.2_r1android-5.0.1_r1android-5.0.0_r7android-5.0.0_r6android-5.0.0_r5.1android-5.0.0_r5android-5.0.0_r4android-5.0.0_r3android-5.0.0_r2android-5.0.0_r1lollipop-wear-releaselollipop-releaselollipop-devlollipop-cts-releasel-preview
They do not retain the neverallow source information so we must
not assume that source_filename is set. Either need a new binary
module format if we want to propagate this information for modular
builds or get rid of binary modules.
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Bug: https://code.google.com/p/android/issues/detail?id=73183
(cherry picked from commit d26204e7d0a3be178a97d4920b82007e05a2a632)
Change-Id: I88e220816430b57d5cb366f3a1e0c22fc64fffef
-rw-r--r-- | src/expand.c | 8 | ||||
-rw-r--r-- | src/link.c | 8 |
2 files changed, 10 insertions, 6 deletions
diff --git a/src/expand.c b/src/expand.c index 947bee0..acb6906 100644 --- a/src/expand.c +++ b/src/expand.c @@ -2651,9 +2651,11 @@ static int copy_neverallow(policydb_t * dest_pol, uint32_t * typemap, avrule->line = source_rule->line; avrule->flags = source_rule->flags; avrule->source_line = source_rule->source_line; - avrule->source_filename = strdup(source_rule->source_filename); - if (!avrule->source_filename) - goto err; + if (source_rule->source_filename) { + avrule->source_filename = strdup(source_rule->source_filename); + if (!avrule->source_filename) + goto err; + } if (ebitmap_cpy(&avrule->stypes.types, &stypes)) goto err; @@ -1326,9 +1326,11 @@ static int copy_avrule_list(avrule_t * list, avrule_t ** dst, } new_rule->line = cur->line; new_rule->source_line = cur->source_line; - new_rule->source_filename = strdup(cur->source_filename); - if (!new_rule->source_filename) - goto cleanup; + if (cur->source_filename) { + new_rule->source_filename = strdup(cur->source_filename); + if (!new_rule->source_filename) + goto cleanup; + } cur = cur->next; |