[Bug 260406] pfctl: Cannot allocate memory (after a time)

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 14 Dec 2021 20:42:55 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=260406

--- Comment #10 from tech-lists@zyxst.net ---
OK - two tests, first one with the large table commented out (so pfctl -f
returns without error), second one with it uncommented

1.

# dtrace -n 'fbt:kernel:pfr_create_ktable:return { printf("%x", arg0); }' -n
'fbt:kernel:pf_find_or_create_kruleset:return { printf("%x", arg0); }' -n
'fbt:kernel:pfr_create_kentry:return { printf("%x", arg0); }'
dtrace: description 'fbt:kernel:pfr_create_ktable:return ' matched 1 probe
dtrace: description 'fbt:kernel:pf_find_or_create_kruleset:return ' matched 1
probe
dtrace: description 'fbt:kernel:pfr_create_kentry:return ' matched 1 probe
CPU     ID                    FUNCTION:NAME
  1  36465 pf_find_or_create_kruleset:return ffff000041aef0e0
  1  36465 pf_find_or_create_kruleset:return ffff000041aef0e0
  1  36465 pf_find_or_create_kruleset:return ffff000041aef0e0
  1  36465 pf_find_or_create_kruleset:return ffff000041aef0e0
  1  36465 pf_find_or_create_kruleset:return ffff000041aef0e0
  1  36465 pf_find_or_create_kruleset:return ffff000041aef0e0
  1  36465 pf_find_or_create_kruleset:return ffff000041aef0e0
  1  36465 pf_find_or_create_kruleset:return ffff000041aef0e0
  1  36465 pf_find_or_create_kruleset:return ffff000041aef0e0
  1  36465 pf_find_or_create_kruleset:return ffff000041aef0e0
  1  36465 pf_find_or_create_kruleset:return ffff000041aef0e0
  1  36465 pf_find_or_create_kruleset:return ffff000041aef0e0
  1  13251         pfr_create_ktable:return 1
  1  13251         pfr_create_ktable:return ffffa000133a6000
  1  13251         pfr_create_ktable:return 1
  1  13251         pfr_create_ktable:return ffffa00080bc2000
  1  13259         pfr_create_kentry:return ffffa0011698b1e0
  1  13259         pfr_create_kentry:return ffffa0011698b280
  1  13259         pfr_create_kentry:return ffffa0011698b320
  1  13259         pfr_create_kentry:return ffffa0011698b3c0
  1  13259         pfr_create_kentry:return ffffa0011698b460
  1  13259         pfr_create_kentry:return ffffa0011698b500
  1  13259         pfr_create_kentry:return ffffa0011698b5a0
  1  13259         pfr_create_kentry:return ffffa0011698b640
  1  13259         pfr_create_kentry:return ffffa0011698b6e0
  1  13259         pfr_create_kentry:return ffffa0011698b780
  1  13259         pfr_create_kentry:return ffffa0011698b820
  1  13259         pfr_create_kentry:return ffffa0011698b8c0
  1  13259         pfr_create_kentry:return ffffa0011698b960
  1  13259         pfr_create_kentry:return ffffa0011698ba00
  1  13259         pfr_create_kentry:return ffffa0011698baa0
  1  13259         pfr_create_kentry:return ffffa0011698bb40
  1  13251         pfr_create_ktable:return 1
  1  13251         pfr_create_ktable:return ffffa001d822a000
  1  13251         pfr_create_ktable:return 1
  1  13251         pfr_create_ktable:return ffffa0004a9b1800
  1  13259         pfr_create_kentry:return ffffa0011698bbe0
  1  13259         pfr_create_kentry:return ffffa0011698bc80
  1  36465 pf_find_or_create_kruleset:return ffff000041aef0e0
  1  36465 pf_find_or_create_kruleset:return ffff000041aef0e0
  1  13251         pfr_create_ktable:return 1
  1  13251         pfr_create_ktable:return ffffa001d71a2800
  1  13251         pfr_create_ktable:return 1
  1  13251         pfr_create_ktable:return ffffa001d71a2000
  1  13259         pfr_create_kentry:return ffffa0011698bd20
  1  13259         pfr_create_kentry:return ffffa0011698bdc0
  1  13251         pfr_create_ktable:return 1
  1  13251         pfr_create_ktable:return ffffa00108f7e800
  1  13259         pfr_create_kentry:return ffffa0011698be60
  1  13259         pfr_create_kentry:return ffffa0011698bf00
  1  13259         pfr_create_kentry:return ffffa0011698a000

2. 
pfctl -f /etc/pf.conf with the large table enabled, so

# pfctl -f /etc/pf.conf
/etc/pf.conf:18: cannot define table pfbadhost: Cannot allocate memory
pfctl: Syntax error in config file: pf rules not loaded

