Skip to content

eg_30_netdev vulnerabilities #10

@sefnix

Description

@sefnix

Hi,
One of the vulnerabilities is a buffer overflow issue in the ldd_dev_rx() function. This function is called when a packet is received by the network device, and it copies the packet data into a newly allocated sk_buff object. However, the size of the allocated sk_buff is only the size of the packet data, which means that if the packet data is larger than the allocated buffer, it will overflow. This can potentially lead to arbitrary code execution.

Another vulnerability is the use of spin_lock_irqsave() and spin_unlock_irqrestore() without checking the return values. These functions can fail if called from an interrupt context with interrupts disabled, which can cause a kernel panic.

There is also a race condition in the ldd_enqueue_buf() function. This function adds received packets to a queue, but it does not use any synchronization mechanisms to protect against concurrent access. This can potentially result in packets being added to the queue out of order, leading to unpredictable behavior.

Finally, there is a potential deadlock in the ldd_release_buffer() function. This function releases packets back to the packet pool, and it checks whether the queue is stopped. If it is, it calls netif_wake_queue() to restart the queue. However, this function acquires a spinlock, which can potentially lead to a deadlock if another thread is already holding the lock and waiting for a packet to be released.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions