[PATCH 3.14 08/11] rds: fix an infoleak in rds_inc_info_copy

From: Greg Kroah-Hartman
Date: Fri Sep 09 2016 - 11:34:23 EST


3.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Kangjie Lu <kangjielu@xxxxxxxxx>

commit 4116def2337991b39919f3b448326e21c40e0dbb upstream.

The last field "flags" of object "minfo" is not initialized.
Copying this object out may leak kernel stack data.
Assign 0 to it to avoid leak.

Signed-off-by: Kangjie Lu <kjlu@xxxxxxxxxx>
Acked-by: Santosh Shilimkar <santosh.shilimkar@xxxxxxxxxx>
Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
Signed-off-by: Juerg Haefliger <juerg.haefliger@xxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
net/rds/recv.c | 2 ++
1 file changed, 2 insertions(+)

--- a/net/rds/recv.c
+++ b/net/rds/recv.c
@@ -543,5 +543,7 @@ void rds_inc_info_copy(struct rds_incomi
minfo.fport = inc->i_hdr.h_dport;
}

+ minfo.flags = 0;
+
rds_info_copy(iter, &minfo, sizeof(minfo));
}