# dtrace -n 'fbt:kernel:pfr_create_ktable:return { printf("%x", arg0); }' -n
'fbt:kernel:pf_find_or_create_kruleset:return { printf("%x", arg0); }' -n
'fbt:kernel:pfr_create_kentry:return { printf("%x", arg0); }'
dtrace: description 'fbt:kernel:pfr_create_ktable:return ' matched 1 probe
dtrace: description 'fbt:kernel:pf_find_or_create_kruleset:return ' matched 1
probe
dtrace: description 'fbt:kernel:pfr_create_kentry:return ' matched 1 probe
CPU     ID                    FUNCTION:NAME
  2  36465 pf_find_or_create_kruleset:return ffff000041aef0e0
  2  36465 pf_find_or_create_kruleset:return ffff000041aef0e0
  2  36465 pf_find_or_create_kruleset:return ffff000041aef0e0
  2  36465 pf_find_or_create_kruleset:return ffff000041aef0e0
  2  36465 pf_find_or_create_kruleset:return ffff000041aef0e0
  2  36465 pf_find_or_create_kruleset:return ffff000041aef0e0
  2  36465 pf_find_or_create_kruleset:return ffff000041aef0e0
  2  36465 pf_find_or_create_kruleset:return ffff000041aef0e0
  2  36465 pf_find_or_create_kruleset:return ffff000041aef0e0
  2  36465 pf_find_or_create_kruleset:return ffff000041aef0e0
  2  36465 pf_find_or_create_kruleset:return ffff000041aef0e0
  2  36465 pf_find_or_create_kruleset:return ffff000041aef0e0
  2  13251         pfr_create_ktable:return 1
  2  13251         pfr_create_ktable:return ffffa0001a8a2800
  2  13259         pfr_create_kentry:return ffffa0011698cdc0
  2  13259         pfr_create_kentry:return ffffa000c1e48640
  2  13259         pfr_create_kentry:return ffffa000c1e485a0
  2  13259         pfr_create_kentry:return ffffa00116988e60
  2  13259         pfr_create_kentry:return ffffa000c1e48500
  2  13259         pfr_create_kentry:return ffffa000c1e48780
  2  13259         pfr_create_kentry:return ffffa000c1e48aa0
  2  13259         pfr_create_kentry:return ffffa000c1e488c0
  2  13259         pfr_create_kentry:return ffffa000c1e48a00
  2  13259         pfr_create_kentry:return ffffa000c1e48960
  2  13259         pfr_create_kentry:return ffffa000c1e48820
  2  13259         pfr_create_kentry:return ffffa000c1e48b40
  2  13259         pfr_create_kentry:return ffffa000c1e486e0
  2  13259         pfr_create_kentry:return ffffa0011698b0a0
  2  13259         pfr_create_kentry:return ffffa000c1e48be0
  2  13259         pfr_create_kentry:return ffffa000c1e553c0
  2  13259         pfr_create_kentry:return ffffa0011698ce60
  2  13259         pfr_create_kentry:return ffffa0011698cd20
  2  13259         pfr_create_kentry:return ffffa0011698cf00
  2  13259         pfr_create_kentry:return ffffa0011698b000
  2  13259         pfr_create_kentry:return ffffa000c1e55280
  2  13259         pfr_create_kentry:return ffffa000c1c24280
  2  13259         pfr_create_kentry:return ffffa000c1cab780
  2  13259         pfr_create_kentry:return ffffa000c1c25780
  2  13259         pfr_create_kentry:return ffffa000c1e555a0
  2  13259         pfr_create_kentry:return ffffa000c1eaff00
  2  13259         pfr_create_kentry:return ffffa000c1b5c0a0
  2  13259         pfr_create_kentry:return ffffa000c1e55640
  2  13259         pfr_create_kentry:return ffffa000c1a80dc0
  2  13259         pfr_create_kentry:return ffffa000c1e55320
  2  13259         pfr_create_kentry:return 0
  2  13251         pfr_create_ktable:return 1
  2  13251         pfr_create_ktable:return ffffa0001a8a2800
  2  13251         pfr_create_ktable:return 1
  2  13251         pfr_create_ktable:return ffffa00044ed5800
  2  13259         pfr_create_kentry:return ffffa0011698cdc0
  2  13259         pfr_create_kentry:return ffffa000c1e48640
  2  13259         pfr_create_kentry:return ffffa000c1e485a0
  2  13259         pfr_create_kentry:return ffffa00116988e60
  2  13259         pfr_create_kentry:return ffffa000c1e48500
  2  13259         pfr_create_kentry:return ffffa000c1e48780
  2  13259         pfr_create_kentry:return ffffa000c1e48aa0
  2  13259         pfr_create_kentry:return ffffa000c1e488c0
  2  13259         pfr_create_kentry:return ffffa000c1e48a00
  2  13259         pfr_create_kentry:return ffffa000c1e48960
  2  13259         pfr_create_kentry:return ffffa000c1e48820
  2  13259         pfr_create_kentry:return ffffa000c1e48b40
  2  13259         pfr_create_kentry:return ffffa000c1e486e0
  2  13259         pfr_create_kentry:return ffffa0011698b0a0
  2  13259         pfr_create_kentry:return ffffa000c1e48be0
  2  13259         pfr_create_kentry:return ffffa000c1e553c0
  2  13251         pfr_create_ktable:return 1
  2  13251         pfr_create_ktable:return ffffa00008fcb800
  2  13251         pfr_create_ktable:return 1
  2  13251         pfr_create_ktable:return ffffa000f7955000
  2  13259         pfr_create_kentry:return ffffa0011698ce60
  2  13259         pfr_create_kentry:return ffffa0011698cd20
  2  36465 pf_find_or_create_kruleset:return ffff000041aef0e0
  2  36465 pf_find_or_create_kruleset:return ffff000041aef0e0
  2  13251         pfr_create_ktable:return 1
  2  13251         pfr_create_ktable:return ffffa000f7956000
  2  13251         pfr_create_ktable:return 1
  2  13251         pfr_create_ktable:return ffffa0011697b800
  2  13259         pfr_create_kentry:return ffffa0011698cf00
  2  13259         pfr_create_kentry:return ffffa0011698b000
  2  13251         pfr_create_ktable:return 1
  2  13251         pfr_create_ktable:return ffffa00116977000
  2  13259         pfr_create_kentry:return ffffa000c1e55280
  2  13259         pfr_create_kentry:return ffffa000c1c24280
  2  13259         pfr_create_kentry:return ffffa000c1cab780

-- 
You are receiving this mail because:
You are the assignee for the bug.