Takashi Iwai 2eabdd
From: Takashi Iwai <tiwai@suse.de>
Takashi Iwai 2eabdd
Subject: drm: drm_file struct kABI compatibility workaround
Takashi Iwai 2eabdd
Patch-mainline: Never, kABI workaround
Takashi Iwai b729b9
References: CVE-2022-1280 bsc#1197914
Takashi Iwai 2eabdd
Takashi Iwai 2eabdd
The recent fix for DRM core
Takashi Iwai 2eabdd
  patches.suse/drm-serialize-drm_file.master-with-a-new-spinlock.patch
Takashi Iwai 2eabdd
introduced a new field in struct drm_file.
Takashi Iwai 2eabdd
Apply the standard workaround to move it at the tail with __GENKSYMS__
Takashi Iwai 2eabdd
for keeping the kABI compatibility; drm_file isn't embedded, so it
Takashi Iwai 2eabdd
should be safe to do that.
Takashi Iwai 2eabdd
Takashi Iwai 2eabdd
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai 2eabdd
Takashi Iwai 2eabdd
---
Takashi Iwai 2eabdd
 include/drm/drm_file.h |    7 ++++---
Takashi Iwai 2eabdd
 1 file changed, 4 insertions(+), 3 deletions(-)
Takashi Iwai 2eabdd
Takashi Iwai 2eabdd
--- a/include/drm/drm_file.h
Takashi Iwai 2eabdd
+++ b/include/drm/drm_file.h
Takashi Iwai 2eabdd
@@ -231,9 +231,6 @@ struct drm_file {
Takashi Iwai 2eabdd
 	 */
Takashi Iwai 2eabdd
 	struct drm_master *master;
Takashi Iwai 2eabdd
 
Takashi Iwai 2eabdd
-	/** @master_lock: Serializes @master. */
Takashi Iwai 2eabdd
-	spinlock_t master_lookup_lock;
Takashi Iwai 2eabdd
-
Takashi Iwai 2eabdd
 	/** @pid: Process that opened this file. */
Takashi Iwai 2eabdd
 	struct pid *pid;
Takashi Iwai 2eabdd
 
Takashi Iwai 2eabdd
@@ -347,6 +344,10 @@ struct drm_file {
Takashi Iwai 2eabdd
 
Takashi Iwai 2eabdd
 	/* private: */
Takashi Iwai 2eabdd
 	unsigned long lock_count; /* DRI1 legacy lock count */
Takashi Iwai 2eabdd
+#ifndef __GENKSYMS__
Takashi Iwai 2eabdd
+	/** @master_lock: Serializes @master. */
Takashi Iwai 2eabdd
+	spinlock_t master_lookup_lock;
Takashi Iwai 2eabdd
+#endif
Takashi Iwai 2eabdd
 };
Takashi Iwai 2eabdd
 
Takashi Iwai 2eabdd
 /**