]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/x86/kernel/tls.c
Merge tag 'drm-forgot-about-tegra-for-v4.12-rc1' of git://people.freedesktop.org...
[karo-tx-linux.git] / arch / x86 / kernel / tls.c
index 6c8934406dc906c631200787f2b0d6ee8e746b60..dcd699baea1be86a7fa0f5d44e8ca1fefe875458 100644 (file)
@@ -92,10 +92,17 @@ static void set_tls_desc(struct task_struct *p, int idx,
        cpu = get_cpu();
 
        while (n-- > 0) {
-               if (LDT_empty(info) || LDT_zero(info))
+               if (LDT_empty(info) || LDT_zero(info)) {
                        desc->a = desc->b = 0;
-               else
+               } else {
                        fill_ldt(desc, info);
+
+                       /*
+                        * Always set the accessed bit so that the CPU
+                        * doesn't try to write to the (read-only) GDT.
+                        */
+                       desc->type |= 1;
+               }
                ++info;
                ++desc;
        }