Skip to content

Buffer overflow on too many break-points #32

@pruzko

Description

@pruzko

If you set a break-point on the same address numerous times the python process crashes. This happens e.g. when you set a bp from a callback function:

addr_1 = 0x...
addr_2 = 0x...

def cb_1(): print('1')

def cb_2():
    with vm.break_on_physical(addr_1, cb_1)
        ...

with vm.break_on_physical(addr_2, cb_2)
    ...

# guest is calling addr_2 and addr_1 fiercely

The solution is rather obvious - one must keep track of addresses that already have a bp set and prevent duplicate bps. However, I thought SIGSEGV is not intended behavior so I did a little investigation.

Long story short, the buffer in struct Worker gets overflown and the co_thread pointer gets malformed. A following call to co_switch is going to kill the python process.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions