/drivers/acorn/

ry'/>
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNguyen Dinh Phi <phind.uet@gmail.com>2021-07-18 22:40:13 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-07-28 09:12:35 +0200
commit853262355518cd1247515b74e83fabf038aa6c29 (patch)
tree7b6edc36aec52c1949a1a21ef999cdcdd98de9be
parent96151704247b61d5d61f6b842e11d8a96fe996ee (diff)
downloadlinux-853262355518cd1247515b74e83fabf038aa6c29.tar.gz
netrom: Decrease sock refcount when sock timers expire
[ Upstream commit 517a16b1a88bdb6b530f48d5d153478b2552d9a8 ] Commit 63346650c1a9 ("netrom: switch to sock timer API") switched to use sock timer API. It replaces mod_timer() by sk_reset_timer(), and del_timer() by sk_stop_timer(). Function sk_reset_timer() will increase the refcount of sock if it is called on an inactive timer, hence, in case the timer expires, we need to decrease the refcount ourselves in the handler, otherwise, the sock refcount will be unbalanced and the sock will never be freed. Signed-off-by: Nguyen Dinh Phi <phind.uet@gmail.com> Reported-by: syzbot+10f1194569953b72f1ae@syzkaller.appspotmail.com Fixes: 63346650c1a9 ("netrom: switch to sock timer API") Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>