[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20120618120831.GB4629@linux.vnet.ibm.com>
Date: Mon, 18 Jun 2012 17:38:31 +0530
From: Srikar Dronamraju <srikar@...ux.vnet.ibm.com>
To: Oleg Nesterov <oleg@...hat.com>
Cc: Ingo Molnar <mingo@...e.hu>,
Ananth N Mavinakayanahalli <ananth@...ibm.com>,
Anton Arapov <anton@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 11/15] uprobes: move BUG_ON(UPROBE_SWBP_INSN_SIZE) from
write_opcode() to install_breakpoint()
* Oleg Nesterov <oleg@...hat.com> [2012-06-15 19:52:48]:
> On 06/15, Srikar Dronamraju wrote:
> >
> > > @@ -699,6 +694,10 @@ install_breakpoint(struct uprobe *uprobe, struct mm_struct *mm,
> > > if (ret)
> > > return ret;
> > >
> > > + /* write_opcode() assumes we don't cross page boundary */
> > > + BUG_ON((uprobe->offset & ~PAGE_MASK) +
> > > + UPROBE_SWBP_INSN_SIZE > PAGE_SIZE);
> > > +
> > > uprobe->flags |= UPROBE_COPY_INSN;
> > > }
> >
> > I am now thinking if we really need a BUG_ON?
>
> I was thinking about this too.
>
> > I am now thinking I should
> > have had a check at the start in uprobe_register() and failed the request.
> >
> > Something like
> > if ((offset & ~PAGE_MASK) + UPROBE_SWBP_INSN_SIZE > PAGE_SIZE)
> > return -EINVAL;
>
> Perhaps. Or we can simply remove it. arch_uprobe_analyze_insn()
> should be careful anyway, and all this validation should be moved
> into uprobe_register/alloc_uprobe.
>
> I do not really mind, I only wanted to simplify write_opcode() which
> does a lot of unnecessary things (say, lock_page, I am going to kill
> it).
>
> So. Do you want me to redo this patch? Or do you think we can keep
> this "must not happen after arch_uprobe_analyze_insn" check?
>
No, I will just fix it up later.
--
Thanks and Regards
Srikar
--
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