From: Michal Kubecek Date: Thu, 17 Oct 2013 13:07:40 +0000 (+0200) Subject: xfrm: prevent ipcomp scratch buffer race condition X-Git-Tag: omap-for-v3.13/fixes-for-merge-window-take2~67^2~4^2~2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=12e3594698f6c3ab6ebacc79f2fb2ad2bb5952b5;p=pandora-kernel.git xfrm: prevent ipcomp scratch buffer race condition In ipcomp_compress(), sortirq is enabled too early, allowing the per-cpu scratch buffer to be rewritten by ipcomp_decompress() (called on the same CPU in softirq context) between populating the buffer and copying the compressed data to the skb. v2: as pointed out by Steffen Klassert, if we also move the local_bh_disable() before reading the per-cpu pointers, we can get rid of get_cpu()/put_cpu(). v3: removed ipcomp_decompress part (as explained by Herbert Xu, it cannot be called from process context), get rid of cpu variable (thanks to Eric Dumazet) Signed-off-by: Michal Kubecek Reviewed-by: Eric Dumazet Acked-by: Herbert Xu Signed-off-by: Steffen Klassert --- Reading git-diff-tree failed