From: Eric Dumazet Date: Fri, 9 Oct 2015 18:29:32 +0000 (-0700) Subject: packet: fix match_fanout_group() X-Git-Tag: v3.2.74~43 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9914546b256457c85e45c99f9d95759b07452f1a;p=pandora-kernel.git packet: fix match_fanout_group() commit 161642e24fee40fba2c5bc2ceacc00d118a22d65 upstream. Recent TCP listener patches exposed a prior af_packet bug : match_fanout_group() blindly assumes it is always safe to cast sk to a packet socket to compare fanout with af_packet_priv But SYNACK packets can be sent while attached to request_sock, which are smaller than a "struct sock". We can read non existent memory and crash. Fixes: c0de08d04215 ("af_packet: don't emit packet on orig fanout group") Fixes: ca6fb0651883 ("tcp: attach SYNACK messages to request sockets instead of listener") Signed-off-by: Eric Dumazet Cc: Willem de Bruijn Cc: Eric Leblond Signed-off-by: David S. Miller Signed-off-by: Ben Hutchings --- Reading git-diff-tree failed