Commit 8228a18d authored by Leigh Brown's avatar Leigh Brown Committed by David S. Miller

[TCP]: Fix oops caused by tcp_v4_md5_do_del

md5sig_info.alloced4 must be set to zero when freeing keys4, otherwise
it will not be alloc'd again when another key is added to the same
socket by tcp_v4_md5_do_add.
Signed-off-by: default avatarLeigh Brown <leigh@solinno.co.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d8172d82
...@@ -928,6 +928,7 @@ int tcp_v4_md5_do_del(struct sock *sk, __be32 addr) ...@@ -928,6 +928,7 @@ int tcp_v4_md5_do_del(struct sock *sk, __be32 addr)
if (tp->md5sig_info->entries4 == 0) { if (tp->md5sig_info->entries4 == 0) {
kfree(tp->md5sig_info->keys4); kfree(tp->md5sig_info->keys4);
tp->md5sig_info->keys4 = NULL; tp->md5sig_info->keys4 = NULL;
tp->md5sig_info->alloced4 = 0;
} else if (tp->md5sig_info->entries4 != i) { } else if (tp->md5sig_info->entries4 != i) {
/* Need to do some manipulation */ /* Need to do some manipulation */
memcpy(&tp->md5sig_info->keys4[i], memcpy(&tp->md5sig_info->keys4[i],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment