[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v5] x86/xpti: Don't leak TSS-adjacent percpu data via Meltdown

On 12.08.2019 12:29, Andrew Cooper wrote:
On 12/08/2019 08:23, Jan Beulich wrote:
@@ -747,16 +747,10 @@ void load_system_tables(void)
          .bitmap = IOBMP_INVALID_OFFSET,
-    _set_tssldt_desc(
-        gdt + TSS_ENTRY,
-        (unsigned long)tss,
-        offsetof(struct tss_struct, __cacheline_filler) - 1,
-        SYS_DESC_tss_avail);
-    _set_tssldt_desc(
-        compat_gdt + TSS_ENTRY,
-        (unsigned long)tss,
-        offsetof(struct tss_struct, __cacheline_filler) - 1,
-        SYS_DESC_tss_busy);
+    _set_tssldt_desc(gdt + TSS_ENTRY, (unsigned long)tss,
+             sizeof(*tss) - 1, SYS_DESC_tss_avail);
+    _set_tssldt_desc(compat_gdt + TSS_ENTRY, (unsigned long)tss,
+             sizeof(*tss) - 1, SYS_DESC_tss_busy);

Do you think it is worth having a BUILD_BUG_ON(sizeof(*tss) < 0x67),
just to confirm that the load wont fault?

Not sure - it feels like going a little overboard with checks. Feel
free to add one though if you're really convinced it helps, but
then please with 0x68 in place of 0x67. (I'm about to leave now,
so if you want me to add anything and/or commit it, it would have
to wait two weeks.)


Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.