net: ipv4: fix for a race condition in raw_sendmsg
authorMohamed Ghannam <simo.ghannam@gmail.com>
Sun, 10 Dec 2017 03:50:58 +0000 (03:50 +0000)
committerYves-Alexis Perez <corsac@debian.org>
Thu, 4 Jan 2018 11:12:40 +0000 (11:12 +0000)
commit598f2f280e931a63899e423bbfb7045cd32d1725
tree3b4089bab1b6ff2acf91820d078f280b5d6389dc
parent1ffdaece098130b1be3b439f43e8e347699de130
net: ipv4: fix for a race condition in raw_sendmsg

inet->hdrincl is racy, and could lead to uninitialized stack pointer
usage, so its value should be read only once.

Fixes: c008ba5bdc9f ("ipv4: Avoid reading user iov twice after raw_probe_proto_opt")
Signed-off-by: Mohamed Ghannam <simo.ghannam@gmail.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[bwh: Backported to 4.9: adjust context]

Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name net-ipv4-fix-for-a-race-condition-in-raw_sendmsg.patch
net/ipv4/raw.c