All of lore.kernel.org
 help / color / mirror / Atom feed
* sgx_validate_offset_length bug
@ 2022-10-03 17:19 Borys
  2022-10-03 17:33 ` Reinette Chatre
  2022-10-04 21:50 ` Jarkko Sakkinen
  0 siblings, 2 replies; 8+ messages in thread
From: Borys @ 2022-10-03 17:19 UTC (permalink / raw)
  To: jarkko, dave.hansen, linux-sgx; +Cc: mkow

Hi,

I've stumbled upon "sgx_validate_offset_length" function in "arch/x86/kernel/cpu/sgx/ioctl.c" (all of this is based on 6.0-rc7 version), which does not entirely do what it claims. "offset" and "length" parameters are provided by userspace and as such their addition can overflow, which may result in this function approving malicious values. Fortunately this does not result in any exploitable bugs at the moment (or at least I couldn't find any), but this might change if "sgx_validate_offset_length" is used in a new context or current usages are changed, so it might be worth fixing anyway. Simple overflow check `offset + length < offset` should be enough.

Best regards,

Borys


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

end of thread, other threads:[~2022-10-04 23:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-03 17:19 sgx_validate_offset_length bug Borys
2022-10-03 17:33 ` Reinette Chatre
2022-10-03 17:58   ` Reinette Chatre
2022-10-04 13:22     ` Borys
2022-10-04 15:21       ` Reinette Chatre
2022-10-04 21:50 ` Jarkko Sakkinen
2022-10-04 23:02   ` Borys
2022-10-04 23:13     ` Jarkko Sakkinen

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.