Re: Nanokernel stack border protection


D'alton, Alexandre <alexandre.dalton@...>
 

Hi,

FIY, ARC has this implemented (see CONFIG_ARC_STACK_CHECKING)
And it is more than useful !

Regards,
Alex.

-----Original Message-----
From: Jon Medhurst (Tixy) [mailto:tixy(a)linaro.org]
Sent: Monday, September 26, 2016 11:01 AM
To: devel(a)lists.zephyrproject.org
Subject: [devel] Re: Re: Nanokernel stack border protection

On Sun, 2016-09-25 at 10:08 +0000, Boie, Andrew P wrote:
On Sat, 2016-09-24 at 14:39 +0800, tidyjiang(a)163.com wrote:
Hi All,

The nanokernel uses an array as stack memory space, but there is no
border protection when push data to the stack. When the array is
already full, it will cause array overfow, leading to unpredictable
behavior.

Why not add the border protection? When the array is full, it
returns an error code to user.

Is it necessary ?
How would you propose to implement such a border protection?
Use the features provided by the CPU? On ARM Cortex-M, the stack limit
registers PSPLIM and MSPLIM. Presumably other CPUs have similar things.

--
Tixy
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number: 302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

Join devel@lists.zephyrproject.org to automatically receive all group messages.