RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2058228 - Fix buffer overflow on large labels
Summary: Fix buffer overflow on large labels
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: iproute
Version: 9.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 9.1
Assignee: Andrea Claudi
QA Contact: Li Shuang
URL:
Whiteboard:
Depends On: 2074608
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-02-24 14:32 UTC by Balazs Nemeth
Modified: 2022-11-15 13:18 UTC (History)
5 users (show)

Fixed In Version: iproute-5.18.0-1.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 2058227
Environment:
Last Closed: 2022-11-15 11:21:39 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-113671 0 None None None 2022-02-24 14:35:51 UTC
Red Hat Product Errata RHBA-2022:8372 0 None None None 2022-11-15 11:21:57 UTC

Description Balazs Nemeth 2022-02-24 14:32:19 UTC
+++ This bug was initially created as a clone of Bug #2058227 +++

Missing the following patch:

tc: 73590d957314 ("tc: flower: Fix buffer overflow on large labels")


Without this patch, tc filter show crashes on BF-2 tue to a very long ct label.

Comment 2 Li Shuang 2022-06-20 09:01:58 UTC
Reproduce with iproute-5.15.0-2.2.el9_0.x86_64:

# sh repro.sh 
+ rep1=eth0
+ rep2=eth1
+ ct_label=12345678123456781234567812345678/12345678123456781234567812345678
+ tc qdisc add dev eth0 ingress
+ tc qdisc add dev eth1 ingress
+ tc filter add dev eth0 ingress prio 1 chain 0 protocol arp flower action mirred egress redirect dev eth1
+ tc filter add dev eth1 ingress prio 1 chain 0 protocol arp flower action mirred egress redirect dev eth0
+ tc filter add dev eth0 ingress prio 2 chain 0 protocol ip flower ct_state -trk action ct action goto chain 1
+ tc filter add dev eth1 ingress prio 2 chain 0 protocol ip flower ct_state -trk action ct action goto chain 1
+ tc filter add dev eth0 ingress prio 1 chain 1 protocol ip flower ct_state +trk+new action ct label 12345678123456781234567812345678/12345678123456781234567812345678 commit action mirred egress redirect dev eth1
+ tc filter add dev eth1 ingress prio 1 chain 1 protocol ip flower ct_state +trk+new action ct label 12345678123456781234567812345678/12345678123456781234567812345678 commit action mirred egress redirect dev eth0
+ tc filter add dev eth0 ingress prio 1 chain 1 protocol ip flower ct_state +trk+est ct_label 12345678123456781234567812345678/12345678123456781234567812345678 action mirred egress redirect dev eth1
+ tc filter add dev eth1 ingress prio 1 chain 1 protocol ip flower ct_state +trk+est ct_label 12345678123456781234567812345678/12345678123456781234567812345678 action mirred egress redirect dev eth0
+ tc -s filter show dev eth0 ingress
filter protocol arp pref 1 flower chain 0 
filter protocol arp pref 1 flower chain 0 handle 0x1 
  eth_type arp
  in_hw in_hw_count 1
	action order 1: mirred (Egress Redirect to device eth1) stolen
	index 1 ref 1 bind 1 installed 0 sec used 0 sec
	Action statistics:
	Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
	backlog 0b 0p requeues 0
	used_hw_stats delayed

filter protocol ip pref 2 flower chain 0 
filter protocol ip pref 2 flower chain 0 handle 0x1 
  eth_type ipv4
  ct_state -trk
  in_hw in_hw_count 1
	action order 1: ct zone 0 pipe
	 index 1 ref 1 bind 1 installed 0 sec used 0 sec
	Action statistics:
	Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
	backlog 0b 0p requeues 0
	used_hw_stats delayed

	action order 2: gact action goto chain 1
	 random type none pass val 0
	 index 1 ref 1 bind 1 installed 0 sec used 0 sec
	Action statistics:
	Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
	backlog 0b 0p requeues 0
	used_hw_stats delayed

filter protocol ip pref 1 flower chain 1 
filter protocol ip pref 1 flower chain 1 handle 0x1 
  eth_type ipv4
  ct_state +trk+new
  not_in_hw
	action order 1: ct commit zone 0 label 12345678123456781234567812345678/12345678123456781234567812345678 pipe
	 index 3 ref 1 bind 1 installed 0 sec used 0 sec
	Action statistics:
	Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
	backlog 0b 0p requeues 0

	action order 2: mirred (Egress Redirect to device eth1) stolen
	index 3 ref 1 bind 1 installed 0 sec used 0 sec
	Action statistics:
	Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
	backlog 0b 0p requeues 0

filter protocol ip pref 1 flower chain 1 handle 0x2 
  eth_type ipv4
  ct_state +trk+est
  ct_label 12345678123456781234567812345678/123456781234567812345678123456   <---   incomplete ct_label mask due to buffer overflow
  in_hw in_hw_count 1
	action order 1: mirred (Egress Redirect to device eth1) stolen
	index 5 ref 1 bind 1 installed 0 sec used 0 sec
	Action statistics:
	Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
	backlog 0b 0p requeues 0
	used_hw_stats delayed

+ tc -s filter show dev eth1 ingress
filter protocol arp pref 1 flower chain 0 
filter protocol arp pref 1 flower chain 0 handle 0x1 
  eth_type arp
  in_hw in_hw_count 1
	action order 1: mirred (Egress Redirect to device eth0) stolen
	index 2 ref 1 bind 1 installed 0 sec used 0 sec
	Action statistics:
	Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
	backlog 0b 0p requeues 0
	used_hw_stats delayed

filter protocol ip pref 2 flower chain 0 
filter protocol ip pref 2 flower chain 0 handle 0x1 
  eth_type ipv4
  ct_state -trk
  in_hw in_hw_count 1
	action order 1: ct zone 0 pipe
	 index 2 ref 1 bind 1 installed 0 sec used 0 sec
	Action statistics:
	Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
	backlog 0b 0p requeues 0
	used_hw_stats delayed

	action order 2: gact action goto chain 1
	 random type none pass val 0
	 index 2 ref 1 bind 1 installed 0 sec used 0 sec
	Action statistics:
	Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
	backlog 0b 0p requeues 0
	used_hw_stats delayed

filter protocol ip pref 1 flower chain 1 
filter protocol ip pref 1 flower chain 1 handle 0x1 
  eth_type ipv4
  ct_state +trk+new
  not_in_hw
	action order 1: ct commit zone 0 label 12345678123456781234567812345678/12345678123456781234567812345678 pipe
	 index 4 ref 1 bind 1 installed 0 sec used 0 sec
	Action statistics:
	Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
	backlog 0b 0p requeues 0

	action order 2: mirred (Egress Redirect to device eth0) stolen
	index 4 ref 1 bind 1 installed 0 sec used 0 sec
	Action statistics:
	Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
	backlog 0b 0p requeues 0

filter protocol ip pref 1 flower chain 1 handle 0x2 
  eth_type ipv4
  ct_state +trk+est
  ct_label 12345678123456781234567812345678/123456781234567812345678123456   <---   incomplete ct_label mask due to buffer overflow
  in_hw in_hw_count 1
	action order 1: mirred (Egress Redirect to device eth0) stolen
	index 6 ref 1 bind 1 installed 0 sec used 0 sec
	Action statistics:
	Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
	backlog 0b 0p requeues 0
	used_hw_stats delayed

+ tc qdisc del dev eth0 ingress
+ tc qdisc del dev eth1 ingress
# rpm -q iproute
iproute-5.15.0-2.2.el9_0.x86_64

Verify with iproute-5.18.0-1.el9.x86_64:

# sh repro.sh 
+ rep1=eth0
+ rep2=eth1
+ ct_label=12345678123456781234567812345678/12345678123456781234567812345678
+ tc qdisc add dev eth0 ingress
+ tc qdisc add dev eth1 ingress
+ tc filter add dev eth0 ingress prio 1 chain 0 protocol arp flower action mirred egress redirect dev eth1
+ tc filter add dev eth1 ingress prio 1 chain 0 protocol arp flower action mirred egress redirect dev eth0
+ tc filter add dev eth0 ingress prio 2 chain 0 protocol ip flower ct_state -trk action ct action goto chain 1
+ tc filter add dev eth1 ingress prio 2 chain 0 protocol ip flower ct_state -trk action ct action goto chain 1
+ tc filter add dev eth0 ingress prio 1 chain 1 protocol ip flower ct_state +trk+new action ct label 12345678123456781234567812345678/12345678123456781234567812345678 commit action mirred egress redirect dev eth1
+ tc filter add dev eth1 ingress prio 1 chain 1 protocol ip flower ct_state +trk+new action ct label 12345678123456781234567812345678/12345678123456781234567812345678 commit action mirred egress redirect dev eth0
+ tc filter add dev eth0 ingress prio 1 chain 1 protocol ip flower ct_state +trk+est ct_label 12345678123456781234567812345678/12345678123456781234567812345678 action mirred egress redirect dev eth1
+ tc filter add dev eth1 ingress prio 1 chain 1 protocol ip flower ct_state +trk+est ct_label 12345678123456781234567812345678/12345678123456781234567812345678 action mirred egress redirect dev eth0
+ tc -s filter show dev eth0 ingress
filter protocol arp pref 1 flower chain 0 
filter protocol arp pref 1 flower chain 0 handle 0x1 
  eth_type arp
  in_hw in_hw_count 1
	action order 1: mirred (Egress Redirect to device eth1) stolen
	index 1 ref 1 bind 1 installed 0 sec used 0 sec
	Action statistics:
	Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
	backlog 0b 0p requeues 0
	used_hw_stats delayed

