[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH-for-5.2 0/2] net: Do not accept packets with invalid huge
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [RFC PATCH-for-5.2 0/2] net: Do not accept packets with invalid huge size |
Date: |
Fri, 27 Nov 2020 16:47:11 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 |
On 11/27/20 4:45 PM, Philippe Mathieu-Daudé wrote:
> Hi,
>
> This is a simple attempt to avoid the following pattern:
>
> ssize_t pkt_size = get_pkt_size(); // returns errno
Sorry, I meant: returns "-errno" (< 0).
>
> // no check
>
> send_packet(size_t size=pkt_size); // size casted to unsigned
> // -> overflow
>
> Regards,
>
> Phil.
>
> Philippe Mathieu-Daudé (2):
> net: Do not accept packets bigger then NET_BUFSIZE
> net: Assert no packet bigger than NET_BUFSIZE is queued
>
> net/net.c | 4 ++++
> net/queue.c | 7 +++++++
> 2 files changed, 11 insertions(+)
>