diff options
| author | Stefan Agner <stefan.agner@toradex.com> | 2019-11-12 13:57:30 +0100 |
|---|---|---|
| committer | Stefan Agner <stefan.agner@toradex.com> | 2019-11-12 13:57:30 +0100 |
| commit | 401bf3f29b1aa6d9ca32bd3252fc9beabe93d80b (patch) | |
| tree | 6dd86325823a9b44b6e696acbd077e68c47d3108 /security | |
| parent | 5a9c845fe261dec87f892f3fd3c2e32604d952c0 (diff) | |
| parent | b260a0862e3a9fccdac23ec3b783911b098c1c74 (diff) | |
Merge tag 'v5.3.10' into toradex_5.3.ytoradex_5.3.y
This is the 5.3.10 stable release
Diffstat (limited to 'security')
| -rw-r--r-- | security/safesetid/securityfs.c | 3 | ||||
| -rw-r--r-- | security/selinux/ss/services.c | 9 |
2 files changed, 10 insertions, 2 deletions
diff --git a/security/safesetid/securityfs.c b/security/safesetid/securityfs.c index d568e17dd773..74a13d432ed8 100644 --- a/security/safesetid/securityfs.c +++ b/security/safesetid/securityfs.c @@ -187,7 +187,8 @@ out_free_rule: out_free_buf: kfree(buf); out_free_pol: - release_ruleset(pol); + if (pol) + release_ruleset(pol); return err; } diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c index d61563a3695e..8218e837a58c 100644 --- a/security/selinux/ss/services.c +++ b/security/selinux/ss/services.c @@ -1946,7 +1946,14 @@ static int convert_context(struct context *oldc, struct context *newc, void *p) rc = string_to_context_struct(args->newp, NULL, s, newc, SECSID_NULL); if (rc == -EINVAL) { - /* Retain string representation for later mapping. */ + /* + * Retain string representation for later mapping. + * + * IMPORTANT: We need to copy the contents of oldc->str + * back into s again because string_to_context_struct() + * may have garbled it. + */ + memcpy(s, oldc->str, oldc->len); context_init(newc); newc->str = s; newc->len = oldc->len; |
