From nobody Thu Jun 5 09:32:55 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bCfPh00X6z5xHgG; Thu, 05 Jun 2025 09:32:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bCfPg6Q3Cz4HlX; Thu, 05 Jun 2025 09:32:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749115975; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eL8qGAuBzpoFSyPpwvhnPLr4Gp++iPkVLtMG5wdwoic=; b=Mcl9vzpURH6slqflHcNB9TCuPlrXRelYwLeDs+C2lzXh7HYdUwmLClqnOQciHOEvbchO9I TeC1HZ+Nuvd38b6LpUE9y2hj1hpyIkhdGg3e4GyLVc7thqCbN7ArZRbXUNuHF5G/QcJRpd Ea4kVEN8eO9YU5emVy52JYzOOSEqVJQBol6cWjpX+tIO+AZqHqWT9Mj8WLz53au5/Q6RDw 1NGlD/RXvERMb5xOgj5womqmNMKvE4Yu8GVV8b0u+DUke3qiY/8RvbgTiaV1HxSOuziMTr 0Xl+asAX2IpeXGj8L5+mwAhMVUWOWg85RaAZspBcJRnJTW7DNIcEpSeNjpkEeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749115975; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eL8qGAuBzpoFSyPpwvhnPLr4Gp++iPkVLtMG5wdwoic=; b=ICrtNTCDnLAXbhoNm5ZMRWeriPDO4bhM7v9/1oeqCoJiIYrvIAhW91AzyM/G04lE9tUU7n IdueyLMa6LyXvX4poguTjfkjrOrkZIN1ITjT9epEHESUArPktJcbg/hMwPy22IixWTdVw1 lqbZSgIaCCFAq/akiU7AjL6RecBU5ljZ/sr/6PlRqAbVabyyfatS0SSlwynENgZoZbWMYT lZd7DbhgFMmH8bZROTO8nMEK08nGrx4RE0eHiFBJnL+r6qGJAMZXccxj8MSqW1bU9hvHuf Poprysr2KPOFouKfXaiWzsLOONNPOhV2JRVKKi6hqUz0xlepYMVsmHduF2CCSA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749115975; a=rsa-sha256; cv=none; b=SV/yV9sPc5eDIk4/pjFXk3cfEy98aVphJFUjFsqTzi67gsBz0yVVjt00pi/p9gQtSTX4U8 6rgUI933TF6i+fY4HGx2hhueamp6hxrs8tt8qWetxQrWLmA0HkIAghByV4u+02Ge6UJDXs Xo91Y5rmoEiQQuXgt8C2K3azGyjkRzD4EsZY/1CzI/9RXbE+Y3ZNb6HPdazGhttczoin5B yGrNQYKvHI6XdlWdkcjJhsHMai0AeSr4kLSM2yTPO8nENNDeB9nPenzKEFj9Vm83yCoags fLMREY/t6FvEj6ad8fakKP5eYBoRq1erRRDYyun0ew+8v5pNmyq9BxwSIftSjg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bCfPg5yNBz146f; Thu, 05 Jun 2025 09:32:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 5559WtaB095368; Thu, 5 Jun 2025 09:32:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5559Wt51095365; Thu, 5 Jun 2025 09:32:55 GMT (envelope-from git) Date: Thu, 5 Jun 2025 09:32:55 GMT Message-Id: <202506050932.5559Wt51095365@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 38c655093c6b - main - route: fix rtentry double free List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 38c655093c6b641a4ed4e844af95859f66844f25 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=38c655093c6b641a4ed4e844af95859f66844f25 commit 38c655093c6b641a4ed4e844af95859f66844f25 Author: Kristof Provost AuthorDate: 2025-06-03 12:20:40 +0000 Commit: Kristof Provost CommitDate: 2025-06-05 07:52:33 +0000 route: fix rtentry double free add_route_flags() frees the rtentry on error when called with the RTM_F_CREATE flag. Don't free the rtentry a second time. Reviewed by: ae Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D50665 --- sys/net/route/route_ctl.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/net/route/route_ctl.c b/sys/net/route/route_ctl.c index 5a04e9dcf6e7..d629fd1625c3 100644 --- a/sys/net/route/route_ctl.c +++ b/sys/net/route/route_ctl.c @@ -673,12 +673,11 @@ rib_copy_route(struct rtentry *rt, const struct route_nhop_data *rnd_src, if (error != 0) { IF_DEBUG_LEVEL(LOG_DEBUG2) { char buf[NHOP_PRINT_BUFSIZE]; - rt_print_buf(rt_new, buf, sizeof(buf)); + rt_print_buf(rt, buf, sizeof(buf)); FIB_RH_LOG(LOG_DEBUG, rh_dst, "Unable to add route %s: error %d", buf, error); } nhop_free(nh); - rt_free_immediate(rt_new); } return (error); }