Repository navigation
Commit caade06
net: sock: validate data_len before allocating skb in sock_alloc_send_pskb()
[ Upstream commit cc9b17a ]
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>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>1 parent bd00fcf commit caade06
1 file changed
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1497 | 1497 | | |
1498 | 1498 | | |
1499 | 1499 | | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
1500 | 1505 | | |
1501 | 1506 | | |
1502 | 1507 | | |
| |||
1515 | 1520 | | |
1516 | 1521 | | |
1517 | 1522 | | |
1518 | | - | |
1519 | 1523 | | |
1520 | 1524 | | |
1521 | 1525 | | |
1522 | 1526 | | |
1523 | 1527 | | |
1524 | 1528 | | |
1525 | | - | |
1526 | 1529 | | |
1527 | 1530 | | |
1528 | 1531 | | |
| |||
0 commit comments