All of lore.kernel.org
 help / color / mirror / Atom feed
* x86: insn-eval.c's use of native_store_gdt()
@ 2021-11-30 11:09 Jan Beulich
  2022-02-04  9:23 ` Jan Beulich
  0 siblings, 1 reply; 5+ messages in thread
From: Jan Beulich @ 2021-11-30 11:09 UTC (permalink / raw)
  To: Ricardo Neri, Peter Zijlstra
  Cc: xen-devel@lists.xenproject.org, the arch/x86 maintainers

Hello,

I think it is b968e84b509d ("x86/iopl: Fake iopl(3) CLI/STI usage")
which uncovered an issue with get_desc() trying to access the GDT, as
introduced by 670f928ba09b ("x86/insn-eval: Add utility function to
get segment descriptor"). When running in a PV domain under Xen, the
(hypervisor's) GDT isn't accessible; with UMIP enabled by Xen even
SGDT wouldn't work, as the kernel runs in ring 3.

There's currently no hypercall to retrieve a descriptor from the GDT.
It is instead assumed that kernels know where their present GDT
lives. Can the native_store_gdt() be replaced there, please?

For context (I don't think it should matter much here) I'm observing
this with the kernel put underneath a rather old distro, where
hwclock triggers this path.

Thanks, Jan



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: x86: insn-eval.c's use of native_store_gdt()
  2021-11-30 11:09 x86: insn-eval.c's use of native_store_gdt() Jan Beulich
@ 2022-02-04  9:23 ` Jan Beulich
  2022-02-04 14:08   ` Thomas Gleixner
  0 siblings, 1 reply; 5+ messages in thread
From: Jan Beulich @ 2022-02-04  9:23 UTC (permalink / raw)
  To: Ricardo Neri, Peter Zijlstra
  Cc: xen-devel@lists.xenproject.org, the arch/x86 maintainers

On 30.11.2021 12:09, Jan Beulich wrote:
> I think it is b968e84b509d ("x86/iopl: Fake iopl(3) CLI/STI usage")
> which uncovered an issue with get_desc() trying to access the GDT, as
> introduced by 670f928ba09b ("x86/insn-eval: Add utility function to
> get segment descriptor"). When running in a PV domain under Xen, the
> (hypervisor's) GDT isn't accessible; with UMIP enabled by Xen even
> SGDT wouldn't work, as the kernel runs in ring 3.
> 
> There's currently no hypercall to retrieve a descriptor from the GDT.
> It is instead assumed that kernels know where their present GDT
> lives. Can the native_store_gdt() be replaced there, please?
> 
> For context (I don't think it should matter much here) I'm observing
> this with the kernel put underneath a rather old distro, where
> hwclock triggers this path.

I'd like to note that the issue still exists in 5.16.

Jan



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: x86: insn-eval.c's use of native_store_gdt()
  2022-02-04  9:23 ` Jan Beulich
@ 2022-02-04 14:08   ` Thomas Gleixner
  2022-02-04 14:13     ` Jan Beulich
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Gleixner @ 2022-02-04 14:08 UTC (permalink / raw)
  To: Jan Beulich, Ricardo Neri, Peter Zijlstra
  Cc: xen-devel@lists.xenproject.org, the arch/x86 maintainers

