Skip to content

Fixed stack canary causes potential security issue #8

@rota1001

Description

@rota1001

The task_stack_check funciton uses a contant magic number STACK_CANARY to detect the corruption of stack. However, attackers can forge the canary to bypass the detection, causing some buffer overflows (or underflows) become arbitrary write on the stack. Moreover, since user and kernel program share an address space, some vulnerabilities in user program will cause some problems in kernel.

Thus, I wonder if we need a random stack canary in this kernel, adding an element uint32_t canary to tcb_t and using random to generate a random canary during initialization. Although the random in libc.c is not quite secure (It is predictable), it can be improved in the future.

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