mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 04:12:04 -04:00
xfrm: Fix crash when the hold queue is used.
[ Upstream commit 101dde4207f1daa1fda57d714814a03835dccc3f ] The commits "xfrm: Move dst->path into struct xfrm_dst" and "net: Create and use new helper xfrm_dst_child()." changed xfrm bundle handling under the assumption that xdst->path and dst->child are not a NULL pointer only if dst->xfrm is not a NULL pointer. That is true with one exception. If the xfrm hold queue is used to wait until a SA is installed by the key manager, we create a dummy bundle without a valid dst->xfrm pointer. The current xfrm bundle handling crashes in that case. Fix this by extending the NULL check of dst->xfrm with a test of the DST_XFRM_QUEUE flag. Fixes:0f6c480f23("xfrm: Move dst->path into struct xfrm_dst") Fixes:b92cf4aab8("net: Create and use new helper xfrm_dst_child().") Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
a4c902887f
commit
731e013e33
1 changed files with 2 additions and 2 deletions
|
|
@ -945,7 +945,7 @@ struct xfrm_dst {
|
|||
static inline struct dst_entry *xfrm_dst_path(const struct dst_entry *dst)
|
||||
{
|
||||
#ifdef CONFIG_XFRM
|
||||
if (dst->xfrm) {
|
||||
if (dst->xfrm || (dst->flags & DST_XFRM_QUEUE)) {
|
||||
const struct xfrm_dst *xdst = (const struct xfrm_dst *) dst;
|
||||
|
||||
return xdst->path;
|
||||
|
|
@ -957,7 +957,7 @@ static inline struct dst_entry *xfrm_dst_path(const struct dst_entry *dst)
|
|||
static inline struct dst_entry *xfrm_dst_child(const struct dst_entry *dst)
|
||||
{
|
||||
#ifdef CONFIG_XFRM
|
||||
if (dst->xfrm) {
|
||||
if (dst->xfrm || (dst->flags & DST_XFRM_QUEUE)) {
|
||||
struct xfrm_dst *xdst = (struct xfrm_dst *) dst;
|
||||
return xdst->child;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue