From: Allan Stephens Date: Mon, 23 May 2011 17:57:25 +0000 (-0400) Subject: tipc: Add sanity check to detect rejection of non-payload messages X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=76d12527f74ad1b42b068252fdd2056c8ae48a99;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git tipc: Add sanity check to detect rejection of non-payload messages Introduces an internal sanity check to ensure that the only undeliverable messages TIPC attempts to return to their origin are application payload messages. Signed-off-by: Allan Stephens Signed-off-by: Paul Gortmaker --- diff --git a/net/tipc/port.c b/net/tipc/port.c index 3946b5b10c74..756e64cbff96 100644 --- a/net/tipc/port.c +++ b/net/tipc/port.c @@ -367,6 +367,12 @@ int tipc_reject_msg(struct sk_buff *buf, u32 err) imp++; /* discard rejected message if it shouldn't be returned to sender */ + + if (WARN(!msg_isdata(msg), + "attempt to reject message with user=%u", msg_user(msg))) { + dump_stack(); + goto exit; + } if (msg_errcode(msg) || msg_dest_droppable(msg)) goto exit;