This diff limits the number of transactions/tickets
authorsashan <sashan@openbsd.org>
Tue, 4 Jul 2023 14:23:38 +0000 (14:23 +0000)
committersashan <sashan@openbsd.org>
Tue, 4 Jul 2023 14:23:38 +0000 (14:23 +0000)
commit95c411ffdbcf2ce623d0736f4d65c433aa9cb37d
tree4912a6ad6b03e6fd3988f63799369ba38f4b800d
parent7d40840168c1f24d7f78946e5fa17f704e2a6b73
This diff limits the number of transactions/tickets
pf_open_trans() can issue for each clone of /dev/pf
to 512. The pf_open_trans() is currently being used
by DIOCGETRULES ioctl(2). The limit avoids processes
to consume all kernel memory by asking DIOCGETRULES
for more tickets. If DIOCGETRULES hits the limit, then
the application will see EBUSY error.

This diff was fine tuned with feedback from cluadio@,
deraadt@ and kn@.

OK kn@
sys/net/pf_ioctl.c