filter protocol ip pref 2 flower chain 0 
filter protocol ip pref 2 flower chain 0 handle 0x1 
  eth_type ipv4
  ct_state -trk
  in_hw in_hw_count 1
	action order 1: ct zone 0 pipe
	 index 1 ref 1 bind 1 installed 0 sec used 0 sec
	Action statistics:
	Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
	backlog 0b 0p requeues 0
	used_hw_stats delayed

	action order 2: gact action goto chain 1
	 random type none pass val 0
	 index 1 ref 1 bind 1 installed 0 sec used 0 sec
	Action statistics:
	Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
	backlog 0b 0p requeues 0
	used_hw_stats delayed

filter protocol ip pref 1 flower chain 1 
filter protocol ip pref 1 flower chain 1 handle 0x1 
  eth_type ipv4
  ct_state +trk+new
  not_in_hw
	action order 1: ct commit zone 0 label 12345678123456781234567812345678/12345678123456781234567812345678 pipe
	 index 3 ref 1 bind 1 installed 0 sec used 0 sec
	Action statistics:
	Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
	backlog 0b 0p requeues 0

	action order 2: mirred (Egress Redirect to device eth1) stolen
	index 3 ref 1 bind 1 installed 0 sec used 0 sec
	Action statistics:
	Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
	backlog 0b 0p requeues 0

filter protocol ip pref 1 flower chain 1 handle 0x2 
  eth_type ipv4
  ct_state +trk+est
  ct_label 12345678123456781234567812345678/12345678123456781234567812345678   <---   complete ct_label mask
  in_hw in_hw_count 1
	action order 1: mirred (Egress Redirect to device eth1) stolen
	index 5 ref 1 bind 1
	Action statistics:
	Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
	backlog 0b 0p requeues 0
	used_hw_stats delayed

+ tc -s filter show dev eth1 ingress
filter protocol arp pref 1 flower chain 0 
filter protocol arp pref 1 flower chain 0 handle 0x1 
  eth_type arp
  in_hw in_hw_count 1
	action order 1: mirred (Egress Redirect to device eth0) stolen
	index 2 ref 1 bind 1 installed 0 sec used 0 sec
	Action statistics:
	Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
	backlog 0b 0p requeues 0
	used_hw_stats delayed

filter protocol ip pref 2 flower chain 0 
filter protocol ip pref 2 flower chain 0 handle 0x1 
  eth_type ipv4
  ct_state -trk
  in_hw in_hw_count 1
	action order 1: ct zone 0 pipe
	 index 2 ref 1 bind 1 installed 0 sec used 0 sec
	Action statistics:
	Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
	backlog 0b 0p requeues 0
	used_hw_stats delayed

	action order 2: gact action goto chain 1
	 random type none pass val 0
	 index 2 ref 1 bind 1 installed 0 sec used 0 sec
	Action statistics:
	Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
	backlog 0b 0p requeues 0
	used_hw_stats delayed

filter protocol ip pref 1 flower chain 1 
filter protocol ip pref 1 flower chain 1 handle 0x1 
  eth_type ipv4
  ct_state +trk+new
  not_in_hw
	action order 1: ct commit zone 0 label 12345678123456781234567812345678/12345678123456781234567812345678 pipe
	 index 4 ref 1 bind 1 installed 0 sec used 0 sec
	Action statistics:
	Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
	backlog 0b 0p requeues 0

	action order 2: mirred (Egress Redirect to device eth0) stolen
	index 4 ref 1 bind 1 installed 0 sec used 0 sec
	Action statistics:
	Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
	backlog 0b 0p requeues 0

filter protocol ip pref 1 flower chain 1 handle 0x2 
  eth_type ipv4
  ct_state +trk+est
  ct_label 12345678123456781234567812345678/12345678123456781234567812345678   <---   complete ct_label mask
  in_hw in_hw_count 1
	action order 1: mirred (Egress Redirect to device eth0) stolen
	index 6 ref 1 bind 1
	Action statistics:
	Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) 
	backlog 0b 0p requeues 0
	used_hw_stats delayed

+ tc qdisc del dev eth0 ingress
+ tc qdisc del dev eth1 ingress
# rpm -q iproute
iproute-5.18.0-1.el9.x86_64

Comment 8 errata-xmlrpc 2022-11-15 11:21:39 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (iproute bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:8372


Note You need to log in before you can comment on or make changes to this bug.