Repository navigation
Commit cc9b17a
net: sock: validate data_len before allocating skb in sock_alloc_send_pskb()
We need to validate the number of pages consumed by data_len, otherwise frags
array could be overflowed by userspace. So this patch validate data_len and
return -EMSGSIZE when data_len may occupies more frags than MAX_SKB_FRAGS.
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>1 parent 914bec1 commit cc9b17a
1 file changed
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1592 | 1592 | | |
1593 | 1593 | | |
1594 | 1594 | | |
| 1595 | + | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
1595 | 1600 | | |
1596 | 1601 | | |
1597 | 1602 | | |
| |||
1610 | 1615 | | |
1611 | 1616 | | |
1612 | 1617 | | |
1613 | | - | |
1614 | 1618 | | |
1615 | 1619 | | |
1616 | 1620 | | |
1617 | 1621 | | |
1618 | 1622 | | |
1619 | 1623 | | |
1620 | | - | |
1621 | 1624 | | |
1622 | 1625 | | |
1623 | 1626 | | |
| |||
0 commit comments