aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2019-10-23 12:02:47 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2019-10-23 12:10:05 +0200
commit2e79e22e092acd55da0b2db066e4826d7d152c41 (patch)
treee7ec9782c0b7831c511af711424126a2b9a4eb07 /security
parentMerge tag 'du-next-20191016' of git://linuxtv.org/pinchartl/media into drm-next (diff)
parentLinux 5.4-rc4 (diff)
downloadlinux-dev-2e79e22e092acd55da0b2db066e4826d7d152c41.tar.xz
linux-dev-2e79e22e092acd55da0b2db066e4826d7d152c41.zip
Merge v5.4-rc4 into drm-next
Thierry needs fd70c7755bf0 ("drm/bridge: tc358767: fix max_tu_symbol value") to be able to merge his dp_link patch series. Some adjacent changes conflicts, plus some clashes in i915 due to cherry-picking and git trying to be helpful and leaving both versions in. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'security')
-rw-r--r--security/selinux/ss/services.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c
index 3a29e7c24ba9..a5813c7629c1 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;