1
0
mirror of https://github.com/openbsd/src.git synced 2026-06-18 15:23:33 +02:00

plug a memory leak when detaching codel ifq disciplines on an interface.

fqcodel_alloc() takes (moves) ownership of memory allocated as part
of the pf queue code that sets up the queue discipline, but nothing
releases it when the discipline is removed from the interface. every
time you load a pf rulese that uses codel, it temporarily resets
an interface to priq before creating and attaching new codel
instances. this means every ruleset load would leak memory, to the
point where M_DEVBUF allocations exhaust the kernel map.

this has fqcodel_free() call fqcodel_pf_free to free the now unused
codel discipline.

found and fixed by lexi wilson
This commit is contained in:
dlg
2026-03-14 00:10:38 +00:00
parent a4d2502013
commit 3d3f53b4ee
+2 -2
View File
@@ -1,4 +1,4 @@
/* $OpenBSD: fq_codel.c,v 1.19 2025/11/13 20:07:22 bket Exp $ */
/* $OpenBSD: fq_codel.c,v 1.20 2026/03/14 00:10:38 dlg Exp $ */
/*
* Copyright (c) 2017 Mike Belopuhov
@@ -908,5 +908,5 @@ fqcodel_alloc(unsigned int idx, void *arg)
void
fqcodel_free(unsigned int idx, void *arg)
{
/* nothing to do here */
fqcodel_pf_free(arg);
}