rds: fix an infoleak in rds_inc_info_copy
authorKangjie Lu <kangjielu@gmail.com>
Thu, 2 Jun 2016 08:11:20 +0000 (04:11 -0400)
committerBen Hutchings <ben@decadent.org.uk>
Mon, 22 Aug 2016 21:37:19 +0000 (22:37 +0100)
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@gatech.edu>
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
net/rds/recv.c

index 96a1239..9e28c99 100644 (file)
@@ -544,5 +544,7 @@ void rds_inc_info_copy(struct rds_incoming *inc,
                minfo.fport = inc->i_hdr.h_dport;
        }
 
                minfo.fport = inc->i_hdr.h_dport;
        }
 
+       minfo.flags = 0;
+
        rds_info_copy(iter, &minfo, sizeof(minfo));
 }
        rds_info_copy(iter, &minfo, sizeof(minfo));
 }