<br><br><div class="gmail_quote">On Thu, Mar 10, 2011 at 6:15 PM, Will Deacon <span dir="ltr"><<a href="mailto:will.deacon@arm.com">will.deacon@arm.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Bryan,<br>
<div class="im"><br>
> > Hi Bryan,<br>
> ><br>
> > Feel free to upgrade your tag on this (signed-off / acked) since this is<br>
> > clearly based on the patch you posted yesterday. I'd like to get this to<br>
> > Russell ASAP so that we don't get a build-breaker in the near future.<br>
> ><br>
><br>
> Oh, I missed this email. Just send out an similar patch.<br>
<br>
</div>No problem, I'd just like to get this in the pipeline asap!<br>
<div class="im"><br>
> > diff --git a/arch/arm/include/asm/a.out-core.h b/arch/arm/include/asm/a.out-core.h<br>
> > index 93d04ac..92f10cb 100644<br>
> > --- a/arch/arm/include/asm/a.out-core.h<br>
> > +++ b/arch/arm/include/asm/a.out-core.h<br>
> > @@ -32,11 +32,7 @@ static inline void aout_dump_thread(struct pt_regs *regs, struct user *dump)<br>
> > dump->u_dsize = (tsk->mm->brk - tsk->mm->start_data + PAGE_SIZE - 1) >> PAGE_SHIFT;<br>
> > dump->u_ssize = 0;<br>
> ><br>
> > - dump->u_debugreg[0] = tsk->thread.debug.bp[0].address;<br>
> > - dump->u_debugreg[1] = tsk->thread.debug.bp[1].address;<br>
> > - dump->u_debugreg[2] = tsk->thread.debug.bp[0].insn.arm;<br>
> > - dump->u_debugreg[3] = tsk->thread.debug.bp[1].insn.arm;<br>
> > - dump->u_debugreg[4] = tsk->thread.debug.nsaved;<br>
> > + memset(dump->u_debugreg, 0, sizeof(dump->u_debugreg));<br>
> ><br>
> I think this should be<br>
> memset(dump->u_debugreg, 0, sizeof(dump->u_debugreg) * 8);<br>
><br>
> u_debugreg is a pointer to a int, the array contains 8 of them as we<br>
> found in the user.h<br>
<br>
</div>dump_udebugreg is an integer array of fixed size. If you look at<br>
the disassembly of fs/binfmt_aout.o (removed some inlining,<br>
recompiled with -01):<br>
<br>
00000c7c <aout_dump_thread>:<br>
c7c: e92d4038 push {r3, r4, r5, lr}<br>
c80: e1a05000 mov r5, r0<br>
c84: e1a04001 mov r4, r1<br>
c88: e1a0200d mov r2, sp<br>
<br>
[...]<br>
<br>
cfc: e2840090 add r0, r4, #144 ; 0x90<br>
d00: e3a01020 mov r1, #32<br>
d04: ebfffffe bl 0 <__memzero><br>
<br>
So the size from sizeof is correct, multiplying it by 8 is asking<br>
for trouble! If we used the ARRAY_SIZE macro, then the multiplication<br>
would be necessary because we would have performed the division inside<br>
the macro.<br>
<br>
Please can you submit another patch? I think the one I posted the other<br>
day was alright, so if you re-post that you can add my S-o-B.<br>
<br>
Thanks,<br>
<font color="#888888"><br>
Will<br>
<br></font></blockquote><div>Ah, yeah, I got it.</div><div><br></div><div>I think your patch is right, no need for me to repost. Please add my SOB</div><div><br></div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">Signed-off-by: Bryan Wu <<a href="mailto:bryan.wu@canonical.com" style="color: rgb(66, 99, 171); ">bryan.wu@canonical.com</a>></span></div>
<div><br></div><div>Thanks,</div><div>-Bryan </div></div>