Revert "net-packet: fix race in packet_set_ring on PACKET_RESERVE"

This reverts commit ccf7bb73.

CVE-2017-1000111
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 28036919
......@@ -3622,19 +3622,14 @@ packet_setsockopt(struct socket *sock, int level, int optname, char __user *optv
if (optlen != sizeof(val))
return -EINVAL;
if (po->rx_ring.pg_vec || po->tx_ring.pg_vec)
return -EBUSY;
if (copy_from_user(&val, optval, sizeof(val)))
return -EFAULT;
if (val > INT_MAX)
return -EINVAL;
lock_sock(sk);
if (po->rx_ring.pg_vec || po->tx_ring.pg_vec)
ret = -EBUSY;
else {
po->tp_reserve = val;
ret = 0;
}
release_sock(sk);
return ret;
po->tp_reserve = val;
return 0;
}
case PACKET_LOSS:
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment