]> git.baikalelectronics.ru Git - kernel.git/commit
net/smc: Fix af_ops of child socket pointing to released memory
authorKarsten Graul <kgraul@linux.ibm.com>
Fri, 8 Apr 2022 15:10:35 +0000 (17:10 +0200)
committerJakub Kicinski <kuba@kernel.org>
Tue, 12 Apr 2022 01:28:03 +0000 (18:28 -0700)
commit72c05e1df06575e23d5dbcfa0834e98b1f8a892b
treec77ba33014b956c110acfe9afd5dd81ac992f661
parent2bd4605e72aaf412dac81198e682656a0d9d5e8b
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: 54de682a020a ("net/smc: Limit backlog connections")
Reviewed-by: Wenjia Zhang <wenjia@linux.ibm.com>
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Reviewed-by: D. Wythe <alibuda@linux.alibaba.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/smc/af_smc.c