On Fri, Feb 04 2022 at 10:23, Jan Beulich wrote:
> On 30.11.2021 12:09, Jan Beulich wrote:
>> I think it is b968e84b509d ("x86/iopl: Fake iopl(3) CLI/STI usage")
>> which uncovered an issue with get_desc() trying to access the GDT, as
>> introduced by 670f928ba09b ("x86/insn-eval: Add utility function to
>> get segment descriptor"). When running in a PV domain under Xen, the
>> (hypervisor's) GDT isn't accessible; with UMIP enabled by Xen even
>> SGDT wouldn't work, as the kernel runs in ring 3.
>> 
>> There's currently no hypercall to retrieve a descriptor from the GDT.
>> It is instead assumed that kernels know where their present GDT
>> lives. Can the native_store_gdt() be replaced there, please?
>> 
>> For context (I don't think it should matter much here) I'm observing
>> this with the kernel put underneath a rather old distro, where
>> hwclock triggers this path.
>
> I'd like to note that the issue still exists in 5.16.

I'd like to note, that I've seen no patches to that effect.

Thanks,

        tglx


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: x86: insn-eval.c's use of native_store_gdt()
  2022-02-04 14:08   ` Thomas Gleixner
@ 2022-02-04 14:13     ` Jan Beulich
  2022-02-05  3:09       ` Ricardo Neri
  0 siblings, 1 reply; 5+ messages in thread
From: Jan Beulich @ 2022-02-04 14:13 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: xen-devel@lists.xenproject.org, the arch/x86 maintainers,
	Ricardo Neri, Peter Zijlstra

On 04.02.2022 15:08, Thomas Gleixner wrote:
> On Fri, Feb 04 2022 at 10:23, Jan Beulich wrote:
>> On 30.11.2021 12:09, Jan Beulich wrote:
>>> I think it is b968e84b509d ("x86/iopl: Fake iopl(3) CLI/STI usage")
>>> which uncovered an issue with get_desc() trying to access the GDT, as
>>> introduced by 670f928ba09b ("x86/insn-eval: Add utility function to
>>> get segment descriptor"). When running in a PV domain under Xen, the
>>> (hypervisor's) GDT isn't accessible; with UMIP enabled by Xen even
>>> SGDT wouldn't work, as the kernel runs in ring 3.
>>>
>>> There's currently no hypercall to retrieve a descriptor from the GDT.
>>> It is instead assumed that kernels know where their present GDT
>>> lives. Can the native_store_gdt() be replaced there, please?
>>>
>>> For context (I don't think it should matter much here) I'm observing
>>> this with the kernel put underneath a rather old distro, where
>>> hwclock triggers this path.
>>
>> I'd like to note that the issue still exists in 5.16.
> 
> I'd like to note, that I've seen no patches to that effect.

I could have worded it that way as well, yes.

Jan



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: x86: insn-eval.c's use of native_store_gdt()
  2022-02-04 14:13     ` Jan Beulich
@ 2022-02-05  3:09       ` Ricardo Neri
  0 siblings, 0 replies; 5+ messages in thread
From: Ricardo Neri @ 2022-02-05  3:09 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Thomas Gleixner, xen-devel@lists.xenproject.org,
	the arch/x86 maintainers, Peter Zijlstra

On Fri, Feb 04, 2022 at 03:13:52PM +0100, Jan Beulich wrote:
> On 04.02.2022 15:08, Thomas Gleixner wrote:
> > On Fri, Feb 04 2022 at 10:23, Jan Beulich wrote:
> >> On 30.11.2021 12:09, Jan Beulich wrote:
> >>> I think it is b968e84b509d ("x86/iopl: Fake iopl(3) CLI/STI usage")
> >>> which uncovered an issue with get_desc() trying to access the GDT, as
> >>> introduced by 670f928ba09b ("x86/insn-eval: Add utility function to
> >>> get segment descriptor"). When running in a PV domain under Xen, the
> >>> (hypervisor's) GDT isn't accessible; with UMIP enabled by Xen even
> >>> SGDT wouldn't work, as the kernel runs in ring 3.
> >>>
> >>> There's currently no hypercall to retrieve a descriptor from the GDT.
> >>> It is instead assumed that kernels know where their present GDT
> >>> lives. Can the native_store_gdt() be replaced there, please?
> >>>
> >>> For context (I don't think it should matter much here) I'm observing
> >>> this with the kernel put underneath a rather old distro, where
> >>> hwclock triggers this path.
> >>
> >> I'd like to note that the issue still exists in 5.16.
> > 
> > I'd like to note, that I've seen no patches to that effect.
> 
> I could have worded it that way as well, yes.

Hi Jan, I am sorry I missed your email. I'll look at the issue you
describe and get back to you.

Thanks and BR,
Ricardo


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-02-05  5:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-30 11:09 x86: insn-eval.c's use of native_store_gdt() Jan Beulich
2022-02-04  9:23 ` Jan Beulich
2022-02-04 14:08   ` Thomas Gleixner
2022-02-04 14:13     ` Jan Beulich
2022-02-05  3:09       ` Ricardo Neri

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.