From: Elena Reshetova Date: Thu, 4 Jan 2018 10:03:54 +0000 (-0800) Subject: ipv4: prevent speculative execution X-Git-Tag: v4.1.12-124.31.3~1375 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=341e126e50e4f8fae1116de4355e3460c8344edf;p=users%2Fjedix%2Flinux-maple.git ipv4: prevent speculative execution Since the offset value in function raw_getfrag() seems to be controllable by userspace and later on conditionally (upon bound check) used in the following memcpy, insert an observable speculation barrier before its usage. This should prevent observable speculation on that branch and avoid kernel memory leak. Signed-off-by: Elena Reshetova Orabug: 27340445 CVE: CVE-2017-5753 Signed-off-by: Chuck Anderson Reviewed-by: John Haxby Signed-off-by: Kirtikar Kashyap --- diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c index 3e24498e8ffc..14dee7ef1fc1 100644 --- a/net/ipv4/raw.c +++ b/net/ipv4/raw.c @@ -466,6 +466,7 @@ static int raw_getfrag(void *from, char *to, int offset, int len, int odd, if (offset < rfv->hlen) { int copy = min(rfv->hlen - offset, len); + osb(); if (skb->ip_summed == CHECKSUM_PARTIAL) memcpy(to, rfv->hdr.c + offset, copy); else