public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* rseq: How to test for compat task at signal delivery
@ 2018-06-26 17:38 Mathieu Desnoyers
  2018-06-26 18:45 ` Mathieu Desnoyers
  0 siblings, 1 reply; 8+ messages in thread
From: Mathieu Desnoyers @ 2018-06-26 17:38 UTC (permalink / raw)
  To: Andy Lutomirski
  Cc: Peter Zijlstra, Boqun Feng, linux-kernel, Paul E. McKenney,
	Thomas Gleixner

Hi Andy,

I would like to make the behavior rseq on compat tasks more robust
by ensuring that kernel/rseq.c:rseq_get_rseq_cs() clears the high
bits of rseq_cs->abort_ip, rseq_cs->start_ip and
rseq_cs->post_commit_offset when a 32-bit binary is run on a 64-bit
kernel.

The intent here is that if user-space has garbage rather than zeroes
in its struct rseq_cs fields padding, the behavior will be the same
whether the binary is run on 32-bit or 64 kernels.

I know that internally, the kernel is making a transition from
is_compat_task() to in_compat_syscall().

I'm fine with using in_compat_syscall() when rseq_get_rseq_cs() is
invoked from a system call, but is it OK to call it when it is
invoked from signal delivery ? AFAIU, signals can be delivered
upon return from interrupt as well.

If not, what strategy do you recommend for arch-agnostic code ?

Thanks,

Mathieu

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com

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

end of thread, other threads:[~2018-06-26 21:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-26 17:38 rseq: How to test for compat task at signal delivery Mathieu Desnoyers
2018-06-26 18:45 ` Mathieu Desnoyers
2018-06-26 19:32   ` Andy Lutomirski
2018-06-26 19:50     ` Mathieu Desnoyers
2018-06-26 19:55       ` Andy Lutomirski
2018-06-26 20:12         ` Mathieu Desnoyers
2018-06-26 20:46           ` Andy Lutomirski
2018-06-26 21:19             ` Mathieu Desnoyers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox