[lkml]   [2004]   [Dec]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Patch in this message
    SubjectRe: [patch] kprobes: dont steal interrupts from vm86
    > Now the comments (that you just altered)
    > suggest that the break-point can be
    > removed by another CPU. I don't think
    > delivering the fault to the user-space
    > in this case is wise (but that's what
    > I'd care least, as I am not using the
    > kprobes myself yet). Maybe instead
    > it would be better to return 1 when

    The patch below takes both the cases into

    > Also, you still use the completely
    > invalid addrress and pass it to several
    > functions like get_kprobe() (addr is
    > invalid in either v86 case or when the
    > segmentation is used). Since the
    > deref is now optimized away by gcc, I
    > can't write an Oops test-case for this,
    > but why you do not perform the sanity
    > checks to see whether or not the address
    > is valid? (the checks like I suggested
    > in previous posting)
    I am not able to think of a case, where
    address is invalid when it enters int3 handler.
    I would appreciate if you can provide such a
    test case.

    Your comments are welcome.


    Stas reported that kprobes steals int3 exceptions when not in
    virtual-8086 mode. If processor executes int 3 INT n type instruction, it
    will end up executing int3 handler. This patch fixes the problem by returning 0,
    if the int3 exceptions does not belong to kprobes and allowing the kernel to
    handle it.

    Signed-off-by: Prasanna S Panchamukhi <>


    linux-2.6.10-rc3-prasanna/arch/i386/kernel/kprobes.c | 8 ++++++--
    1 files changed, 6 insertions(+), 2 deletions(-)

    diff -puN arch/i386/kernel/kprobes.c~kprobes-steals-int3 arch/i386/kernel/kprobes.c
    --- linux-2.6.10-rc3/arch/i386/kernel/kprobes.c~kprobes-steals-int3 2004-12-09 17:09:08.000000000 +0530
    +++ linux-2.6.10-rc3-prasanna/arch/i386/kernel/kprobes.c 2004-12-09 17:09:36.000000000 +0530
    @@ -117,8 +117,12 @@ static inline int kprobe_handler(struct
    p = get_kprobe(addr);
    if (!p) {
    - if (regs->eflags & VM_MASK) {
    - /* We are in virtual-8086 mode. Return 0 */
    + if ((regs->eflags & VM_MASK) ||
    + ((*addr == 0x3) && (*(addr - 1) == 0xcd))) {
    + /* Either we are in virtual-8086 mode, or we executed
    + * int 3 INT n type instruction. Let kernel handle
    + * it, return 0.
    + */
    goto no_kprobe;


    Prasanna S Panchamukhi
    Linux Technology Center
    India Software Labs, IBM Bangalore
    Ph: 91-80-25044636
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 14:08    [W:0.023 / U:2.476 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site