|
|
edb02f |
From 85b78933a00c38dac80b5bbdf75a2114a0284765 Mon Sep 17 00:00:00 2001
|
|
|
edb02f |
From: Joe Lawrence <joe.lawrence@redhat.com>
|
|
|
edb02f |
Date: Mon, 26 Feb 2024 12:32:57 -0500
|
|
|
edb02f |
Subject: [KPATCH CVE-2023-31436] kpatch fixes for CVE-2023-31436
|
|
|
edb02f |
|
|
|
edb02f |
Kernels:
|
|
|
edb02f |
3.10.0-1160.95.1.el7
|
|
|
edb02f |
3.10.0-1160.99.1.el7
|
|
|
edb02f |
3.10.0-1160.102.1.el7
|
|
|
edb02f |
|
|
|
edb02f |
|
|
|
edb02f |
Kpatch-MR: https://gitlab.com/redhat/prdsc/rhel/src/kpatch/rhel-7/-/merge_requests/69
|
|
|
edb02f |
Changes since last build:
|
|
|
edb02f |
[x86_64]:
|
|
|
edb02f |
igb_main.o: changed function: igb_configure
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_chan_hold
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_conn_get
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_global_chan_by_psm
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_recv_frame
|
|
|
edb02f |
l2cap_core.o: new function: klp_l2cap_le_sig_cmd
|
|
|
edb02f |
sch_atm.o: changed function: atm_tc_peek
|
|
|
edb02f |
sch_atm.o: changed function: sch_atm_dequeue
|
|
|
edb02f |
sch_drr.o: changed function: drr_dequeue
|
|
|
edb02f |
sch_dsmark.o: changed function: dsmark_peek
|
|
|
edb02f |
sch_hfsc.o: changed function: hfsc_enqueue
|
|
|
edb02f |
sch_hfsc.o: changed function: qdisc_peek_len
|
|
|
edb02f |
sch_multiq.o: changed function: multiq_peek
|
|
|
edb02f |
sch_prio.o: changed function: prio_peek
|
|
|
edb02f |
sch_qfq.o: changed function: qfq_change_class
|
|
|
edb02f |
sch_qfq.o: changed function: qfq_dequeue
|
|
|
edb02f |
sch_red.o: changed function: red_peek
|
|
|
edb02f |
sch_sfb.o: changed function: sfb_peek
|
|
|
edb02f |
sch_tbf.o: changed function: tbf_dequeue
|
|
|
edb02f |
|
|
|
edb02f |
[ppc64le]:
|
|
|
edb02f |
l2cap_core.o: changed function: __l2cap_chan_add
|
|
|
edb02f |
l2cap_core.o: changed function: __l2cap_physical_cfm
|
|
|
edb02f |
l2cap_core.o: changed function: __set_monitor_timer
|
|
|
edb02f |
l2cap_core.o: changed function: __set_retrans_timer.part.24
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_ack_timeout
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_build_conf_req
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_chan_busy
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_chan_close
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_chan_connect
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_chan_del
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_chan_hold
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_chan_put
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_chan_send
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_chan_timeout
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_conn_add.part.28
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_conn_del
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_conn_start
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_connect
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_connect_cfm
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_connect_create_rsp
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_data_channel
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_disconn_cfm
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_do_create
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_do_start
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_ertm_resend
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_ertm_send
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_global_fixed_chan
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_handle_rej
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_handle_srej
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_logical_cfm
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_monitor_timeout
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_move_done
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_move_setup
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_parse_conf_rsp.constprop.36
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_pass_to_tx
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_process_reqseq
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_recv_frame
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_retrans_timeout
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_retransmit_all
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_rx
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_rx_state_recv
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_security_cfm
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_send_ack
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_send_efs_conf_rsp
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_send_i_or_rr_or_rnr
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_send_move_chan_cfm
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_send_move_chan_cfm_icid
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_send_move_chan_req
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_send_rr_or_rnr
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_send_sframe
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_send_srej
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_send_srej_tail
|
|
|
edb02f |
l2cap_core.o: changed function: l2cap_start_connection
|
|
|
edb02f |
l2cap_core.o: new function: l2cap_connect_req
|
|
|
edb02f |
sch_atm.o: changed function: atm_tc_bind_filter
|
|
|
edb02f |
sch_atm.o: changed function: atm_tc_change
|
|
|
edb02f |
sch_atm.o: changed function: atm_tc_delete
|
|
|
edb02f |
sch_atm.o: changed function: atm_tc_destroy
|
|
|
edb02f |
sch_atm.o: changed function: atm_tc_enqueue
|
|
|
edb02f |
sch_atm.o: changed function: atm_tc_find
|
|
|
edb02f |
sch_atm.o: changed function: atm_tc_graft
|
|
|
edb02f |
sch_atm.o: changed function: atm_tc_leaf
|
|
|
edb02f |
sch_atm.o: changed function: atm_tc_peek
|
|
|
edb02f |
sch_atm.o: changed function: atm_tc_put
|
|
|
edb02f |
sch_atm.o: changed function: atm_tc_reset
|
|
|
edb02f |
sch_atm.o: changed function: atm_tc_tcf_block
|
|
|
edb02f |
sch_atm.o: changed function: sch_atm_dequeue
|
|
|
edb02f |
sch_drr.o: changed function: drr_dequeue
|
|
|
edb02f |
sch_dsmark.o: changed function: dsmark_bind_filter
|
|
|
edb02f |
sch_dsmark.o: changed function: dsmark_change
|
|
|
edb02f |
sch_dsmark.o: changed function: dsmark_destroy
|
|
|
edb02f |
sch_dsmark.o: changed function: dsmark_dump_class
|
|
|
edb02f |
sch_dsmark.o: changed function: dsmark_init
|
|
|
edb02f |
sch_dsmark.o: changed function: dsmark_peek
|
|
|
edb02f |
sch_dsmark.o: changed function: dsmark_reset
|
|
|
edb02f |
sch_hfsc.o: changed function: hfsc_change_class
|
|
|
edb02f |
sch_hfsc.o: changed function: hfsc_dequeue
|
|
|
edb02f |
sch_hfsc.o: changed function: hfsc_enqueue
|
|
|
edb02f |
sch_multiq.o: changed function: multiq_peek
|
|
|
edb02f |
sch_prio.o: changed function: prio_peek
|
|
|
edb02f |
sch_qfq.o: changed function: qfq_change_class
|
|
|
edb02f |
sch_qfq.o: changed function: qfq_dequeue
|
|
|
edb02f |
sch_red.o: changed function: red_peek
|
|
|
edb02f |
sch_sfb.o: changed function: sfb_peek
|
|
|
edb02f |
sch_tbf.o: changed function: tbf_dequeue
|
|
|
edb02f |
|
|
|
edb02f |
---------------------------
|
|
|
edb02f |
|
|
|
edb02f |
Modifications: none
|
|
|
edb02f |
|
|
|
edb02f |
commit 906f32101a825691a705bc5754716cc870f64b83
|
|
|
edb02f |
Author: Davide Caratti <dcaratti@redhat.com>
|
|
|
edb02f |
Date: Tue Sep 5 11:15:12 2023 +0200
|
|
|
edb02f |
|
|
|
edb02f |
net: sched: sch_qfq: prevent slab-out-of-bounds in qfq_activate_agg
|
|
|
edb02f |
|
|
|
edb02f |
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2225555
|
|
|
edb02f |
Upstream Status: net.git commit 3037933448f6
|
|
|
edb02f |
|
|
|
edb02f |
commit 3037933448f60f9acb705997eae62013ecb81e0d
|
|
|
edb02f |
Author: Gwangun Jung <exsociety@gmail.com>
|
|
|
edb02f |
Date: Thu Apr 13 19:35:54 2023 +0900
|
|
|
edb02f |
|
|
|
edb02f |
net: sched: sch_qfq: prevent slab-out-of-bounds in qfq_activate_agg
|
|
|
edb02f |
|
|
|
edb02f |
If the TCA_QFQ_LMAX value is not offered through nlattr, lmax is determined by the MTU value of the network device.
|
|
|
edb02f |
The MTU of the loopback device can be set up to 2^31-1.
|
|
|
edb02f |
As a result, it is possible to have an lmax value that exceeds QFQ_MIN_LMAX.
|
|
|
edb02f |
|
|
|
edb02f |
Due to the invalid lmax value, an index is generated that exceeds the QFQ_MAX_INDEX(=24) value, causing out-of-bounds read/write errors.
|
|
|
edb02f |
|
|
|
edb02f |
The following reports a oob access:
|
|
|
edb02f |
|
|
|
edb02f |
[ 84.582666] BUG: KASAN: slab-out-of-bounds in qfq_activate_agg.constprop.0 (net/sched/sch_qfq.c:1027 net/sched/sch_qfq.c:1060 net/sched/sch_qfq.c:1313)
|
|
|
edb02f |
[ 84.583267] Read of size 4 at addr ffff88810f676948 by task ping/301
|
|
|
edb02f |
[ 84.583686]
|
|
|
edb02f |
[ 84.583797] CPU: 3 PID: 301 Comm: ping Not tainted 6.3.0-rc5 #1
|
|
|
edb02f |
[ 84.584164] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014
|
|
|
edb02f |
[ 84.584644] Call Trace:
|
|
|
edb02f |
[ 84.584787] <TASK>
|
|
|
edb02f |
[ 84.584906] dump_stack_lvl (lib/dump_stack.c:107 (discriminator 1))
|
|
|
edb02f |
[ 84.585108] print_report (mm/kasan/report.c:320 mm/kasan/report.c:430)
|
|
|
edb02f |
[ 84.585570] kasan_report (mm/kasan/report.c:538)
|
|
|
edb02f |
[ 84.585988] qfq_activate_agg.constprop.0 (net/sched/sch_qfq.c:1027 net/sched/sch_qfq.c:1060 net/sched/sch_qfq.c:1313)
|
|
|
edb02f |
[ 84.586599] qfq_enqueue (net/sched/sch_qfq.c:1255)
|
|
|
edb02f |
[ 84.587607] dev_qdisc_enqueue (net/core/dev.c:3776)
|
|
|
edb02f |
[ 84.587749] __dev_queue_xmit (./include/net/sch_generic.h:186 net/core/dev.c:3865 net/core/dev.c:4212)
|
|
|
edb02f |
[ 84.588763] ip_finish_output2 (./include/net/neighbour.h:546 net/ipv4/ip_output.c:228)
|
|
|
edb02f |
[ 84.589460] ip_output (net/ipv4/ip_output.c:430)
|
|
|
edb02f |
[ 84.590132] ip_push_pending_frames (./include/net/dst.h:444 net/ipv4/ip_output.c:126 net/ipv4/ip_output.c:1586 net/ipv4/ip_output.c:1606)
|
|
|
edb02f |
[ 84.590285] raw_sendmsg (net/ipv4/raw.c:649)
|
|
|
edb02f |
[ 84.591960] sock_sendmsg (net/socket.c:724 net/socket.c:747)
|
|
|
edb02f |
[ 84.592084] __sys_sendto (net/socket.c:2142)
|
|
|
edb02f |
[ 84.593306] __x64_sys_sendto (net/socket.c:2150)
|
|
|
edb02f |
[ 84.593779] do_syscall_64 (arch/x86/entry/common.c:50 arch/x86/entry/common.c:80)
|
|
|
edb02f |
[ 84.593902] entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:120)
|
|
|
edb02f |
[ 84.594070] RIP: 0033:0x7fe568032066
|
|
|
edb02f |
[ 84.594192] Code: 0e 0d 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b8 0f 1f 00 41 89 ca 64 8b 04 25 18 00 00 00 85 c09[ 84.594796] RSP: 002b:00007ffce388b4e8 EFLAGS: 00000246 ORIG_RAX: 000000000000002c
|
|
|
edb02f |
|
|
|
edb02f |
Code starting with the faulting instruction
|
|
|
edb02f |
===========================================
|
|
|
edb02f |
[ 84.595047] RAX: ffffffffffffffda RBX: 00007ffce388cc70 RCX: 00007fe568032066
|
|
|
edb02f |
[ 84.595281] RDX: 0000000000000040 RSI: 00005605fdad6d10 RDI: 0000000000000003
|
|
|
edb02f |
[ 84.595515] RBP: 00005605fdad6d10 R08: 00007ffce388eeec R09: 0000000000000010
|
|
|
edb02f |
[ 84.595749] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000040
|
|
|
edb02f |
[ 84.595984] R13: 00007ffce388cc30 R14: 00007ffce388b4f0 R15: 0000001d00000001
|
|
|
edb02f |
[ 84.596218] </TASK>
|
|
|
edb02f |
[ 84.596295]
|
|
|
edb02f |
[ 84.596351] Allocated by task 291:
|
|
|
edb02f |
[ 84.596467] kasan_save_stack (mm/kasan/common.c:46)
|
|
|
edb02f |
[ 84.596597] kasan_set_track (mm/kasan/common.c:52)
|
|
|
edb02f |
[ 84.596725] __kasan_kmalloc (mm/kasan/common.c:384)
|
|
|
edb02f |
[ 84.596852] __kmalloc_node (./include/linux/kasan.h:196 mm/slab_common.c:967 mm/slab_common.c:974)
|
|
|
edb02f |
[ 84.596979] qdisc_alloc (./include/linux/slab.h:610 ./include/linux/slab.h:731 net/sched/sch_generic.c:938)
|
|
|
edb02f |
[ 84.597100] qdisc_create (net/sched/sch_api.c:1244)
|
|
|
edb02f |
[ 84.597222] tc_modify_qdisc (net/sched/sch_api.c:1680)
|
|
|
edb02f |
[ 84.597357] rtnetlink_rcv_msg (net/core/rtnetlink.c:6174)
|
|
|
edb02f |
[ 84.597495] netlink_rcv_skb (net/netlink/af_netlink.c:2574)
|
|
|
edb02f |
[ 84.597627] netlink_unicast (net/netlink/af_netlink.c:1340 net/netlink/af_netlink.c:1365)
|
|
|
edb02f |
[ 84.597759] netlink_sendmsg (net/netlink/af_netlink.c:1942)
|
|
|
edb02f |
[ 84.597891] sock_sendmsg (net/socket.c:724 net/socket.c:747)
|
|
|
edb02f |
[ 84.598016] ____sys_sendmsg (net/socket.c:2501)
|
|
|
edb02f |
[ 84.598147] ___sys_sendmsg (net/socket.c:2557)
|
|
|
edb02f |
[ 84.598275] __sys_sendmsg (./include/linux/file.h:31 net/socket.c:2586)
|
|
|
edb02f |
[ 84.598399] do_syscall_64 (arch/x86/entry/common.c:50 arch/x86/entry/common.c:80)
|
|
|
edb02f |
[ 84.598520] entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:120)
|
|
|
edb02f |
[ 84.598688]
|
|
|
edb02f |
[ 84.598744] The buggy address belongs to the object at ffff88810f674000
|
|
|
edb02f |
[ 84.598744] which belongs to the cache kmalloc-8k of size 8192
|
|
|
edb02f |
[ 84.599135] The buggy address is located 2664 bytes to the right of
|
|
|
edb02f |
[ 84.599135] allocated 7904-byte region [ffff88810f674000, ffff88810f675ee0)
|
|
|
edb02f |
[ 84.599544]
|
|
|
edb02f |
[ 84.599598] The buggy address belongs to the physical page:
|
|
|
edb02f |
[ 84.599777] page:00000000e638567f refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10f670
|
|
|
edb02f |
[ 84.600074] head:00000000e638567f order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
|
|
|
edb02f |
[ 84.600330] flags: 0x200000000010200(slab|head|node=0|zone=2)
|
|
|
edb02f |
[ 84.600517] raw: 0200000000010200 ffff888100043180 dead000000000122 0000000000000000
|
|
|
edb02f |
[ 84.600764] raw: 0000000000000000 0000000080020002 00000001ffffffff 0000000000000000
|
|
|
edb02f |
[ 84.601009] page dumped because: kasan: bad access detected
|
|
|
edb02f |
[ 84.601187]
|
|
|
edb02f |
[ 84.601241] Memory state around the buggy address:
|
|
|
edb02f |
[ 84.601396] ffff88810f676800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
|
|
|
edb02f |
[ 84.601620] ffff88810f676880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
|
|
|
edb02f |
[ 84.601845] >ffff88810f676900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
|
|
|
edb02f |
[ 84.602069] ^
|
|
|
edb02f |
[ 84.602243] ffff88810f676980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
|
|
|
edb02f |
[ 84.602468] ffff88810f676a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
|
|
|
edb02f |
[ 84.602693] ==================================================================
|
|
|
edb02f |
[ 84.602924] Disabling lock debugging due to kernel taint
|
|
|
edb02f |
|
|
|
edb02f |
Fixes: 3015f3d2a3cd ("pkt_sched: enable QFQ to support TSO/GSO")
|
|
|
edb02f |
Reported-by: Gwangun Jung <exsociety@gmail.com>
|
|
|
edb02f |
Signed-off-by: Gwangun Jung <exsociety@gmail.com>
|
|
|
edb02f |
Acked-by: Jamal Hadi Salim<jhs@mojatatu.com>
|
|
|
edb02f |
Signed-off-by: David S. Miller <davem@davemloft.net>
|
|
|
edb02f |
|
|
|
edb02f |
Signed-off-by: Davide Caratti <dcaratti@redhat.com>
|
|
|
edb02f |
|
|
|
edb02f |
Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
|
|
|
edb02f |
---
|
|
|
edb02f |
net/sched/sch_qfq.c | 13 +++++++------
|
|
|
edb02f |
1 file changed, 7 insertions(+), 6 deletions(-)
|
|
|
edb02f |
|
|
|
edb02f |
diff --git a/net/sched/sch_qfq.c b/net/sched/sch_qfq.c
|
|
|
edb02f |
index ca8c79456c80..a0e5ebac5f39 100644
|
|
|
edb02f |
--- a/net/sched/sch_qfq.c
|
|
|
edb02f |
+++ b/net/sched/sch_qfq.c
|
|
|
edb02f |
@@ -436,15 +436,16 @@ static int qfq_change_class(struct Qdisc *sch, u32 classid, u32 parentid,
|
|
|
edb02f |
} else
|
|
|
edb02f |
weight = 1;
|
|
|
edb02f |
|
|
|
edb02f |
- if (tb[TCA_QFQ_LMAX]) {
|
|
|
edb02f |
+ if (tb[TCA_QFQ_LMAX])
|
|
|
edb02f |
lmax = nla_get_u32(tb[TCA_QFQ_LMAX]);
|
|
|
edb02f |
- if (lmax < QFQ_MIN_LMAX || lmax > (1UL << QFQ_MTU_SHIFT)) {
|
|
|
edb02f |
- pr_notice("qfq: invalid max length %u\n", lmax);
|
|
|
edb02f |
- return -EINVAL;
|
|
|
edb02f |
- }
|
|
|
edb02f |
- } else
|
|
|
edb02f |
+ else
|
|
|
edb02f |
lmax = psched_mtu(qdisc_dev(sch));
|
|
|
edb02f |
|
|
|
edb02f |
+ if (lmax < QFQ_MIN_LMAX || lmax > (1UL << QFQ_MTU_SHIFT)) {
|
|
|
edb02f |
+ pr_notice("qfq: invalid max length %u\n", lmax);
|
|
|
edb02f |
+ return -EINVAL;
|
|
|
edb02f |
+ }
|
|
|
edb02f |
+
|
|
|
edb02f |
inv_w = ONE_FP / weight;
|
|
|
edb02f |
weight = ONE_FP / inv_w;
|
|
|
edb02f |
|
|
|
edb02f |
--
|
|
|
edb02f |
2.44.0
|
|
|
edb02f |
|
|
|
edb02f |
|