[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130108174447.GA887@redhat.com>
Date: Tue, 8 Jan 2013 18:44:47 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: Srikar Dronamraju <srikar@...ux.vnet.ibm.com>
Cc: Ingo Molnar <mingo@...e.hu>, Peter Zijlstra <peterz@...radead.org>,
Ananth N Mavinakayanahalli <ananth@...ibm.com>,
Anton Arapov <anton@...hat.com>,
Frank Eigler <fche@...hat.com>,
Josh Stone <jistone@...hat.com>,
"Suzuki K. Poulose" <suzuki@...ibm.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 5/7] uprobes: Fix utask->xol_vaddr leak in pre_ssout()
On 01/08, Srikar Dronamraju wrote:
>
> * Oleg Nesterov <oleg@...hat.com> [2012-12-31 18:52:26]:
>
> > pre_ssout() should do xol_free_insn_slot() if arch_uprobe_pre_xol()
> > fails, otherwise nobody will free the allocated slot.
> >
> > Signed-off-by: Oleg Nesterov <oleg@...hat.com>
>
> Acked-by: Srikar Dronamraju <srikar@...ux.vnet.ibm.com>
Thanks!
> (one nit below)
> ...
> > @@ -1316,7 +1317,13 @@ pre_ssout(struct uprobe *uprobe, struct pt_regs *regs, unsigned long bp_vaddr)
> > utask->xol_vaddr = xol_vaddr;
> > utask->vaddr = bp_vaddr;
> >
> > - return arch_uprobe_pre_xol(&uprobe->arch, regs);
> > + err = arch_uprobe_pre_xol(&uprobe->arch, regs);
> > + if (unlikely(err)) {
> > + xol_free_insn_slot(current);
> > + return err;
> > + }
> > +
> > + return 0;
> > }
>
> Nit: we could reduce a line or two with
>
> err = arch_uprobe_pre_xol(&uprobe->arch, regs);
> if (unlikely(err))
> xol_free_insn_slot(current);
>
> return err;
Yes, but this is also preparation for the next patch which adds more
code after arch_uprobe_pre_xol() == 0.
Oleg.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists