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

Re: [Minios-devel] [UNIKRAFT PATCH 3/3] plat/kvm: Fix overwriting on stack for arm64


  • To: "Justin He (Arm Technology China)" <Justin.He@xxxxxxx>, "minios-devel@xxxxxxxxxxxxxxxxxxxx" <minios-devel@xxxxxxxxxxxxxxxxxxxx>, Simon Kuenzer <simon.kuenzer@xxxxxxxxx>
  • From: "Justin He (Arm Technology China)" <Justin.He@xxxxxxx>
  • Date: Thu, 26 Sep 2019 09:06:59 +0000
  • Accept-language: en-US, zh-CN
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=exp8x/WzKAg7tDs86SM2s4TCy632IhT7Orzxg9WJJhw=; b=hR7+9weKX2n/gVLSZjrVKD/+iYCyoGmSzf63uJKWg51+z5K40DeyQwjqTs/5gCuDoZGKmJbZXiok++Qy6Qo97vdK6nTNSYFaZQ9zi6ANFKTatW8rJjh6QI+oCSahaEDq77DGka0QgeAB+Fnd9cHFVczichTeBfHAvJzUbOuGgpaOJSFnTDHAXmWdX+hmmwO995+qzqU6Jf+mlobY5slqjPinQtiKnzJ3AfQK7dkvbLzRFPdEl0dkM2B6mu/4HHT/ERx1qWwHhBp6iK3cfh+HncBQQ7/o52ZrcQ2XZC62BO1Z/H0y1roJZUbC/n+j2xZV9IF6XviOLgQVwwRGiwHdSA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OW1AG4cyTVjNiHTj8zr6aHGpeJkpeb98+W37dRSn/cQttzl5OgKMKwwop7h7HVFHIm7tl0v6LPgc+Yn5hmKFi2OcsfMEk8sp/ydi97diCqWGSM4FDOaI5QgsvOlqzcZlct1cMjNpQiDvgaiEiXP8um4KNB6/YvgGfEOYZBrNCTX3TK/ntxUuzuzzJKgW/ZEk5uw1q0x+HeMAIf4FwKG1d+hl6oVzKj8Z+pjNLrylZcAw4XZAHDuja00lPfKjKs5mtwhwk9AF3bk957WK/B7IzNjB71wMmkxGJyuRcCjrv99B1f0zAKYPZOMi1svTE8mHx4RusXnvPJ8aPWi3XHHfxQ==
  • Authentication-results: spf=temperror (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;lists.xenproject.org; dmarc=none action=none header.from=arm.com;
  • Authentication-results-original: spf=none (sender IP is ) smtp.mailfrom=Justin.He@xxxxxxx;
  • Cc: Felipe Huici <felipe.huici@xxxxxxxxx>, "Kaly Xin \(Arm Technology China\)" <Kaly.Xin@xxxxxxx>, Julien Grall <Julien.Grall@xxxxxxx>, "Sharan.Santhanam@xxxxxxxxx" <Sharan.Santhanam@xxxxxxxxx>, "Santiago.Pagani@xxxxxxxxx" <Santiago.Pagani@xxxxxxxxx>
  • Delivery-date: Thu, 26 Sep 2019 09:07:18 +0000
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>
  • Original-authentication-results: spf=none (sender IP is ) smtp.mailfrom=Justin.He@xxxxxxx;
  • Thread-index: AQHVdENEndPgmfEWQkaN2mU+2iRYN6c9qn6A
  • Thread-topic: [UNIKRAFT PATCH 3/3] plat/kvm: Fix overwriting on stack for arm64

Hi all
Sorry, I worked on an old base of unikraft git tree.
At least I saw this patch need' to be changed/dropped due to a latest commit.

--
Cheers,
Justin (Jia He)



> -----Original Message-----
> From: Jia He <justin.he@xxxxxxx>
> Sent: 2019年9月26日 16:20
> To: minios-devel@xxxxxxxxxxxxxxxxxxxx; Simon Kuenzer
> <simon.kuenzer@xxxxxxxxx>
> Cc: Sharan.Santhanam@xxxxxxxxx; Felipe Huici <felipe.huici@xxxxxxxxx>;
> Julien Grall <Julien.Grall@xxxxxxx>; Kaly Xin (Arm Technology China)
> <Kaly.Xin@xxxxxxx>; Santiago.Pagani@xxxxxxxxx; Justin He (Arm
> Technology China) <Justin.He@xxxxxxx>
> Subject: [UNIKRAFT PATCH 3/3] plat/kvm: Fix overwriting on stack for
> arm64
>
> On arm64, the _libkvmplat_cfg.bstack.end is the memory upper boundary.
> Any overflow writing beyond this will cause an exception.
>
> Fix it by writing the thread inside the boundary.
> Signed-off-by: Jia He <justin.he@xxxxxxx>
> ---
>  plat/kvm/memory.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/plat/kvm/memory.c b/plat/kvm/memory.c
> index e96bad2..d84eaed 100644
> --- a/plat/kvm/memory.c
> +++ b/plat/kvm/memory.c
> @@ -181,6 +181,7 @@ int _ukplat_mem_mappings_init(void)
>
>  void ukplat_stack_set_current_thread(void *thread_addr)
>  {
> -     *((unsigned long *) _libkvmplat_cfg.bstack.end) =
> +     unsigned long size = sizeof(thread_addr);
> +     *((unsigned long *) _libkvmplat_cfg.bstack.end - size) =
>               (unsigned long) thread_addr;
>  }
> --
> 2.17.1

IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium. Thank you.
_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

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