Thread (7 messages) flat view 7 messages, 3 authors, 2016-10-19

Re: [RFC PATCH 2/3] powerpc/pseries: Define & use a type for the plpar_hcall() retvals

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2016-10-19 11:47:27

Balbir Singh [off-list ref] writes:
On 18/10/16 19:40, Michael Ellerman wrote:
quoted
We have now had two nasty stack corruption bugs caused by incorrect
sizing of the return buffer for plpar_hcall()/plpar_hcall9().

To avoid any more such bugs, define a type which encodes the size of the
return buffer, and change the argument of plpar_hcall() to be of that
type, meaning the compiler will check for us that we passed the right
size buffer.

There isn't an easy way to do this incrementally, without introducing a
new function name, eg. plpar_hcall_with_struct(), which is ugly as hell.
So just do it in one tree-wide change.
Conceptually looks god, but I think we need to abstract the return values
as well. I'll test and see if I can send you something on top of this
Not sure I know what you mean.

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help