diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2022-06-29 22:20:48 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2022-06-29 22:20:48 +0000 |
commit | fc4b61e2bcc0fb04a7c76fa23419092be753926b (patch) | |
tree | 60fcca6e1becf5d699eff36b4b637613d46f3958 /sys/net | |
parent | ebc7d99d21b1941569204a98e93390fa2b382484 (diff) |
Between the calls to art_match() and SRPL_FIRST() another CPU may
remove the route from the list. In rtable_match() check if the
route entry is NULL.
discussed with mpi@ jmatthew@ claudio@; OK mpi@
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/rtable.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/net/rtable.c b/sys/net/rtable.c index 6a5f022bef2..90207ae54af 100644 --- a/sys/net/rtable.c +++ b/sys/net/rtable.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtable.c,v 1.79 2022/06/28 10:01:13 bluhm Exp $ */ +/* $OpenBSD: rtable.c,v 1.80 2022/06/29 22:20:47 bluhm Exp $ */ /* * Copyright (c) 2014-2016 Martin Pieuchot @@ -486,6 +486,10 @@ rtable_match(unsigned int rtableid, struct sockaddr *dst, uint32_t *src) goto out; rt = SRPL_FIRST(&sr, &an->an_rtlist); + if (rt == NULL) { + SRPL_LEAVE(&sr); + goto out; + } rtref(rt); SRPL_LEAVE(&sr); |