aboutsummaryrefslogtreecommitdiff
path: root/net/netrom
diff options
context:
space:
mode:
authorsantosh.shilimkar@oracle.com2015-08-22 15:45:33 -0700
committerDavid S. Miller2015-08-25 13:35:31 -0700
commitdfcec251d22bab947d10cf37e9ad67085cf7f097 (patch)
treedd9ef3f30a176b7aebe4dd24f9c73a1ff49939a9 /net/netrom
parent1c3be624f40acd6f2bd0f22ade081ac2467e8617 (diff)
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 flush them . 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. We must take m_rs_lock to access m_rs. Because of lock nesting and rs access, we also need to acquire rs_lock. Reviewed-by: Ajaykumar Hotchandani <ajaykumar.hotchandani@oracle.com> Signed-off-by: Santosh Shilimkar <ssantosh@kernel.org> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netrom')
0 files changed, 0 insertions, 0 deletions