]> git.baikalelectronics.ru Git - kernel.git/commit
xfrm: fix rcu usage in xfrm_get_type_offload
authorSabrina Dubroca <sd@queasysnail.net>
Sun, 31 Dec 2017 15:18:56 +0000 (16:18 +0100)
committerSteffen Klassert <steffen.klassert@secunet.com>
Sun, 31 Dec 2017 15:29:24 +0000 (16:29 +0100)
commit699b8db7e41a469b9a56b226e3dca7435d6025d8
treece6216dcf1b159f1c63a130778fe81105a3bd8fb
parent14db2d8efe85454b22b11682fd51d25ef13ef2da
xfrm: fix rcu usage in xfrm_get_type_offload

request_module can sleep, thus we cannot hold rcu_read_lock() while
calling it. The function also jumps back and takes rcu_read_lock()
again (in xfrm_state_get_afinfo()), resulting in an imbalance.

This codepath is triggered whenever a new offloaded state is created.

Fixes: 1e6eea29cb2b ("xfrm: Auto-load xfrm offload modules")
Reported-by: syzbot+ca425f44816d749e8eb49755567a75ee48cf4a30@syzkaller.appspotmail.com
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/xfrm/xfrm_state.c