]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerDavid S. Miller <davem@davemloft.net>
Mon, 11 Dec 2017 19:05:31 +0000 (14:05 -0500)
commit7c81241262e45dce83f702d2d0e201156d621862
tree2b962b0543f8306cadba7cd992f3f523834e87a9
parentefd7cc58b3d29d90f1f52dde3e11cc612bddcd98
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: 992410952473 ("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>
net/ipv4/raw.c