]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: fix use-after-free
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 3 Oct 2022 03:35:29 +0000 (12:35 +0900)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 3 Oct 2022 07:15:10 +0000 (09:15 +0200)
If the lifetime of the route is already expired, do not try to
configure it.

Fixes a use-after-free, as the Request object is already freed, thus, we
cannot use Route or Link stored in Request object.

src/network/networkd-route.c

index 3f460e0ba4b2f28830b47baf98269630c17b536f..f1fba4ff4259816a11e292db51f0ef1920760350 100644 (file)
@@ -1382,6 +1382,8 @@ static int route_process_request(Request *req, Link *link, Route *route) {
                         }
                 else
                         route_cancel_requesting(route);
+
+                return 1;
         }
 
         r = route_configure(route, sec, link, req);