| | Subject | Re: [PATCH v7 3.2-rc2 9/30] uprobes: Background page replacement. | | From | Peter Zijlstra <> | | Date | Fri, 25 Nov 2011 15:29:24 +0100 |
| |
On Fri, 2011-11-18 at 16:38 +0530, Srikar Dronamraju wrote: > + /* poke the new insn in, ASSUMES we don't cross page boundary */ > + vaddr &= ~PAGE_MASK; > + memcpy(vaddr_new + vaddr, &opcode, uprobe_opcode_sz);
I still don't get why you don't simply write something like:
BUG_ON(vaddr + uprobe_opcode_size >= PAGE_SIZE);
That's as descriptive as the comment and actually does something if someone got it wrong, instead of silently corrupting crap.
|