]> www.infradead.org Git - users/jedix/linux-maple.git/commit
RDS: make sure rds_send_drop_to properly takes the m_rs_lock
authorChris Mason <chris.mason@oracle.com>
Fri, 3 Feb 2012 16:09:07 +0000 (11:09 -0500)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Tue, 7 Jul 2015 23:41:33 +0000 (16:41 -0700)
commitfcd07c90227362109190d2815106d61bae0fbdc2
treeecff4fbcbee2d7a9afb78199ea583616d87bdcc2
parentf15013731b8ed36335f8916c2d5f451c62f53e12
RDS: make sure rds_send_drop_to properly takes the m_rs_lock

rds_send_drop_to is used during socket tear down to find all the
messages on the socket and clean them up.  It can race with the
acking code unless it takes the m_rs_lock on each and every message.

This plugs a hole where we didn't take m_rs_lock on any message that
didn't have the RDS_MSG_ON_CONN set.  Taking m_rs_lock avoids
double frees and other memory corruptions as the ack code trusts
the message m_rs pointer on a socket that had actually been freed.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
net/rds/send.c