l2tp: fix another panic in pppol2tp
authorWilly Tarreau <w@1wt.eu>
Mon, 29 Feb 2016 19:34:15 +0000 (20:34 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 12 Mar 2016 13:25:41 +0000 (14:25 +0100)
commite3dea3074f18a0c1dca8b6328b6bba0af3d61349
treee037db02fd0cab9e6149697a13229ed0f4cf5134
parent5a7c752dd867bbea6d6301e9e4154a169f2ca4f6
l2tp: fix another panic in pppol2tp

Commit 3feec9095d1 ("l2tp: Fix oops in pppol2tp_xmit") was backported
into 2.6.32.16 to fix a possible null deref in pppol2tp. But the same
still exists in pppol2tp_sendmsg() possibly causing the same crash.
Note that this bug doesn't appear to have any other impact than crashing
the system, as the dereferenced pointer is only used to test a value
against a 3-bit mask, so it can hardly be abused for anything except
leaking one third of a bit of memory.

This issue doesn't exist upstream because the code was replaced in 2.6.35
and the new function l2tp_xmit_skb() performs the appropriate check.

Reported-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Willy Tarreau <w@1wt.eu>
drivers/net/pppol2tp.c