net/smc: Fix af_ops of child socket pointing to released memory

Child sockets may inherit the af_ops from the parent listen socket.
When the listen socket is released then the af_ops of the child socket
points to released memory.
Solve that by restoring the original af_ops for child sockets which
inherited the parent af_ops. And clear any inherited user_data of the
parent socket.

Fixes: 8270d9c21041 ("net/smc: Limit backlog connections")
Reviewed-by: Wenjia Zhang <>
Signed-off-by: Karsten Graul <>
Reviewed-by: D. Wythe <>
Signed-off-by: Jakub Kicinski <>
1 file changed