Thread (8 messages) 8 messages, 3 authors, 2019-06-25

Re: [PATCH] structleak: disable BYREF_ALL in combination with KASAN_STACK

From: Ard Biesheuvel <hidden>
Date: 2019-06-25 15:01:43
Also in: lkml

On Sat, 22 Jun 2019 at 22:26, Kees Cook [off-list ref] wrote:
On Fri, Jun 21, 2019 at 03:50:02PM +0200, Ard Biesheuvel wrote:
quoted
On Fri, 21 Jun 2019 at 15:44, Arnd Bergmann [off-list ref] wrote:
quoted
One pattern I have seen here is temporary variables from macros or
inline functions whose lifetime now extends over the entire function
rather than just the basic block in which they are defined, see e.g.
lpfc_debug_dump_qe() being inlined multiple times into
lpfc_debug_dump_all_queues(). Each instance of the local
"char line_buf[LPFC_LBUF_SZ];" seems to add on to the previous
one now, where the behavior without the structleak plugin is that
they don't.
Ewww.
quoted
Right, that seems to be due to the fact that this code

/* split the first bb where we can put the forced initializers */
gcc_assert(single_succ_p(ENTRY_BLOCK_PTR_FOR_FN(cfun)));
bb = single_succ(ENTRY_BLOCK_PTR_FOR_FN(cfun));
if (!single_pred_p(bb)) {
    split_edge(single_succ_edge(ENTRY_BLOCK_PTR_FOR_FN(cfun)));
    gcc_assert(single_succ_p(ENTRY_BLOCK_PTR_FOR_FN(cfun)));
}

puts all the initializers at the beginning of the function rather than
inside the scope of the definition.
Do you see a sane way to improve this? I hadn't noticed that this
actually moved it up to the start of the function. :(
Not from the top of my head, and I won't be able to spend any time on
this in the near future, unfortunately.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help