6.18.36-rc1 review
Subsystems (4)
Greg Kroah-Hartman
maintainerPATCH 299/325 drm/amd/display: Clamp VBIOS HDMI retimer register count to array size
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Harry Wentland <[email protected]>
commit fb0707ce00eef4e2d60c3020e1c0432739703e4a upstream.
[Why & How]
The VBIOS integrated info tables (v1_11 and v2_1) contain HdmiRegNum and Hdmi6GRegNum fields that are used as loop bounds when copying retimer I2C register settings into fixed-size arrays (dp*_ext_hdmi_reg_settings[9] and dp*_ext_hdmi_6g_reg_settings[3]). These u8 fields are not validated before use, so a malformed VBIOS can specify values up to 255, causing an out-of-bounds heap write during driver probe.
Clamp each register count to the destination array size using min_t() before the copy loops, in both get_integrated_info_v11() and get_integrated_info_v2_1().
--- drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c | 48 ++++++++++++++------- 1 file changed, 32 insertions(+), 16 deletions(-)
drivers/gpu/drm/amd/display/dc/bios/bios_parser2.c +32 -16
@@ -2602,14 +2602,16 @@ static enum bp_result get_integrated_inf info_v11->extdispconninfo.checksum; info->dp0_ext_hdmi_slv_addr = info_v11->dp0_retimer_set.HdmiSlvAddr; - info->dp0_ext_hdmi_reg_num = info_v11->dp0_retimer_set.HdmiRegNum; + info->dp0_ext_hdmi_reg_num =min_t (u8, info_v11->dp0_retimer_set.HdmiRegNum, +ARRAY_SIZE (info->dp0_ext_hdmi_reg_settings));for (i =0 ; i < info->dp0_ext_hdmi_reg_num; i++) { info->dp0_ext_hdmi_reg_settings[i].i2c_reg_index = info_v11->dp0_retimer_set.HdmiRegSetting[i].ucI2cRegIndex; info->dp0_ext_hdmi_reg_settings[i].i2c_reg_val = info_v11->dp0_retimer_set.HdmiRegSetting[i].ucI2cRegVal; } - info->dp0_ext_hdmi_6g_reg_num = info_v11->dp0_retimer_set.Hdmi6GRegNum; + info->dp0_ext_hdmi_6g_reg_num =min_t (u8, info_v11->dp0_retimer_set.Hdmi6GRegNum, +ARRAY_SIZE (info->dp0_ext_hdmi_6g_reg_settings));for (i =0 ; i < info->dp0_ext_hdmi_6g_reg_num; i++) { info->dp0_ext_hdmi_6g_reg_settings[i].i2c_reg_index = info_v11->dp0_retimer_set.Hdmi6GhzRegSetting[i].ucI2cRegIndex;
@@ -2618,14 +2620,16 @@ static enum bp_result get_integrated_inf } info->dp1_ext_hdmi_slv_addr = info_v11->dp1_retimer_set.HdmiSlvAddr; - info->dp1_ext_hdmi_reg_num = info_v11->dp1_retimer_set.HdmiRegNum; + info->dp1_ext_hdmi_reg_num =min_t (u8, info_v11->dp1_retimer_set.HdmiRegNum, +ARRAY_SIZE (info->dp1_ext_hdmi_reg_settings));for (i =0 ; i < info->dp1_ext_hdmi_reg_num; i++) { info->dp1_ext_hdmi_reg_settings[i].i2c_reg_index = info_v11->dp1_retimer_set.HdmiRegSetting[i].ucI2cRegIndex; info->dp1_ext_hdmi_reg_settings[i].i2c_reg_val = info_v11->dp1_retimer_set.HdmiRegSetting[i].ucI2cRegVal; } - info->dp1_ext_hdmi_6g_reg_num = info_v11->dp1_retimer_set.Hdmi6GRegNum; + info->dp1_ext_hdmi_6g_reg_num =min_t (u8, info_v11->dp1_retimer_set.Hdmi6GRegNum, +ARRAY_SIZE (info->dp1_ext_hdmi_6g_reg_settings));for (i =0 ; i < info->dp1_ext_hdmi_6g_reg_num; i++) { info->dp1_ext_hdmi_6g_reg_settings[i].i2c_reg_index = info_v11->dp1_retimer_set.Hdmi6GhzRegSetting[i].ucI2cRegIndex;
@@ -2634,14 +2638,16 @@ static enum bp_result get_integrated_inf } info->dp2_ext_hdmi_slv_addr = info_v11->dp2_retimer_set.HdmiSlvAddr; - info->dp2_ext_hdmi_reg_num = info_v11->dp2_retimer_set.HdmiRegNum; + info->dp2_ext_hdmi_reg_num =min_t (u8, info_v11->dp2_retimer_set.HdmiRegNum, +ARRAY_SIZE (info->dp2_ext_hdmi_reg_settings));for (i =0 ; i < info->dp2_ext_hdmi_reg_num; i++) { info->dp2_ext_hdmi_reg_settings[i].i2c_reg_index = info_v11->dp2_retimer_set.HdmiRegSetting[i].ucI2cRegIndex; info->dp2_ext_hdmi_reg_settings[i].i2c_reg_val = info_v11->dp2_retimer_set.HdmiRegSetting[i].ucI2cRegVal; } - info->dp2_ext_hdmi_6g_reg_num = info_v11->dp2_retimer_set.Hdmi6GRegNum; + info->dp2_ext_hdmi_6g_reg_num =min_t (u8, info_v11->dp2_retimer_set.Hdmi6GRegNum, +ARRAY_SIZE (info->dp2_ext_hdmi_6g_reg_settings));for (i =0 ; i < info->dp2_ext_hdmi_6g_reg_num; i++) { info->dp2_ext_hdmi_6g_reg_settings[i].i2c_reg_index = info_v11->dp2_retimer_set.Hdmi6GhzRegSetting[i].ucI2cRegIndex;
@@ -2650,14 +2656,16 @@ static enum bp_result get_integrated_inf } info->dp3_ext_hdmi_slv_addr = info_v11->dp3_retimer_set.HdmiSlvAddr; - info->dp3_ext_hdmi_reg_num = info_v11->dp3_retimer_set.HdmiRegNum; + info->dp3_ext_hdmi_reg_num =min_t (u8, info_v11->dp3_retimer_set.HdmiRegNum, +ARRAY_SIZE (info->dp3_ext_hdmi_reg_settings));for (i =0 ; i < info->dp3_ext_hdmi_reg_num; i++) { info->dp3_ext_hdmi_reg_settings[i].i2c_reg_index = info_v11->dp3_retimer_set.HdmiRegSetting[i].ucI2cRegIndex; info->dp3_ext_hdmi_reg_settings[i].i2c_reg_val = info_v11->dp3_retimer_set.HdmiRegSetting[i].ucI2cRegVal; } - info->dp3_ext_hdmi_6g_reg_num = info_v11->dp3_retimer_set.Hdmi6GRegNum; + info->dp3_ext_hdmi_6g_reg_num =min_t (u8, info_v11->dp3_retimer_set.Hdmi6GRegNum, +ARRAY_SIZE (info->dp3_ext_hdmi_6g_reg_settings));for (i =0 ; i < info->dp3_ext_hdmi_6g_reg_num; i++) { info->dp3_ext_hdmi_6g_reg_settings[i].i2c_reg_index = info_v11->dp3_retimer_set.Hdmi6GhzRegSetting[i].ucI2cRegIndex;
@@ -2807,14 +2815,16 @@ static enum bp_result get_integrated_inf info->ext_disp_conn_info.checksum = info_v2_1->extdispconninfo.checksum; info->dp0_ext_hdmi_slv_addr = info_v2_1->dp0_retimer_set.HdmiSlvAddr; - info->dp0_ext_hdmi_reg_num = info_v2_1->dp0_retimer_set.HdmiRegNum; + info->dp0_ext_hdmi_reg_num =min_t (u8, info_v2_1->dp0_retimer_set.HdmiRegNum, +ARRAY_SIZE (info->dp0_ext_hdmi_reg_settings));for (i =0 ; i < info->dp0_ext_hdmi_reg_num; i++) { info->dp0_ext_hdmi_reg_settings[i].i2c_reg_index = info_v2_1->dp0_retimer_set.HdmiRegSetting[i].ucI2cRegIndex; info->dp0_ext_hdmi_reg_settings[i].i2c_reg_val = info_v2_1->dp0_retimer_set.HdmiRegSetting[i].ucI2cRegVal; } - info->dp0_ext_hdmi_6g_reg_num = info_v2_1->dp0_retimer_set.Hdmi6GRegNum; + info->dp0_ext_hdmi_6g_reg_num =min_t (u8, info_v2_1->dp0_retimer_set.Hdmi6GRegNum, +ARRAY_SIZE (info->dp0_ext_hdmi_6g_reg_settings));for (i =0 ; i < info->dp0_ext_hdmi_6g_reg_num; i++) { info->dp0_ext_hdmi_6g_reg_settings[i].i2c_reg_index = info_v2_1->dp0_retimer_set.Hdmi6GhzRegSetting[i].ucI2cRegIndex;
@@ -2822,14 +2832,16 @@ static enum bp_result get_integrated_inf info_v2_1->dp0_retimer_set.Hdmi6GhzRegSetting[i].ucI2cRegVal; } info->dp1_ext_hdmi_slv_addr = info_v2_1->dp1_retimer_set.HdmiSlvAddr; - info->dp1_ext_hdmi_reg_num = info_v2_1->dp1_retimer_set.HdmiRegNum; + info->dp1_ext_hdmi_reg_num =min_t (u8, info_v2_1->dp1_retimer_set.HdmiRegNum, +ARRAY_SIZE (info->dp1_ext_hdmi_reg_settings));for (i =0 ; i < info->dp1_ext_hdmi_reg_num; i++) { info->dp1_ext_hdmi_reg_settings[i].i2c_reg_index = info_v2_1->dp1_retimer_set.HdmiRegSetting[i].ucI2cRegIndex; info->dp1_ext_hdmi_reg_settings[i].i2c_reg_val = info_v2_1->dp1_retimer_set.HdmiRegSetting[i].ucI2cRegVal; } - info->dp1_ext_hdmi_6g_reg_num = info_v2_1->dp1_retimer_set.Hdmi6GRegNum; + info->dp1_ext_hdmi_6g_reg_num =min_t (u8, info_v2_1->dp1_retimer_set.Hdmi6GRegNum, +ARRAY_SIZE (info->dp1_ext_hdmi_6g_reg_settings));for (i =0 ; i < info->dp1_ext_hdmi_6g_reg_num; i++) { info->dp1_ext_hdmi_6g_reg_settings[i].i2c_reg_index = info_v2_1->dp1_retimer_set.Hdmi6GhzRegSetting[i].ucI2cRegIndex;
@@ -2837,14 +2849,16 @@ static enum bp_result get_integrated_inf info_v2_1->dp1_retimer_set.Hdmi6GhzRegSetting[i].ucI2cRegVal; } info->dp2_ext_hdmi_slv_addr = info_v2_1->dp2_retimer_set.HdmiSlvAddr; - info->dp2_ext_hdmi_reg_num = info_v2_1->dp2_retimer_set.HdmiRegNum; + info->dp2_ext_hdmi_reg_num =min_t (u8, info_v2_1->dp2_retimer_set.HdmiRegNum, +ARRAY_SIZE (info->dp2_ext_hdmi_reg_settings));for (i =0 ; i < info->dp2_ext_hdmi_reg_num; i++) { info->dp2_ext_hdmi_reg_settings[i].i2c_reg_index = info_v2_1->dp2_retimer_set.HdmiRegSetting[i].ucI2cRegIndex; info->dp2_ext_hdmi_reg_settings[i].i2c_reg_val = info_v2_1->dp2_retimer_set.HdmiRegSetting[i].ucI2cRegVal; } - info->dp2_ext_hdmi_6g_reg_num = info_v2_1->dp2_retimer_set.Hdmi6GRegNum; + info->dp2_ext_hdmi_6g_reg_num =min_t (u8, info_v2_1->dp2_retimer_set.Hdmi6GRegNum, +ARRAY_SIZE (info->dp2_ext_hdmi_6g_reg_settings));for (i =0 ; i < info->dp2_ext_hdmi_6g_reg_num; i++) { info->dp2_ext_hdmi_6g_reg_settings[i].i2c_reg_index = info_v2_1->dp2_retimer_set.Hdmi6GhzRegSetting[i].ucI2cRegIndex;
@@ -2852,14 +2866,16 @@ static enum bp_result get_integrated_inf info_v2_1->dp2_retimer_set.Hdmi6GhzRegSetting[i].ucI2cRegVal; } info->dp3_ext_hdmi_slv_addr = info_v2_1->dp3_retimer_set.HdmiSlvAddr; - info->dp3_ext_hdmi_reg_num = info_v2_1->dp3_retimer_set.HdmiRegNum; + info->dp3_ext_hdmi_reg_num =min_t (u8, info_v2_1->dp3_retimer_set.HdmiRegNum, +ARRAY_SIZE (info->dp3_ext_hdmi_reg_settings));for (i =0 ; i < info->dp3_ext_hdmi_reg_num; i++) { info->dp3_ext_hdmi_reg_settings[i].i2c_reg_index = info_v2_1->dp3_retimer_set.HdmiRegSetting[i].ucI2cRegIndex; info->dp3_ext_hdmi_reg_settings[i].i2c_reg_val = info_v2_1->dp3_retimer_set.HdmiRegSetting[i].ucI2cRegVal; } - info->dp3_ext_hdmi_6g_reg_num = info_v2_1->dp3_retimer_set.Hdmi6GRegNum; + info->dp3_ext_hdmi_6g_reg_num =min_t (u8, info_v2_1->dp3_retimer_set.Hdmi6GRegNum, +ARRAY_SIZE (info->dp3_ext_hdmi_6g_reg_settings));for (i =0 ; i < info->dp3_ext_hdmi_6g_reg_num; i++) { info->dp3_ext_hdmi_6g_reg_settings[i].i2c_reg_index = info_v2_1->dp3_retimer_set.Hdmi6GhzRegSetting[i].ucI2cRegIndex;
Greg Kroah-Hartman
maintainerPATCH 300/325 drm/amd/display: add missing CSC entries for BT.2020 for DCE IPs
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Leorize <[email protected]>
commit 6590fe323ce2807f5d9454e7fccf3fab875d4352 upstream.
DCE-based hardware does not have the CSC matrices for BT.2020, which causes the driver to fallback to the GPU built-in matrices. This does not appear to cause any issues for RGB sinks, but causes major color artifacts for YCbCr ones (e.g. black becomes green).
This commit adds the missing CSC matrices (taken from DC common) to DCE CSC tables, resolving the issue.
--- drivers/gpu/drm/amd/display/dc/dce/dce_transform.c | 10 +++++++++- drivers/gpu/drm/amd/display/dc/dce110/dce110_opp_csc_v.c | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dce_transform.c +9 -1
@@ -110,7 +110,15 @@ static const struct out_csc_color_matrix { COLOR_SPACE_YCBCR601_LIMITED, { 0xE00, 0xF447, 0xFDB9, 0x1000, 0x991, 0x12C9, 0x3A6, 0x200, 0xFB47, 0xF6B9, 0xE00, 0x1000} }, { COLOR_SPACE_YCBCR709_LIMITED, { 0xE00, 0xF349, 0xFEB7, 0x1000, 0x6CE, 0x16E3, - 0x24F, 0x200, 0xFCCB, 0xF535, 0xE00, 0x1000} } + 0x24F, 0x200, 0xFCCB, 0xF535, 0xE00, 0x1000} }, +{ COLOR_SPACE_2020_RGB_FULLRANGE, + { 0x2000, 0, 0, 0, 0, 0x2000, 0, 0, 0, 0, 0x2000, 0} }, +{ COLOR_SPACE_2020_RGB_LIMITEDRANGE, + { 0x1B67, 0, 0, 0x201, 0, 0x1B67, 0, 0x201, 0, 0, 0x1B67, 0x201} }, +{ COLOR_SPACE_2020_YCBCR_LIMITED, { 0x1000, 0xF149, 0xFEB7, 0x1004, 0x0868, + 0x15B2, 0x01E6, 0x201, 0xFB88, 0xF478, 0x1000, 0x1004} }, +{ COLOR_SPACE_2020_YCBCR_FULL, { 0x1000, 0xF149, 0xFEB7, 0x1004, 0x0868, 0x15B2, + 0x01E6, 0x201, 0xFB88, 0xF478, 0x1000, 0x1004} } }; static bool setup_scaling_configuration(
drivers/gpu/drm/amd/display/dc/dce110/dce110_opp_csc_v.c +9 -1
@@ -88,7 +88,15 @@ static const struct out_csc_color_matrix { COLOR_SPACE_YCBCR601_LIMITED, { 0xE00, 0xF447, 0xFDB9, 0x1000, 0x991, 0x12C9, 0x3A6, 0x200, 0xFB47, 0xF6B9, 0xE00, 0x1000} }, { COLOR_SPACE_YCBCR709_LIMITED, { 0xE00, 0xF349, 0xFEB7, 0x1000, 0x6CE, 0x16E3, - 0x24F, 0x200, 0xFCCB, 0xF535, 0xE00, 0x1000} } + 0x24F, 0x200, 0xFCCB, 0xF535, 0xE00, 0x1000} }, +{ COLOR_SPACE_2020_RGB_FULLRANGE, + { 0x2000, 0, 0, 0, 0, 0x2000, 0, 0, 0, 0, 0x2000, 0} }, +{ COLOR_SPACE_2020_RGB_LIMITEDRANGE, + { 0x1B67, 0, 0, 0x201, 0, 0x1B67, 0, 0x201, 0, 0, 0x1B67, 0x201} }, +{ COLOR_SPACE_2020_YCBCR_LIMITED, { 0x1000, 0xF149, 0xFEB7, 0x1004, 0x0868, + 0x15B2, 0x01E6, 0x201, 0xFB88, 0xF478, 0x1000, 0x1004} }, +{ COLOR_SPACE_2020_YCBCR_FULL, { 0x1000, 0xF149, 0xFEB7, 0x1004, 0x0868, 0x15B2, + 0x01E6, 0x201, 0xFB88, 0xF478, 0x1000, 0x1004} } }; enum csc_color_mode {
Greg Kroah-Hartman
maintainerPATCH 301/325 drm/amd/display: Fix NULL deref and buffer over-read in SDP debugfs
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Harry Wentland <[email protected]>
commit adf67034b1f61f7119295208085bfd43f85f56af upstream.
[Why & How]dp_sdp_message_debugfs_write() dereferences connector->base.state->crtc without checking for NULL. A connector can be connected but not bound to any CRTC (e.g. after hot-plug before the next atomic commit), causing a kernel crash when writing to the sdp_message debugfs node.
The function also ignores the user-provided size argument and always passes 36 bytes to copy_from_user(), reading past the user buffer when size < 36.
Fix both issues by:
- Returning -ENODEV when connector->base.state or state->crtc is NULL
- Clamping write_size to min(size, sizeof(data))
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +5 -0
@@ -1339,8 +1339,13 @@ static ssize_t dp_sdp_message_debugfs_wrif (size ==0 )return 0 ; +if (!connector->base.state || !connector->base.state->crtc) +return -ENODEV ; + acrtc_state =to_dm_crtc_state (connector->base.state->crtc->state); + write_size =min_t (size_t, size,sizeof (data)); + r =copy_from_user (data, buf, write_size); write_size -= r;
Greg Kroah-Hartman
maintainerPATCH 302/325 drm/amd/display: Fix out-of-bounds read in dp_get_eq_aux_rd_interval()
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Harry Wentland <[email protected]>
commit e8b4d37eba05141ee01794fc6b7f2da808cee83b upstream.
[Why & How]
The aux_rd_interval array in struct dc_lttpr_caps is declared with MAX_REPEATER_CNT - 1 (7) elements, indexed 0..6. However, the offset parameter passed to dp_get_eq_aux_rd_interval() can be as large as MAX_REPEATER_CNT (8) when a sink reports 8 LTTPR repeaters via DPCD. This leads to an out-of-bounds read of aux_rd_interval[7] when offset is 8.
Fix this by growing aux_rd_interval to MAX_REPEATER_CNT elements to accommodate the full range of valid repeater counts defined by the DP spec.
--- drivers/gpu/drm/amd/display/dc/dc_dp_types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dc_dp_types.h +1 -1
@@ -1188,7 +1188,7 @@ struct dc_lttpr_caps {union dp_main_link_channel_coding_lttpr_cap main_link_channel_coding;union dp_128b_132b_supported_lttpr_link_rates supported_128b_132b_rates;union dp_alpm_lttpr_cap alpm; -uint8_t aux_rd_interval[MAX_REPEATER_CNT -1 ]; +uint8_t aux_rd_interval[MAX_REPEATER_CNT ];uint8_t lttpr_ieee_oui[3 ];// Always read from closest LTTPR to host uint8_t lttpr_device_id[6 ];// Always read from closest LTTPR to host };
Greg Kroah-Hartman
maintainerPATCH 303/325 drm/amd/display: Use krealloc_array() in dal_vector_reserve()
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Harry Wentland <[email protected]>
commit da48bc4461b8a5ebfb9264c9b191a701d8e99009 upstream.
[Why & How]dal_vector_reserve() computes the allocation size as "capacity * vector->struct_size" using uint32_t arithmetic, which can silently wrap to a small value on overflow. This would cause krealloc to return a smaller buffer than expected, leading to heap overflows on subsequent vector appends.
Replace krealloc() with krealloc_array() which performs an internal overflow check and returns NULL on wrap, preventing the issue.
--- drivers/gpu/drm/amd/display/dc/basics/vector.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/basics/vector.c +2 -2
@@ -288,8 +288,8 @@ bool dal_vector_reserve(struct vector *vif (capacity <= vector->capacity)return true; - new_container =krealloc (vector->container, - capacity * vector->struct_size,GFP_KERNEL ); + new_container =krealloc_array (vector->container, + capacity, vector->struct_size,GFP_KERNEL );if (new_container) { vector->container = new_container;
Greg Kroah-Hartman
maintainerPATCH 304/325 fs/fcntl: fix SOFTIRQ-unsafe lock order in fasync signaling
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mingyu Wang <[email protected]>
commit 00633c4683828acd5256fa8d5163f440d74bbe71 upstream.
A SOFTIRQ-safe to SOFTIRQ-unsafe lock order deadlock can occur in send_sigio() and send_sigurg() when a process group receives a signal.
When FASYNC is configured for a process group (PIDTYPE_PGID), both functions use read_lock(&tasklist_lock) to traverse the task list. However, they are frequently called from softirq context:
- send_sigio() via input_inject_event -> kill_fasync
- send_sigurg() via tcp_check_urg -> sk_send_sigurg (NET_RX_SOFTIRQ)
The deadlock is caused by the rwlock writer fairness mechanism:
1. CPU 0 (process context) holds read_lock(&tasklist_lock) in do_wait().
2. CPU 1 (process context) attempts write_lock(&tasklist_lock) in fork() or exit() and spins, which blocks all new readers.
3. CPU 0 is interrupted by a softirq (e.g., TCP URG packet reception).
4. The softirq calls send_sigurg() and attempts to acquire read_lock(&tasklist_lock), deadlocking because CPU 1 is waiting.
Since PID hashing and do_each_pid_task() traversals are already RCU-protected, the read_lock on tasklist_lock is no longer strictly required for safe traversal. Fix this by replacing tasklist_lock with rcu_read_lock(), aligning the process group signaling path with the single-PID path. This also mitigates a potential remote denial of service vector via TCP URG packets.
Lockdep splat:
=====================================================
WARNING: SOFTIRQ-safe -> SOFTIRQ-unsafe lock order detected [...]
Chain exists of: &dev->event_lock --> &f_owner->lock --> tasklist_lock
Possible interrupt unsafe locking scenario:
CPU0 CPU1
---- ----
lock(tasklist_lock);
local_irq_disable();
lock(&dev->event_lock);
lock(&f_owner->lock);
<Interrupt>
lock(&dev->event_lock);*** DEADLOCK ***
--- fs/fcntl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
fs/fcntl.c +4 -4
@@ -916,11 +916,11 @@ void send_sigio(struct fown_struct *fownsend_sigio_to_task (p, fown, fd, band, type);rcu_read_unlock (); }else { -read_lock (&tasklist_lock); +rcu_read_lock (); do_each_pid_task(pid, type, p) {send_sigio_to_task (p, fown, fd, band, type); }while_each_pid_task (pid, type, p); -read_unlock (&tasklist_lock); +rcu_read_unlock (); } out_unlock_fown:read_unlock_irqrestore (&fown->lock, flags);
@@ -962,11 +962,11 @@ int send_sigurg(struct file *file)send_sigurg_to_task (p, fown, type);rcu_read_unlock (); }else { -read_lock (&tasklist_lock); +rcu_read_lock (); do_each_pid_task(pid, type, p) {send_sigurg_to_task (p, fown, type); }while_each_pid_task (pid, type, p); -read_unlock (&tasklist_lock); +rcu_read_unlock (); } out_unlock_fown:read_unlock_irqrestore (&fown->lock, flags);
Greg Kroah-Hartman
maintainerPATCH 305/325 driver core: reject devices with unregistered buses
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit 36f35b8df6972167102a1c3d4361e0afb6a84534 upstream.
Trying to register a device on a bus which has not yet been registered used to trigger a NULL-pointer dereference, but since the const bus structure rework registration instead succeeds without the device being added to the bus.
This specifically means that the device will never bind to a driver and that the bus sysfs attributes are not created (i.e. as if the device had no bus).
Reject devices with unregistered buses to catch any callers that get the ordering wrong and to handle bus registration failures more gracefully.
--- drivers/base/bus.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/base/bus.c +9 -2
@@ -506,10 +506,10 @@ static const struct attribute_group driv*/ int bus_add_device (struct device *dev) { -struct subsys_private *sp =bus_to_subsys (dev->bus); +struct subsys_private *sp;int error; -if (!sp) { +if (!dev->bus) {/* * This is a normal operation for many devices that do not * have a bus assigned to them, just say that all went
@@ -518,6 +518,13 @@ int bus_add_device(struct device *dev)return 0 ; } + sp =bus_to_subsys (dev->bus); +if (!sp) { +pr_err ("%s: cannot add device '%s' to unregistered bus '%s'\n" , + __func__,dev_name (dev), dev->bus->name); +return -EINVAL ; + } +/* * Reference in sp is now incremented and will be dropped when * the device is removed from the bus
Greg Kroah-Hartman
maintainerPATCH 306/325 wifi: mac80211: skip ieee80211_verify_sta_ht_mcs_support check in non-strict mode
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rio Liu <[email protected]>
commit 711a9c018ad252b2807f85d44e1267b595644f9b upstream.
Some Xfinity XB8 firmware advertises >1 spatial stream MCS indexes in their basic HT-MCS set. On cards with lower spatial streams, the check would fail, and we'd be stuck with no HT when in fact work fine with its own supported rate. This change makes it so the check is only performed in strict mode.
--- net/mac80211/mlme.c | 9 +++++++++ 1 file changed, 9 insertions(+)
net/mac80211/mlme.c +9 -0
@@ -364,6 +364,15 @@ ieee80211_verify_sta_ht_mcs_support(struieee80211_apply_htcap_overrides (sdata, &sta_ht_cap);/* +* Some Xfinity XB8 firmware advertises >1 spatial stream MCS indexes in +* their basic HT-MCS set. On cards with lower spatial streams, the check +* would fail, and we'd be stuck with no HT when it in fact work fine with +* its own supported rate. So check it only in strict mode. +*/ +if (!ieee80211_hw_check (&sdata->local->hw,STRICT )) +return true; + +/* * P802.11REVme/D7.0 - 6.5.4.2.4 * ... * If the MLME of an HT STA receives an MLME-JOIN.request primitive
Greg Kroah-Hartman
maintainerPATCH 307/325 wifi: mac80211: tests: mark HT check strict
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <[email protected]>
commit 0cfff13c94cb5fa818bb374945ff280e08dc1bb9 upstream.
The HT check now only applies in strict mode since APs were found to be broken. Mark it as such.
--- net/mac80211/tests/chan-mode.c | 1 + 1 file changed, 1 insertion(+)
net/mac80211/tests/chan-mode.c +1 -0
@@ -65,6 +65,7 @@ static const struct determine_chan_mode_ .ht_capa_mask = { .mcs.rx_mask[0] = 0xf7, }, + .strict = true, }, { .desc = "Masking out a RX rate in VHT capabilities", .conn_mode = IEEE80211_CONN_MODE_EHT,
Greg Kroah-Hartman
maintainerPATCH 308/325 sched_ext: Dont warn on NULL cgrp_moving_from in scx_cgroup_move_task()
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tejun Heo <[email protected]>
commit 02e545c4297a26dbbc41df81b831e7f605bcd306 upstream.
A WARN fires when systemd's user manager writes "+cpu +memory +pids" to its own subtree_control while a sched_ext scheduler is loaded:
WARNING: at kernel/sched/ext.c:3227 scx_cgroup_move_task+0xa8/0xb0 scx_cgroup_move_task+0xa8/0xb0 sched_move_task+0x134/0x290 cpu_cgroup_attach+0x39/0x70 cgroup_migrate_execute+0x37d/0x450 cgroup_update_dfl_csses+0x1e3/0x270 cgroup_subtree_control_write+0x3e7/0x440
scx_cgroup_can_attach() arms cgrp_moving_from only when a task's cpu cgroup changes. It can still be NULL when scx_cgroup_move_task() runs, through this sequence:
Step Result --------------------------------- ---------------------------------- 1. cpu enabled on cgroup G cpu css = A 2. cpu toggled off then on for G A killed, B created (same cgroup) 3. an exiting task keeps A alive migration skips it, A now stale 4. +memory migrates G stale A vs current B pulls cpu in 5. cpu attach runs for all tasks hits a live, cpu-unchanged task 6. scx_cgroup_move_task() on it cgrp_moving_from NULL -> WARN
The mismatch is that scx_cgroup_can_attach() keys on cgroup identity while migration drives the move on css identity, so a NULL cgrp_moving_from here is a legitimate css-only migration, not a missing prep.
The call is already gated on cgrp_moving_from, so just drop the warning. ops.cgroup_prep_move() and ops.cgroup_move() stay paired.
[ mfleming: keep the 6.18.y SCX_KF_REST argument in the
SCX_CALL_OP_TASK() call. ]
--- kernel/sched/ext.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
kernel/sched/ext.c +6 -4
@@ -3221,11 +3221,13 @@ void scx_cgroup_move_task(struct task_struct *p)return ;/* -* @p must have ops.cgroup_prep_move() called on it and thus -* cgrp_moving_from set. +* scx_cgroup_can_attach() sets cgrp_moving_from only when the task's +* cgroup changes. Migration keys off css rather than cgroup identity, +* so it can hand an unchanged-cgroup task here with cgrp_moving_from +* NULL. Nothing to report to the BPF scheduler then, so skip it and +* keep prep_move and move paired. */ -if (SCX_HAS_OP (sch, cgroup_move) && - !WARN_ON_ONCE (!p->scx.cgrp_moving_from)) +if (SCX_HAS_OP (sch, cgroup_move) && p->scx.cgrp_moving_from)SCX_CALL_OP_TASK (sch,SCX_KF_REST , cgroup_move,task_rq (p), p, p->scx.cgrp_moving_from,tg_cgrp (task_group (p)));
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 309/325 RDMA/umem: Add ib_umem_dmabuf_get_pinned_and_lock helper
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jacob Moroni <[email protected]>
[ Upstream commit 553dfa8cbd0c6d36adae042d9738ddf8f8765ac7 ]
Move the inner logic of ib_umem_dmabuf_get_pinned_with_dma_device() to a new static function that returns with the lock held upon success.
The intent is to allow reuse for the future get_pinned_revocable_and_lock function.
Stable-dep-of: badad6fad60d ("RDMA: During rereg_mr ensure that REREG_ACCESS is compatible")
--- drivers/infiniband/core/umem_dmabuf.c | 35 +++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-)
drivers/infiniband/core/umem_dmabuf.c +26 -9
@@ -198,18 +198,19 @@ static struct dma_buf_attach_ops ib_umem .move_notify = ib_umem_dmabuf_unsupported_move_notify, }; -struct ib_umem_dmabuf * -ib_umem_dmabuf_get_pinned_with_dma_device (struct ib_device *device, -struct device *dma_device, -unsigned long offset,size_t size, -int fd,int access) +static struct ib_umem_dmabuf * +ib_umem_dmabuf_get_pinned_and_lock (struct ib_device *device, +struct device *dma_device, +unsigned long offset, +size_t size,int fd,int access, +const struct dma_buf_attach_ops *ops) {struct ib_umem_dmabuf *umem_dmabuf;int err; - umem_dmabuf =ib_umem_dmabuf_get_with_dma_device (device, dma_device, offset, - size, fd, access, - &ib_umem_dmabuf_attach_pinned_ops); + umem_dmabuf = +ib_umem_dmabuf_get_with_dma_device (device, dma_device, offset, + size, fd, access, ops);if (IS_ERR (umem_dmabuf))return umem_dmabuf;
@@ -222,7 +223,6 @@ ib_umem_dmabuf_get_pinned_with_dma_devic err =ib_umem_dmabuf_map_pages (umem_dmabuf);if (err) goto err_release; -dma_resv_unlock (umem_dmabuf->attach->dmabuf->resv);return umem_dmabuf;
@@ -231,6 +231,23 @@ err_release:ib_umem_release (&umem_dmabuf->umem);return ERR_PTR (err); } + +struct ib_umem_dmabuf * +ib_umem_dmabuf_get_pinned_with_dma_device (struct ib_device *device, +struct device *dma_device, +unsigned long offset,size_t size, +int fd,int access) +{ +struct ib_umem_dmabuf *umem_dmabuf = +ib_umem_dmabuf_get_pinned_and_lock (device, dma_device, offset, + size, fd, access, + &ib_umem_dmabuf_attach_pinned_ops); +if (IS_ERR (umem_dmabuf)) +return umem_dmabuf; + +dma_resv_unlock (umem_dmabuf->attach->dmabuf->resv); +return umem_dmabuf; +}EXPORT_SYMBOL (ib_umem_dmabuf_get_pinned_with_dma_device); struct ib_umem_dmabuf *ib_umem_dmabuf_get_pinned(struct ib_device *device,
Greg Kroah-Hartman
maintainerPATCH 310/325 RDMA/umem: Move umem dmabuf revoke logic into helper function
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jacob Moroni <[email protected]>
[ Upstream commit 797291a66ce346c96114b72222fc290d402da005 ]
This same logic will eventually be reused from within the invalidate_mappings callback which already has the dma_resv_lock held, so break it out into a separate function so it can be reused.
Stable-dep-of: badad6fad60d ("RDMA: During rereg_mr ensure that REREG_ACCESS is compatible")
--- drivers/infiniband/core/umem_dmabuf.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-)
drivers/infiniband/core/umem_dmabuf.c +17 -9
@@ -198,6 +198,22 @@ static struct dma_buf_attach_ops ib_umem .move_notify = ib_umem_dmabuf_unsupported_move_notify, }; +static void ib_umem_dmabuf_revoke_locked (struct dma_buf_attachment *attach) +{ +struct ib_umem_dmabuf *umem_dmabuf = attach->importer_priv; + +dma_resv_assert_held (attach->dmabuf->resv); + +if (umem_dmabuf->revoked) +return ; +ib_umem_dmabuf_unmap_pages (umem_dmabuf); +if (umem_dmabuf->pinned) { +dma_buf_unpin (umem_dmabuf->attach); + umem_dmabuf->pinned =0 ; + } + umem_dmabuf->revoked =1 ; +} +static struct ib_umem_dmabuf * ib_umem_dmabuf_get_pinned_and_lock(struct ib_device *device, struct device *dma_device,
@@ -265,15 +281,7 @@ void ib_umem_dmabuf_revoke(struct ib_umestruct dma_buf *dmabuf = umem_dmabuf->attach->dmabuf;dma_resv_lock (dmabuf->resv,NULL ); -if (umem_dmabuf->revoked) - goto end; -ib_umem_dmabuf_unmap_pages (umem_dmabuf); -if (umem_dmabuf->pinned) { -dma_buf_unpin (umem_dmabuf->attach); - umem_dmabuf->pinned =0 ; - } - umem_dmabuf->revoked =1 ; -end: +ib_umem_dmabuf_revoke_locked (umem_dmabuf->attach);dma_resv_unlock (dmabuf->resv); }EXPORT_SYMBOL (ib_umem_dmabuf_revoke);
Greg Kroah-Hartman
maintainerPATCH 311/325 RDMA/umem: Add helpers for umem dmabuf revoke lock
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jacob Moroni <[email protected]>
[ Upstream commit 3a0b171302eea1732a168e26db3b8461f51cc1f9 ]
Added helpers to acquire and release the umem dmabuf revoke lock. The intent is to avoid the need for drivers to peek into the ib_umem_dmabuf internals to get the dma_resv_lock and bring us one step closer to abstracting ib_umem_dmabuf away from drivers in general.
Stable-dep-of: badad6fad60d ("RDMA: During rereg_mr ensure that REREG_ACCESS is compatible")
--- drivers/infiniband/core/umem_dmabuf.c | 16 ++++++++++++++++ include/rdma/ib_umem.h | 4 ++++ 2 files changed, 20 insertions(+)
drivers/infiniband/core/umem_dmabuf.c +16 -0
@@ -276,6 +276,22 @@ struct ib_umem_dmabuf *ib_umem_dmabuf_ge }EXPORT_SYMBOL (ib_umem_dmabuf_get_pinned); +void ib_umem_dmabuf_revoke_lock (struct ib_umem_dmabuf *umem_dmabuf) +{ +struct dma_buf *dmabuf = umem_dmabuf->attach->dmabuf; + +dma_resv_lock (dmabuf->resv,NULL ); +} +EXPORT_SYMBOL (ib_umem_dmabuf_revoke_lock); + +void ib_umem_dmabuf_revoke_unlock (struct ib_umem_dmabuf *umem_dmabuf) +{ +struct dma_buf *dmabuf = umem_dmabuf->attach->dmabuf; + +dma_resv_unlock (dmabuf->resv); +} +EXPORT_SYMBOL (ib_umem_dmabuf_revoke_unlock); +void ib_umem_dmabuf_revoke (struct ib_umem_dmabuf *umem_dmabuf) {struct dma_buf *dmabuf = umem_dmabuf->attach->dmabuf;
include/rdma/ib_umem.h +4 -0
@@ -176,6 +176,8 @@ ib_umem_dmabuf_get_pinned_with_dma_devicint ib_umem_dmabuf_map_pages (struct ib_umem_dmabuf *umem_dmabuf);void ib_umem_dmabuf_unmap_pages (struct ib_umem_dmabuf *umem_dmabuf);void ib_umem_dmabuf_release (struct ib_umem_dmabuf *umem_dmabuf); +void ib_umem_dmabuf_revoke_lock (struct ib_umem_dmabuf *umem_dmabuf); +void ib_umem_dmabuf_revoke_unlock (struct ib_umem_dmabuf *umem_dmabuf);void ib_umem_dmabuf_revoke (struct ib_umem_dmabuf *umem_dmabuf);#else /* CONFIG_INFINIBAND_USER_MEM */
@@ -236,6 +238,8 @@ static inline int ib_umem_dmabuf_map_pag }static inline void ib_umem_dmabuf_unmap_pages (struct ib_umem_dmabuf *umem_dmabuf) { }static inline void ib_umem_dmabuf_release (struct ib_umem_dmabuf *umem_dmabuf) { } +static inline void ib_umem_dmabuf_revoke_lock (struct ib_umem_dmabuf *umem_dmabuf) {} +static inline void ib_umem_dmabuf_revoke_unlock (struct ib_umem_dmabuf *umem_dmabuf) {}static inline void ib_umem_dmabuf_revoke (struct ib_umem_dmabuf *umem_dmabuf) {}#endif /* CONFIG_INFINIBAND_USER_MEM */
Greg Kroah-Hartman
maintainerPATCH 312/325 RDMA: During rereg_mr ensure that REREG_ACCESS is compatible
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jason Gunthorpe <[email protected]>
[ Upstream commit badad6fad60def1b9805559dd81dbab3d97b82aa ]
If IB_MR_REREG_ACCESS changes from RO to RW then the umem has to be re-evaluated to ensure it is properly pinned as RW. Since the umem is hidden inside each driver's mr struct add a ib_umem_check_rereg() function that each driver has to call before processing IB_MR_REREG_ACCESS.
mlx4 has to retain its duplicate ib_access_writable check because it implements IB_MR_REREG_ACCESS | IB_MR_REREG_TRANS by changing both items in place sequentially while the MR is live, so it will continue to not support this combination.
--- drivers/infiniband/core/umem.c | 16 ++++++++++++++++ drivers/infiniband/hw/hns/hns_roce_mr.c | 4 ++++ drivers/infiniband/hw/irdma/verbs.c | 4 ++++ drivers/infiniband/hw/mlx4/mr.c | 4 ++++ drivers/infiniband/hw/mlx5/mr.c | 4 ++++ drivers/infiniband/sw/rxe/rxe_verbs.c | 5 +++++ include/rdma/ib_umem.h | 8 ++++++++ 7 files changed, 45 insertions(+)
drivers/infiniband/core/umem.c +16 -0
@@ -326,3 +326,19 @@ int ib_umem_copy_from(void *dst, structreturn 0 ; }EXPORT_SYMBOL (ib_umem_copy_from); + +/* +* Called during rereg mr if the driver is able to re-use a umem for +* IB_MR_REREG_ACCESS. +*/ +int ib_umem_check_rereg (struct ib_umem *umem,int flags,int new_access_flags) +{ +if (!umem) +return 0 ; + +if ((flags &IB_MR_REREG_ACCESS ) && !(flags &IB_MR_REREG_TRANS )) +if (ib_access_writable (new_access_flags) && !umem->writable) +return -EACCES ; +return 0 ; +} +EXPORT_SYMBOL (ib_umem_check_rereg);
drivers/infiniband/hw/hns/hns_roce_mr.c +4 -0
@@ -300,6 +300,10 @@ struct ib_mr *hns_roce_rereg_user_mr(str goto err_out; } + ret =ib_umem_check_rereg (mr->pbl_mtr.umem, flags, mr_access_flags); +if (ret) + goto err_out; + mailbox =hns_roce_alloc_cmd_mailbox (hr_dev); ret =PTR_ERR_OR_ZERO (mailbox);if (ret)
drivers/infiniband/hw/irdma/verbs.c +4 -0
@@ -3749,6 +3749,10 @@ static struct ib_mr *irdma_rereg_user_mrif (flags & ~(IB_MR_REREG_TRANS |IB_MR_REREG_PD |IB_MR_REREG_ACCESS ))return ERR_PTR (-EOPNOTSUPP ); + ret =ib_umem_check_rereg (iwmr->region, flags, new_access); +if (ret) +return ERR_PTR (ret); + ret =irdma_hwdereg_mr (ib_mr);if (ret)return ERR_PTR (ret);
drivers/infiniband/hw/mlx4/mr.c +4 -0
@@ -208,6 +208,10 @@ struct ib_mr *mlx4_ib_rereg_user_mr(strustruct mlx4_mpt_entry **pmpt_entry = &mpt_entry;int err; + err =ib_umem_check_rereg (mmr->umem, flags, mr_access_flags); +if (err) +return ERR_PTR (err); +/* Since we synchronize this call and mlx4_ib_dereg_mr via uverbs, * we assume that the calls can't run concurrently. Otherwise, a * race exists.
drivers/infiniband/hw/mlx5/mr.c +4 -0
@@ -1895,6 +1895,10 @@ struct ib_mr *mlx5_ib_rereg_user_mr(struif (flags & ~(IB_MR_REREG_TRANS |IB_MR_REREG_PD |IB_MR_REREG_ACCESS ))return ERR_PTR (-EOPNOTSUPP ); + err =ib_umem_check_rereg (mr->umem, flags, new_access_flags); +if (err) +return ERR_PTR (err); +if (!(flags &IB_MR_REREG_ACCESS )) new_access_flags = mr->access_flags;if (!(flags &IB_MR_REREG_PD ))
drivers/infiniband/sw/rxe/rxe_verbs.c +5 -0
@@ -1332,6 +1332,7 @@ static struct ib_mr *rxe_rereg_user_mr(sstruct rxe_mr *mr =to_rmr (ibmr);struct rxe_pd *old_pd =to_rpd (ibmr->pd);struct rxe_pd *pd =to_rpd (ibpd); +int err;/* for now only support the two easy cases: * rereg_pd and rereg_access
@@ -1341,6 +1342,10 @@ static struct ib_mr *rxe_rereg_user_mr(sreturn ERR_PTR (-EOPNOTSUPP ); } + err =ib_umem_check_rereg (mr->umem, flags, access); +if (err) +return ERR_PTR (err); +if (flags &IB_MR_REREG_PD ) {rxe_put (old_pd);rxe_get (pd);
include/rdma/ib_umem.h +8 -0
@@ -180,6 +180,8 @@ void ib_umem_dmabuf_revoke_lock(struct ivoid ib_umem_dmabuf_revoke_unlock (struct ib_umem_dmabuf *umem_dmabuf);void ib_umem_dmabuf_revoke (struct ib_umem_dmabuf *umem_dmabuf); +int ib_umem_check_rereg (struct ib_umem *umem,int flags,int new_access_flags); +#else /* CONFIG_INFINIBAND_USER_MEM */ #include <linux/err.h>
@@ -242,5 +244,11 @@ static inline void ib_umem_dmabuf_revokestatic inline void ib_umem_dmabuf_revoke_unlock (struct ib_umem_dmabuf *umem_dmabuf) {}static inline void ib_umem_dmabuf_revoke (struct ib_umem_dmabuf *umem_dmabuf) {} +static inline int ib_umem_check_rereg (struct ib_umem *umem,int flags, +int new_access_flags) +{ +return -EOPNOTSUPP ; +} +#endif /* CONFIG_INFINIBAND_USER_MEM */ #endif /* IB_UMEM_H */
Greg Kroah-Hartman
maintainerPATCH 313/325 netfilter: nft_fib: fix stale stack leak via the OIFNAME register
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Davide Ornaghi <[email protected]>
[ Upstream commit ab185e0c4fb82dfba6fb86f8271e06f931d9c64c ]
For NFT_FIB_RESULT_OIFNAME the destination register is declared with len = IFNAMSIZ (four 32-bit registers), but on the lookup-fail, RTN_LOCAL and oif-mismatch paths nft_fib{4,6}_eval() only writes one register via "*dest = 0". The remaining three registers are left as whatever was on the stack in nft_do_chain()'s struct nft_regs, and a downstream expression that loads the register span can leak that uninitialised kernel stack to userspace.
The NFTA_FIB_F_PRESENT existence check has the same shape: it is only meaningful for NFT_FIB_RESULT_OIF, yet it was accepted for any result type while the eval stores a single byte via nft_reg_store8(), leaving the rest of the declared span stale.
Fix both:
- replace the bare "*dest = 0" in the eval with nft_fib_store_result(), which strscpy_pad()s the whole IFNAMSIZ for OIFNAME (and is already used on the other early-return path), and
- restrict NFTA_FIB_F_PRESENT to NFT_FIB_RESULT_OIF and declare its destination as a single u8, so the marked span matches the one byte the eval writes.
--- net/ipv4/netfilter/nft_fib_ipv4.c | 2 +- net/ipv6/netfilter/nft_fib_ipv6.c | 2 +- net/netfilter/nft_fib.c | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-)
net/ipv4/netfilter/nft_fib_ipv4.c +1 -1
@@ -128,7 +128,7 @@ void nft_fib4_eval(const struct nft_expr fl4.saddr =get_saddr (iph->daddr); } - *dest =0 ; +nft_fib_store_result (dest, priv,NULL );if (fib_lookup (nft_net (pkt), &fl4, &res,FIB_LOOKUP_IGNORE_LINKSTATE ))return ;
net/ipv6/netfilter/nft_fib_ipv6.c +1 -1
@@ -192,7 +192,7 @@ void nft_fib6_eval(const struct nft_expr lookup_flags =nft_fib6_flowi_init (&fl6, priv, pkt, oif, iph); - *dest =0 ; +nft_fib_store_result (dest, priv,NULL ); rt = (void *)ip6_route_lookup (nft_net (pkt), &fl6, pkt->skb, lookup_flags);if (rt->dst.error)
net/netfilter/nft_fib.c +6 -0
@@ -107,6 +107,12 @@ int nft_fib_init(const struct nft_ctx *creturn -EINVAL ; } +if (priv->flags &NFTA_FIB_F_PRESENT ) { +if (priv->result !=NFT_FIB_RESULT_OIF ) +return -EINVAL ; + len =sizeof (u8); + } + err =nft_parse_register_store (ctx, tb[NFTA_FIB_DREG ], &priv->dreg,NULL ,NFT_DATA_VALUE , len);if (err <0 )
Greg Kroah-Hartman
maintainerPATCH 314/325 RDMA/umem: fix kernel-doc warnings
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Randy Dunlap <[email protected]>
[ Upstream commit ff46d1392750444fab5ae5a0194764ffdc4ac0d2 ]
Add or correct kernel-doc comments to eliminate warnings:
Warning: include/rdma/ib_umem.h:104 function parameter 'biter' not
described in 'rdma_umem_for_each_dma_block'
Warning: include/rdma/ib_umem.h:140 function parameter 'pgsz_bitmap' not
described in 'ib_umem_find_best_pgoff'
Warning: include/rdma/ib_umem.h:141 No description found for return
value of 'ib_umem_find_best_pgoff'
Stable-dep-of: 15fe76e23615 ("RDMA/umem: Fix truncation for block sizes >= 4G")
--- include/rdma/ib_umem.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
include/rdma/ib_umem.h +5 -1
@@ -94,6 +94,7 @@ static inline bool __rdma_umem_block_ite/** * rdma_umem_for_each_dma_block - iterate over contiguous DMA blocks of the umem * @umem: umem to iterate over +* @biter: block iterator variable * @pgsz: Page size to split the list into * * pgsz must be <= PAGE_SIZE or computed by ib_umem_find_best_pgsz(). The
@@ -121,7 +122,7 @@ unsigned long ib_umem_find_best_pgsz(str* ib_umem_find_best_pgoff - Find best HW page size * * @umem: umem struct -* @pgsz_bitmap bitmap of HW supported page sizes +* @pgsz_bitmap: bitmap of HW supported page sizes * @pgoff_bitmask: Mask of bits that can be represented with an offset * * This is very similar to ib_umem_find_best_pgsz() except instead of accepting
@@ -134,6 +135,9 @@ unsigned long ib_umem_find_best_pgsz(str* * If the pgoff_bitmask requires either alignment in the low bit or an * unavailable page size for the high bits, this function returns 0. +* +* Returns: best HW page size for the parameters or 0 if none available +* for the given parameters. */ static inline unsigned long ib_umem_find_best_pgoff(struct ib_umem *umem, unsigned long pgsz_bitmap,
Greg Kroah-Hartman
maintainerPATCH 315/325 RDMA: Move DMA block iterator logic into dedicated files
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Leon Romanovsky <[email protected]>
[ Upstream commit 6094ea64c69520ed1e770e7c79c43412de202bfa ]
The DMA iterator logic was mixed into verbs and umem-specific code, forcing all users to include rdma/ib_umem.h. Move the block iterator logic into iter.c and rdma/iter.h so that rdma/ib_umem.h and rdma/ib_verbs.h can be separated in a follow-up patch.
Stable-dep-of: 15fe76e23615 ("RDMA/umem: Fix truncation for block sizes >= 4G")
--- drivers/infiniband/core/Makefile | 2 drivers/infiniband/core/iter.c | 43 +++++++++++++ drivers/infiniband/core/verbs.c | 38 ----------- drivers/infiniband/hw/bnxt_re/qplib_res.c | 2 drivers/infiniband/hw/cxgb4/mem.c | 2 drivers/infiniband/hw/efa/efa_verbs.c | 2 drivers/infiniband/hw/erdma/erdma_verbs.c | 2 drivers/infiniband/hw/hns/hns_roce_alloc.c | 2 drivers/infiniband/hw/ionic/ionic_ibdev.h | 2 drivers/infiniband/hw/irdma/main.h | 2 drivers/infiniband/hw/mana/mana_ib.h | 2 drivers/infiniband/hw/mlx4/mr.c | 1 drivers/infiniband/hw/mlx5/mem.c | 1 drivers/infiniband/hw/mlx5/umr.c | 1 drivers/infiniband/hw/mthca/mthca_provider.c | 2 drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 2 drivers/infiniband/hw/qedr/verbs.c | 2 drivers/infiniband/hw/vmw_pvrdma/pvrdma.h | 2 include/rdma/ib_umem.h | 32 --------- include/rdma/ib_verbs.h | 48 -------------- include/rdma/iter.h | 88 +++++++++++++++++++++++++++ 21 files changed, 147 insertions(+), 131 deletions(-) create mode 100644 drivers/infiniband/core/iter.c create mode 100644 include/rdma/iter.h
drivers/infiniband/core/Makefile +1 -1
@@ -12,7 +12,7 @@ ib_core-y := packer.o ud_header.o verb roce_gid_mgmt.o mr_pool.o addr.o sa_query.o \ multicast.o mad.o smi.o agent.o mad_rmpp.o \ nldev.o restrack.o counters.o ib_core_uverbs.o \ - trace.o lag.o + trace.o lag.o iter.o ib_core-$(CONFIG_SECURITY_INFINIBAND) += security.o ib_core-$(CONFIG_CGROUP_RDMA) += cgroup.o
drivers/infiniband/core/iter.c new file +43 -0
43 lines not on this page · raw message
drivers/infiniband/core/verbs.c +0 -38
@@ -3096,44 +3096,6 @@ int rdma_init_netdev(struct ib_device *d }EXPORT_SYMBOL (rdma_init_netdev); -void __rdma_block_iter_start (struct ib_block_iter *biter, -struct scatterlist *sglist,unsigned int nents, -unsigned long pgsz) -{ -memset (biter,0 ,sizeof (struct ib_block_iter )); - biter->__sg = sglist; - biter->__sg_nents = nents; - -/* Driver provides best block size to use */ - biter->__pg_bit =__fls (pgsz); -} -EXPORT_SYMBOL (__rdma_block_iter_start); - -bool __rdma_block_iter_next (struct ib_block_iter *biter) -{ -unsigned int block_offset; -unsigned int delta; - -if (!biter->__sg_nents || !biter->__sg) -return false; - - biter->__dma_addr =sg_dma_address (biter->__sg) + biter->__sg_advance; - block_offset = biter->__dma_addr & (BIT_ULL (biter->__pg_bit) -1 ); - delta =BIT_ULL (biter->__pg_bit) - block_offset; - -while (biter->__sg_nents && biter->__sg && -sg_dma_len (biter->__sg) - biter->__sg_advance <= delta) { - delta -=sg_dma_len (biter->__sg) - biter->__sg_advance; - biter->__sg_advance =0 ; - biter->__sg =sg_next (biter->__sg); - biter->__sg_nents--; - } - biter->__sg_advance += delta; - -return true; -} -EXPORT_SYMBOL (__rdma_block_iter_next); -/** * rdma_alloc_hw_stats_struct - Helper function to allocate dynamic struct * for the drivers.
drivers/infiniband/hw/bnxt_re/qplib_res.c +1 -1
@@ -46,7 +46,7 @@#include <linux/if_vlan.h> #include <linux/vmalloc.h> #include <rdma/ib_verbs.h> -#include <rdma/ib_umem.h> +#include <rdma/iter.h> #include "roce_hsi.h" #include "qplib_res.h"
drivers/infiniband/hw/cxgb4/mem.c +1 -1
@@ -32,9 +32,9 @@#include <linux/module.h> #include <linux/moduleparam.h> -#include <rdma/ib_umem.h> #include <linux/atomic.h> #include <rdma/ib_user_verbs.h> +#include <rdma/iter.h> #include "iw_cxgb4.h"
drivers/infiniband/hw/efa/efa_verbs.c +1 -1
@@ -9,9 +9,9 @@#include <linux/log2.h> #include <rdma/ib_addr.h> -#include <rdma/ib_umem.h> #include <rdma/ib_user_verbs.h> #include <rdma/ib_verbs.h> +#include <rdma/iter.h> #include <rdma/uverbs_ioctl.h> #define UVERBS_MODULE_NAME efa_ib#include <rdma/uverbs_named_ioctl.h>
drivers/infiniband/hw/erdma/erdma_verbs.c +1 -1
@@ -12,7 +12,7 @@#include <linux/vmalloc.h> #include <net/addrconf.h> #include <rdma/erdma-abi.h> -#include <rdma/ib_umem.h> +#include <rdma/iter.h> #include <rdma/uverbs_ioctl.h> #include "erdma.h"
drivers/infiniband/hw/hns/hns_roce_alloc.c +1 -1
@@ -32,7 +32,7 @@*/ #include <linux/vmalloc.h> -#include <rdma/ib_umem.h> +#include <rdma/iter.h> #include "hns_roce_device.h" void hns_roce_buf_free (struct hns_roce_dev *hr_dev,struct hns_roce_buf *buf)
drivers/infiniband/hw/ionic/ionic_ibdev.h +1 -1
@@ -4,9 +4,9 @@#ifndef _IONIC_IBDEV_H_#define _IONIC_IBDEV_H_ -#include <rdma/ib_umem.h> #include <rdma/ib_verbs.h> #include <rdma/ib_pack.h> +#include <rdma/iter.h> #include <rdma/uverbs_ioctl.h> #include <rdma/ionic-abi.h>
drivers/infiniband/hw/irdma/main.h +1 -1
@@ -36,8 +36,8 @@#include <rdma/rdma_cm.h> #include <rdma/iw_cm.h> #include <rdma/ib_user_verbs.h> -#include <rdma/ib_umem.h> #include <rdma/ib_cache.h> +#include <rdma/iter.h> #include <rdma/uverbs_ioctl.h> #include "osdep.h" #include "defs.h"
drivers/infiniband/hw/mana/mana_ib.h +1 -1
@@ -8,7 +8,7 @@#include <rdma/ib_verbs.h> #include <rdma/ib_mad.h> -#include <rdma/ib_umem.h> +#include <rdma/iter.h> #include <rdma/mana-abi.h> #include <rdma/uverbs_ioctl.h> #include <linux/dmapool.h>
drivers/infiniband/hw/mlx4/mr.c +1 -0
@@ -33,6 +33,7 @@#include <linux/slab.h> #include <rdma/ib_user_verbs.h> +#include <rdma/iter.h> #include "mlx4_ib.h"
drivers/infiniband/hw/mlx5/mem.c +1 -0
@@ -31,6 +31,7 @@*/ #include <rdma/ib_umem_odp.h> +#include <rdma/iter.h> #include "mlx5_ib.h" /*
drivers/infiniband/hw/mlx5/umr.c +1 -0
@@ -2,6 +2,7 @@/* Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. */ #include <rdma/ib_umem_odp.h> +#include <rdma/iter.h> #include "mlx5_ib.h" #include "umr.h" #include "wr.h"
drivers/infiniband/hw/mthca/mthca_provider.c +1 -1
@@ -35,8 +35,8 @@*/ #include <rdma/ib_smi.h> -#include <rdma/ib_umem.h> #include <rdma/ib_user_verbs.h> +#include <rdma/iter.h> #include <rdma/uverbs_ioctl.h> #include <linux/sched.h>
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +1 -1
@@ -45,9 +45,9 @@#include <rdma/ib_verbs.h> #include <rdma/ib_user_verbs.h> #include <rdma/iw_cm.h> -#include <rdma/ib_umem.h> #include <rdma/ib_addr.h> #include <rdma/ib_cache.h> +#include <rdma/iter.h> #include <rdma/uverbs_ioctl.h> #include "ocrdma.h"
drivers/infiniband/hw/qedr/verbs.c +1 -1
@@ -39,9 +39,9 @@#include <rdma/ib_verbs.h> #include <rdma/ib_user_verbs.h> #include <rdma/iw_cm.h> -#include <rdma/ib_umem.h> #include <rdma/ib_addr.h> #include <rdma/ib_cache.h> +#include <rdma/iter.h> #include <rdma/uverbs_ioctl.h> #include <linux/qed/common_hsi.h>
drivers/infiniband/hw/vmw_pvrdma/pvrdma.h +1 -1
@@ -53,8 +53,8 @@#include <linux/pci.h> #include <linux/semaphore.h> #include <linux/workqueue.h> -#include <rdma/ib_umem.h> #include <rdma/ib_verbs.h> +#include <rdma/iter.h> #include <rdma/vmw_pvrdma-abi.h> #include "pvrdma_ring.h"
include/rdma/ib_umem.h +0 -32
@@ -75,38 +75,6 @@ static inline size_t ib_umem_num_pages(s {return ib_umem_num_dma_blocks (umem,PAGE_SIZE ); } - -static inline void __rdma_umem_block_iter_start (struct ib_block_iter *biter, -struct ib_umem *umem, -unsigned long pgsz) -{ -__rdma_block_iter_start (biter, umem->sgt_append.sgt.sgl, - umem->sgt_append.sgt.nents, pgsz); - biter->__sg_advance =ib_umem_offset (umem) & ~(pgsz -1 ); - biter->__sg_numblocks =ib_umem_num_dma_blocks (umem, pgsz); -} - -static inline bool __rdma_umem_block_iter_next (struct ib_block_iter *biter) -{ -return __rdma_block_iter_next (biter) && biter->__sg_numblocks--; -} - -/** -* rdma_umem_for_each_dma_block - iterate over contiguous DMA blocks of the umem -* @umem: umem to iterate over -* @biter: block iterator variable -* @pgsz: Page size to split the list into -* -* pgsz must be <= PAGE_SIZE or computed by ib_umem_find_best_pgsz(). The -* returned DMA blocks will be aligned to pgsz and span the range: -* ALIGN_DOWN(umem->address, pgsz) to ALIGN(umem->address + umem->length, pgsz) -* -* Performs exactly ib_umem_num_dma_blocks() iterations. -*/ -#define rdma_umem_for_each_dma_block (umem, biter, pgsz) \ - for (__rdma_umem_block_iter_start(biter, umem, pgsz); \ - __rdma_umem_block_iter_next(biter);) -#ifdef CONFIG_INFINIBAND_USER_MEM struct ib_umem *ib_umem_get(struct ib_device *device, unsigned long addr,
include/rdma/ib_verbs.h +0 -48
60 lines not on this page · raw message
include/rdma/iter.h new file +88 -0
88 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 316/325 RDMA/umem: Fix truncation for block sizes >= 4G
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jason Gunthorpe <[email protected]>
[ Upstream commit 15fe76e23615f502d051ef0768f86babaf08746c ]
When the iommu is used the linearization of the mapping can give a single block that is very large split across multiple SG entries.
When __rdma_block_iter_next() reassembles the split SG entries it is overflowing the 32 bit stack values and computed the wrong DMA addresses for blocks after the truncation.
Use the right types to hold DMA addresses.
--- drivers/infiniband/core/iter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/infiniband/core/iter.c +2 -2
@@ -19,8 +19,8 @@ EXPORT_SYMBOL(__rdma_block_iter_start);bool __rdma_block_iter_next (struct ib_block_iter *biter) { -unsigned int block_offset; -unsigned int delta; +dma_addr_t block_offset; +dma_addr_t delta;if (!biter->__sg_nents || !biter->__sg)return false;
Greg Kroah-Hartman
maintainerPATCH 317/325 ipvs: skip ipv6 extension headers for csum checks
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Julian Anastasov <[email protected]>
commit 05cfe9863ef049d98141dc2969eefde72fb07625 upstream.
Protocol checksum validation fails for IPv6 if there are extension headers before the protocol header. iph->len already contains its offset, so use it to fix the problem.
--- net/netfilter/ipvs/ip_vs_proto_sctp.c | 18 ++++++------------ net/netfilter/ipvs/ip_vs_proto_tcp.c | 21 +++++++-------------- net/netfilter/ipvs/ip_vs_proto_udp.c | 20 +++++++------------- 3 files changed, 20 insertions(+), 39 deletions(-)
net/netfilter/ipvs/ip_vs_proto_sctp.c +6 -12
@@ -10,7 +10,8 @@#include <net/ip_vs.h> static int -sctp_csum_check (int af,struct sk_buff *skb,struct ip_vs_protocol *pp); +sctp_csum_check (int af,struct sk_buff *skb,struct ip_vs_protocol *pp, +unsigned int sctphoff); static int sctp_conn_schedule(struct netns_ipvs *ipvs, int af, struct sk_buff *skb,
@@ -108,7 +109,7 @@ sctp_snat_handler(struct sk_buff *skb, sint ret;/* Some checks before mangling */ -if (!sctp_csum_check (cp->af, skb, pp)) +if (!sctp_csum_check (cp->af, skb, pp, sctphoff))return 0 ;/* Call application helper if needed */
@@ -156,7 +157,7 @@ sctp_dnat_handler(struct sk_buff *skb, sint ret;/* Some checks before mangling */ -if (!sctp_csum_check (cp->af, skb, pp)) +if (!sctp_csum_check (cp->af, skb, pp, sctphoff))return 0 ;/* Call application helper if needed */
@@ -185,19 +186,12 @@ sctp_dnat_handler(struct sk_buff *skb, s }static int -sctp_csum_check (int af,struct sk_buff *skb,struct ip_vs_protocol *pp) +sctp_csum_check (int af,struct sk_buff *skb,struct ip_vs_protocol *pp, +unsigned int sctphoff) { -unsigned int sctphoff;struct sctphdr *sh;__le32 cmp, val; -#ifdef CONFIG_IP_VS_IPV6 -if (af ==AF_INET6 ) - sctphoff =sizeof (struct ipv6hdr ); - else -#endif - sctphoff =ip_hdrlen (skb); - sh = (struct sctphdr *)(skb->data + sctphoff); cmp = sh->checksum; val =sctp_compute_cksum (skb, sctphoff);
net/netfilter/ipvs/ip_vs_proto_tcp.c +7 -14
@@ -29,7 +29,8 @@#include <net/ip_vs.h> static int -tcp_csum_check (int af,struct sk_buff *skb,struct ip_vs_protocol *pp); +tcp_csum_check (int af,struct sk_buff *skb,struct ip_vs_protocol *pp, +unsigned int tcphoff); static int tcp_conn_schedule(struct netns_ipvs *ipvs, int af, struct sk_buff *skb,
@@ -166,7 +167,7 @@ tcp_snat_handler(struct sk_buff *skb, stint ret;/* Some checks before mangling */ -if (!tcp_csum_check (cp->af, skb, pp)) +if (!tcp_csum_check (cp->af, skb, pp, tcphoff))return 0 ;/* Call application helper if needed */
@@ -244,7 +245,7 @@ tcp_dnat_handler(struct sk_buff *skb, stint ret;/* Some checks before mangling */ -if (!tcp_csum_check (cp->af, skb, pp)) +if (!tcp_csum_check (cp->af, skb, pp, tcphoff))return 0 ;/*
@@ -301,17 +302,9 @@ tcp_dnat_handler(struct sk_buff *skb, ststatic int -tcp_csum_check (int af,struct sk_buff *skb,struct ip_vs_protocol *pp) +tcp_csum_check (int af,struct sk_buff *skb,struct ip_vs_protocol *pp, +unsigned int tcphoff) { -unsigned int tcphoff; - -#ifdef CONFIG_IP_VS_IPV6 -if (af ==AF_INET6 ) - tcphoff =sizeof (struct ipv6hdr ); - else -#endif - tcphoff =ip_hdrlen (skb); -switch (skb->ip_summed) {case CHECKSUM_NONE : skb->csum =skb_checksum (skb, tcphoff, skb->len - tcphoff,0 );
@@ -322,7 +315,7 @@ tcp_csum_check(int af, struct sk_buff *sif (csum_ipv6_magic (&ipv6_hdr (skb)->saddr, &ipv6_hdr (skb)->daddr, skb->len - tcphoff, -ipv6_hdr (skb)->nexthdr, +IPPROTO_TCP , skb->csum)) {IP_VS_DBG_RL_PKT (0 , af, pp, skb,0 ,"Failed checksum for" );
net/netfilter/ipvs/ip_vs_proto_udp.c +7 -13
@@ -25,7 +25,8 @@#include <net/ip6_checksum.h> static int -udp_csum_check (int af,struct sk_buff *skb,struct ip_vs_protocol *pp); +udp_csum_check (int af,struct sk_buff *skb,struct ip_vs_protocol *pp, +unsigned int udphoff); static int udp_conn_schedule(struct netns_ipvs *ipvs, int af, struct sk_buff *skb,
@@ -155,7 +156,7 @@ udp_snat_handler(struct sk_buff *skb, stint ret;/* Some checks before mangling */ -if (!udp_csum_check (cp->af, skb, pp)) +if (!udp_csum_check (cp->af, skb, pp, udphoff))return 0 ;/*
@@ -238,7 +239,7 @@ udp_dnat_handler(struct sk_buff *skb, stint ret;/* Some checks before mangling */ -if (!udp_csum_check (cp->af, skb, pp)) +if (!udp_csum_check (cp->af, skb, pp, udphoff))return 0 ;/*
@@ -297,17 +298,10 @@ udp_dnat_handler(struct sk_buff *skb, ststatic int -udp_csum_check (int af,struct sk_buff *skb,struct ip_vs_protocol *pp) +udp_csum_check (int af,struct sk_buff *skb,struct ip_vs_protocol *pp, +unsigned int udphoff) {struct udphdr _udph, *uh; -unsigned int udphoff; - -#ifdef CONFIG_IP_VS_IPV6 -if (af ==AF_INET6 ) - udphoff =sizeof (struct ipv6hdr ); - else -#endif - udphoff =ip_hdrlen (skb); uh =skb_header_pointer (skb, udphoff,sizeof (_udph), &_udph);if (uh ==NULL )
@@ -325,7 +319,7 @@ udp_csum_check(int af, struct sk_buff *sif (csum_ipv6_magic (&ipv6_hdr (skb)->saddr, &ipv6_hdr (skb)->daddr, skb->len - udphoff, -ipv6_hdr (skb)->nexthdr, +IPPROTO_UDP , skb->csum)) {IP_VS_DBG_RL_PKT (0 , af, pp, skb,0 ,"Failed checksum for" );
Greg Kroah-Hartman
maintainerPATCH 318/325 vsock/virtio: fix potential unbounded skb queue
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
commit 059b7dbd20a6f0c539a45ddff1573cb8946685b5 upstream.
virtio_transport_inc_rx_pkt() checks vvs->rx_bytes + len > vvs->buf_alloc.
virtio_transport_recv_enqueue() skips coalescing for packets with VIRTIO_VSOCK_SEQ_EOM.
If fed with packets with len == 0 and VIRTIO_VSOCK_SEQ_EOM, a very large number of packets can be queued because vvs->rx_bytes stays at 0.
Fix this by estimating the skb metadata size:
(Number of skbs in the queue) * SKB_TRUESIZE(0)
--- net/vmw_vsock/virtio_transport_common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
net/vmw_vsock/virtio_transport_common.c +3 -1
@@ -425,7 +425,9 @@ static int virtio_transport_send_pkt_infstatic bool virtio_transport_inc_rx_pkt (struct virtio_vsock_sock *vvs,u32 len) { -if (vvs->buf_used + len > vvs->buf_alloc) +u64 skb_overhead = (skb_queue_len (&vvs->rx_queue) +1 ) *SKB_TRUESIZE (0 ); + +if (skb_overhead + vvs->buf_used + len > vvs->buf_alloc)return false; vvs->rx_bytes += len;
Greg Kroah-Hartman
maintainerPATCH 319/325 vsock/virtio: fix skb overhead accounting to preserve full buf_alloc
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefano Garzarella <[email protected]>
commit c6087c5aaad6d1b8be1a1a641e0a422218ade911 upstream.
After commit 059b7dbd20a6 ("vsock/virtio: fix potential unbounded skb queue"), virtio_transport_inc_rx_pkt() subtracts per-skb overhead from buf_alloc when checking whether a new packet fits. This reduces the effective receive buffer below what the user configured via SO_VM_SOCKETS_BUFFER_SIZE, causing legitimate data packets to be silently dropped and applications that rely on the full buffer size to deadlock.
Also, the reduced space is not communicated to the remote peer, so its credit calculation accounts more credit than the receiver will actually accept, causing data loss (there is no retransmission).
With this approach we currently have failures in tools/testing/vsock/vsock_test.c. Test 18 sometimes fails, while test 22 always fails in this way:
18 - SOCK_STREAM MSG_ZEROCOPY...hash mismatch
22 - SOCK_STREAM virtio credit update + SO_RCVLOWAT...send failed:
Resource temporarily unavailable
Fix by allowing at most buf_alloc * 2 as the total budget for payload plus skb overhead in virtio_transport_inc_rx_pkt(), similar to how SO_RCVBUF is doubled to reserve space for sk_buff metadata. This preserves the full buf_alloc for payload under normal operation, while still bounding the skb queue growth.
With this patch, all tests in tools/testing/vsock/vsock_test.c are now passing again.
--- net/vmw_vsock/virtio_transport_common.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
net/vmw_vsock/virtio_transport_common.c +8 -1
@@ -427,7 +427,14 @@ static bool virtio_transport_inc_rx_pkt( {u64 skb_overhead = (skb_queue_len (&vvs->rx_queue) +1 ) *SKB_TRUESIZE (0 ); -if (skb_overhead + vvs->buf_used + len > vvs->buf_alloc) +/* Allow at most buf_alloc * 2 total budget (payload + overhead), +* similar to how SO_RCVBUF is doubled to reserve space for sk_buff +* metadata. Check payload against buf_alloc to be sure the other +* peer is respecting the credit, and sk_buff overhead to bound +* queue growth. +*/ +if ((u64 )vvs->buf_used + len > vvs->buf_alloc || + skb_overhead > vvs->buf_alloc)return false; vvs->rx_bytes += len;
Greg Kroah-Hartman
maintainerPATCH 320/325 arm64: cputype: Add C1-Ultra definitions
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Rutland <[email protected]>
commit 60349e64a6c65f9f0aa118af711b3c7e137f07ff upstream.
Add cputype definitions for C1-Ultra. These will be used for errata detection in subsequent patches.
These values can be found in the C1-Ultra TRM:
https://developer.arm.com/documentation/108014/0100/
... in section A.5.1 ("MIDR_EL1, Main ID Register").
--- arch/arm64/include/asm/cputype.h | 2 ++ 1 file changed, 2 insertions(+)
arch/arm64/include/asm/cputype.h +2 -0
@@ -97,6 +97,7 @@#define ARM_CPU_PART_CORTEX_X925 0xD85#define ARM_CPU_PART_CORTEX_A725 0xD87#define ARM_CPU_PART_CORTEX_A720AE 0xD89 +#define ARM_CPU_PART_C1_ULTRA 0xD8C#define ARM_CPU_PART_NEOVERSE_N3 0xD8E#define ARM_CPU_PART_C1_PRO 0xD8B
@@ -189,6 +190,7 @@#define MIDR_CORTEX_X925 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_X925)#define MIDR_CORTEX_A725 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A725)#define MIDR_CORTEX_A720AE MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A720AE) +#define MIDR_C1_ULTRA MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_C1_ULTRA)#define MIDR_NEOVERSE_N3 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_NEOVERSE_N3)#define MIDR_C1_PRO MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_C1_PRO)#define MIDR_THUNDERX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX)
Greg Kroah-Hartman
maintainerPATCH 321/325 arm64: cputype: Add C1-Premium definitions
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Rutland <[email protected]>
commit d28413bfc5a255957241f1df5d7fd0c2cd74fe18 upstream.
Add cputype definitions for C1-Premium. These will be used for errata detection in subsequent patches.
These values can be found in the C1-Premium TRM:
https://developer.arm.com/documentation/109416/0100/
... in section A.5.1 ("MIDR_EL1, Main ID Register").
--- arch/arm64/include/asm/cputype.h | 2 ++ 1 file changed, 2 insertions(+)
arch/arm64/include/asm/cputype.h +2 -0
@@ -100,6 +100,7 @@#define ARM_CPU_PART_C1_ULTRA 0xD8C#define ARM_CPU_PART_NEOVERSE_N3 0xD8E#define ARM_CPU_PART_C1_PRO 0xD8B +#define ARM_CPU_PART_C1_PREMIUM 0xD90#define APM_CPU_PART_XGENE 0x000#define APM_CPU_VAR_POTENZA 0x00
@@ -193,6 +194,7 @@#define MIDR_C1_ULTRA MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_C1_ULTRA)#define MIDR_NEOVERSE_N3 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_NEOVERSE_N3)#define MIDR_C1_PRO MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_C1_PRO) +#define MIDR_C1_PREMIUM MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_C1_PREMIUM)#define MIDR_THUNDERX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX)#define MIDR_THUNDERX_81XX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX_81XX)#define MIDR_THUNDERX_83XX MIDR_CPU_MODEL(ARM_CPU_IMP_CAVIUM, CAVIUM_CPU_PART_THUNDERX_83XX)
Greg Kroah-Hartman
maintainerPATCH 322/325 arm64: errata: Mitigate TLBI errata on various Arm CPUs
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Rutland <[email protected]>
commit cfd391e74134db664feb499d43af286380b10ba8 upstream.
A number of CPUs developed by Arm suffer from errata whereby a broadcast TLBI;DSB sequence may complete before the global observation of writes which are translated by an affected TLB entry.
These errata ONLY affect the completion of memory accesses which have been translated by an invalidated TLB entry, and these errata DO NOT affect the actual invalidation of TLB entries. TLB entries are removed correctly.
This issue has been assigned CVE ID CVE-2025-10263.
To mitigate this issue, Arm recommends that software follows any affected TLBI;DSB sequence with an additional TLBI;DSB, which will ensure that all memory write effects affected by the first TLBI have been globally observed. The additional TLBI can use any operation that is broadcast to affected CPUs, and the additional DSB can use any option that is sufficient to complete the additional TLBI.
The ARM64_WORKAROUND_REPEAT_TLBI workaround is sufficient to mitigate the issue. Enable this workaround for affected CPUs, and update the silicon errata documentation accordingly.
Note that due to the manner in which Arm develops IP and tracks errata, some CPUs share a common erratum number.
--- Documentation/arch/arm64/silicon-errata.rst | 42 ++++++++++++++++++++++++++++ arch/arm64/Kconfig | 36 ++++++++++++++++++++++++ arch/arm64/kernel/cpu_errata.c | 32 ++++++++++++++++++++- 3 files changed, 108 insertions(+), 2 deletions(-)
Documentation/arch/arm64/silicon-errata.rst +42 -0
@@ -128,16 +128,28 @@ stable kernels. +----------------+-----------------+-----------------+-----------------------------+ | ARM | Cortex-A76 | #3324349 | ARM64_ERRATUM_3194386 | +----------------+-----------------+-----------------+-----------------------------+ +| ARM | Cortex-A76 | #4193800 | ARM64_ERRATUM_4118414 | ++----------------+-----------------+-----------------+-----------------------------+ +| ARM | Cortex-A76AE | #4193801 | ARM64_ERRATUM_4118414 | ++----------------+-----------------+-----------------+-----------------------------+ | ARM | Cortex-A77 | #1491015 | N/A | +----------------+-----------------+-----------------+-----------------------------+ | ARM | Cortex-A77 | #1508412 | ARM64_ERRATUM_1508412 | +----------------+-----------------+-----------------+-----------------------------+ | ARM | Cortex-A77 | #3324348 | ARM64_ERRATUM_3194386 | +----------------+-----------------+-----------------+-----------------------------+ +| ARM | Cortex-A77 | #4193798 | ARM64_ERRATUM_4118414 | ++----------------+-----------------+-----------------+-----------------------------+ | ARM | Cortex-A78 | #3324344 | ARM64_ERRATUM_3194386 | +----------------+-----------------+-----------------+-----------------------------+ +| ARM | Cortex-A78 | #4193791 | ARM64_ERRATUM_4118414 | ++----------------+-----------------+-----------------+-----------------------------+ +| ARM | Cortex-A78AE | #4193793 | ARM64_ERRATUM_4118414 | ++----------------+-----------------+-----------------+-----------------------------+ | ARM | Cortex-A78C | #3324346,3324347| ARM64_ERRATUM_3194386 | +----------------+-----------------+-----------------+-----------------------------+ +| ARM | Cortex-A78C | #4193794 | ARM64_ERRATUM_4118414 | ++----------------+-----------------+-----------------+-----------------------------+ | ARM | Cortex-A710 | #2119858 | ARM64_ERRATUM_2119858 | +----------------+-----------------+-----------------+-----------------------------+ | ARM | Cortex-A710 | #2054223 | ARM64_ERRATUM_2054223 |
@@ -146,6 +158,8 @@ stable kernels. +----------------+-----------------+-----------------+-----------------------------+ | ARM | Cortex-A710 | #3324338 | ARM64_ERRATUM_3194386 | +----------------+-----------------+-----------------+-----------------------------+ +| ARM | Cortex-A710 | #4193788 | ARM64_ERRATUM_4118414 | ++----------------+-----------------+-----------------+-----------------------------+ | ARM | Cortex-A715 | #2645198 | ARM64_ERRATUM_2645198 | +----------------+-----------------+-----------------+-----------------------------+ | ARM | Cortex-A715 | #3456084 | ARM64_ERRATUM_3194386 |
@@ -158,20 +172,32 @@ stable kernels. +----------------+-----------------+-----------------+-----------------------------+ | ARM | Cortex-X1 | #3324344 | ARM64_ERRATUM_3194386 | +----------------+-----------------+-----------------+-----------------------------+ +| ARM | Cortex-X1 | #4193791 | ARM64_ERRATUM_4118414 | ++----------------+-----------------+-----------------+-----------------------------+ | ARM | Cortex-X1C | #3324346 | ARM64_ERRATUM_3194386 | +----------------+-----------------+-----------------+-----------------------------+ +| ARM | Cortex-X1C | #4193792 | ARM64_ERRATUM_4118414 | ++----------------+-----------------+-----------------+-----------------------------+ | ARM | Cortex-X2 | #2119858 | ARM64_ERRATUM_2119858 | +----------------+-----------------+-----------------+-----------------------------+ | ARM | Cortex-X2 | #2224489 | ARM64_ERRATUM_2224489 | +----------------+-----------------+-----------------+-----------------------------+ | ARM | Cortex-X2 | #3324338 | ARM64_ERRATUM_3194386 | +----------------+-----------------+-----------------+-----------------------------+ +| ARM | Cortex-X2 | #4193788 | ARM64_ERRATUM_4118414 | ++----------------+-----------------+-----------------+-----------------------------+ | ARM | Cortex-X3 | #3324335 | ARM64_ERRATUM_3194386 | +----------------+-----------------+-----------------+-----------------------------+ +| ARM | Cortex-X3 | #4193786 | ARM64_ERRATUM_4118414 | ++----------------+-----------------+-----------------+-----------------------------+ | ARM | Cortex-X4 | #3194386 | ARM64_ERRATUM_3194386 | +----------------+-----------------+-----------------+-----------------------------+ +| ARM | Cortex-X4 | #4118414 | ARM64_ERRATUM_4118414 | ++----------------+-----------------+-----------------+-----------------------------+ | ARM | Cortex-X925 | #3324334 | ARM64_ERRATUM_3194386 | +----------------+-----------------+-----------------+-----------------------------+ +| ARM | Cortex-X925 | #4193781 | ARM64_ERRATUM_4118414 | ++----------------+-----------------+-----------------+-----------------------------+ | ARM | Neoverse-N1 | #1188873,1418040| ARM64_ERRATUM_1418040 | +----------------+-----------------+-----------------+-----------------------------+ | ARM | Neoverse-N1 | #1349291 | N/A |
@@ -182,6 +208,8 @@ stable kernels. +----------------+-----------------+-----------------+-----------------------------+ | ARM | Neoverse-N1 | #3324349 | ARM64_ERRATUM_3194386 | +----------------+-----------------+-----------------+-----------------------------+ +| ARM | Neoverse-N1 | #4193800 | ARM64_ERRATUM_4118414 | ++----------------+-----------------+-----------------+-----------------------------+ | ARM | Neoverse-N2 | #2139208 | ARM64_ERRATUM_2139208 | +----------------+-----------------+-----------------+-----------------------------+ | ARM | Neoverse-N2 | #2067961 | ARM64_ERRATUM_2067961 |
@@ -190,20 +218,34 @@ stable kernels. +----------------+-----------------+-----------------+-----------------------------+ | ARM | Neoverse-N2 | #3324339 | ARM64_ERRATUM_3194386 | +----------------+-----------------+-----------------+-----------------------------+ +| ARM | Neoverse-N2 | #4193789 | ARM64_ERRATUM_4118414 | ++----------------+-----------------+-----------------+-----------------------------+ | ARM | Neoverse-N3 | #3456111 | ARM64_ERRATUM_3194386 | +----------------+-----------------+-----------------+-----------------------------+ | ARM | Neoverse-V1 | #1619801 | N/A | +----------------+-----------------+-----------------+-----------------------------+ | ARM | Neoverse-V1 | #3324341 | ARM64_ERRATUM_3194386 | +----------------+-----------------+-----------------+-----------------------------+ +| ARM | Neoverse-V1 | #4193790 | ARM64_ERRATUM_4118414 | ++----------------+-----------------+-----------------+-----------------------------+ | ARM | Neoverse-V2 | #3324336 | ARM64_ERRATUM_3194386 | +----------------+-----------------+-----------------+-----------------------------+ +| ARM | Neoverse-V2 | #4193787 | ARM64_ERRATUM_4118414 | ++----------------+-----------------+-----------------+-----------------------------+ | ARM | Neoverse-V3 | #3312417 | ARM64_ERRATUM_3194386 | +----------------+-----------------+-----------------+-----------------------------+ +| ARM | Neoverse-V3 | #4193784 | ARM64_ERRATUM_4118414 | ++----------------+-----------------+-----------------+-----------------------------+ | ARM | Neoverse-V3AE | #3312417 | ARM64_ERRATUM_3194386 | +----------------+-----------------+-----------------+-----------------------------+ +| ARM | Neoverse-V3AE | #4193784 | ARM64_ERRATUM_4118414 | ++----------------+-----------------+-----------------+-----------------------------+ +| ARM | C1-Premium | #4193780 | ARM64_ERRATUM_4118414 | ++----------------+-----------------+-----------------+-----------------------------+ | ARM | C1-Pro | #4193714 | ARM64_ERRATUM_4193714 | +----------------+-----------------+-----------------+-----------------------------+ +| ARM | C1-Ultra | #4193780 | ARM64_ERRATUM_4118414 | ++----------------+-----------------+-----------------+-----------------------------+ | ARM | MMU-500 | #841119,826419 | ARM_SMMU_MMU_500_CPRE_ERRATA| | | | #562869,1047329 | | +----------------+-----------------+-----------------+-----------------------------+
arch/arm64/Kconfig +36 -0
@@ -1166,6 +1166,42 @@ config ARM64_ERRATUM_4193714 If unsure, say Y. +config ARM64_ERRATUM_4118414 + bool "Cortex-*/Neoverse-*/C1-*: Completion of affected memory accesses might not be guaranteed by completion of a TLBI" + default y + select ARM64_WORKAROUND_REPEAT_TLBI + help + This option adds a workaround for the following errata: + + * ARM C1-Premium erratum 4193780 + * ARM C1-Ultra erratum 4193780 + * ARM Cortex-A76 erratum 4193800 + * ARM Cortex-A76AE erratum 4193801 + * ARM Cortex-A77 erratum 4193798 + * ARM Cortex-A78 erratum 4193791 + * ARM Cortex-A78AE erratum 4193793 + * ARM Cortex-A78C erratum 4193794 + * ARM Cortex-A710 erratum 4193788 + * ARM Cortex-X1 erratum 4193791 + * ARM Cortex-X1C erratum 4193792 + * ARM Cortex-X2 erratum 4193788 + * ARM Cortex-X3 erratum 4193786 + * ARM Cortex-X4 erratum 4118414 + * ARM Cortex-X925 erratum 4193781 + * ARM Neoverse-N1 erratum 4193800 + * ARM Neoverse-N2 erratum 4193789 + * ARM Neoverse-V1 erratum 4193790 + * ARM Neoverse-V2 erratum 4193787 + * ARM Neoverse-V3 erratum 4193784 + * ARM Neoverse-V3AE erratum 4193784 + + On affected cores, some memory accesses might not be completed by + broadcast TLB invalidation. + + This issue is also known as CVE-2025-10263. + + If unsure, say Y. + config CAVIUM_ERRATUM_22375 bool "Cavium erratum 22375, 24313" default y
arch/arm64/kernel/cpu_errata.c +30 -2
@@ -316,7 +316,35 @@ static const struct arm64_cpu_capabiliti ERRATA_MIDR_RANGE(MIDR_CORTEX_A510, 0, 0, 1, 1), }, #endif - {}, +#ifdef CONFIG_ARM64_ERRATUM_4118414 + { + ERRATA_MIDR_RANGE_LIST(((const struct midr_range[]) { + MIDR_ALL_VERSIONS(MIDR_C1_PREMIUM), + MIDR_ALL_VERSIONS(MIDR_C1_ULTRA), + MIDR_ALL_VERSIONS(MIDR_CORTEX_A76), + MIDR_ALL_VERSIONS(MIDR_CORTEX_A76AE), + MIDR_ALL_VERSIONS(MIDR_CORTEX_A77), + MIDR_ALL_VERSIONS(MIDR_CORTEX_A78), + MIDR_ALL_VERSIONS(MIDR_CORTEX_A78AE), + MIDR_ALL_VERSIONS(MIDR_CORTEX_A78C), + MIDR_ALL_VERSIONS(MIDR_CORTEX_A710), + MIDR_ALL_VERSIONS(MIDR_CORTEX_X1), + MIDR_ALL_VERSIONS(MIDR_CORTEX_X1C), + MIDR_ALL_VERSIONS(MIDR_CORTEX_X2), + MIDR_ALL_VERSIONS(MIDR_CORTEX_X3), + MIDR_ALL_VERSIONS(MIDR_CORTEX_X4), + MIDR_ALL_VERSIONS(MIDR_CORTEX_X925), + MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N1), + MIDR_ALL_VERSIONS(MIDR_NEOVERSE_N2), + MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V1), + MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V2), + MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V3), + MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V3AE), + {} + })), + }, +#endif + {} }; #endif
@@ -669,7 +697,7 @@ const struct arm64_cpu_capabilities arm6#endif #ifdef CONFIG_ARM64_WORKAROUND_REPEAT_TLBI { - .desc = "Qualcomm erratum 1009, or ARM erratum 1286807, 2441009", + .desc = "Broken broadcast TLBI completion", .capability = ARM64_WORKAROUND_REPEAT_TLBI, .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM, .matches = cpucap_multi_entry_cap_matches,
Greg Kroah-Hartman
maintainerPATCH 323/325 arm64: errata: Mitigate TLBI errata on NVIDIA Olympus CPU
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shanker Donthineni <[email protected]>
commit ec7216f92e4ebd485b1c6dc6aa3f6064b71a5768 upstream.
NVIDIA Olympus cores are affected by the TLBI completion issue tracked as CVE-2025-10263. The existing ARM64_ERRATUM_4118414 handling already uses ARM64_WORKAROUND_REPEAT_TLBI to issue an additional broadcast TLBI;DSB sequence and ensure affected memory write effects are globally observed.
Add MIDR_NVIDIA_OLYMPUS to the repeat-TLBI match list so the same mitigation is enabled on affected Olympus systems. Also document the NVIDIA Olympus erratum in the arm64 silicon errata table and list it in the Kconfig help text.
--- Documentation/arch/arm64/silicon-errata.rst | 2 ++ arch/arm64/Kconfig | 3 ++- arch/arm64/kernel/cpu_errata.c | 1 + 3 files changed, 5 insertions(+), 1 deletion(-)
Documentation/arch/arm64/silicon-errata.rst +2 -0
@@ -288,6 +288,8 @@ stable kernels. +----------------+-----------------+-----------------+-----------------------------+ | NVIDIA | Carmel Core | N/A | NVIDIA_CARMEL_CNP_ERRATUM | +----------------+-----------------+-----------------+-----------------------------+ +| NVIDIA | Olympus core | T410-OLY-1029 | ARM64_ERRATUM_4118414 | ++----------------+-----------------+-----------------+-----------------------------+ | NVIDIA | T241 GICv3/4.x | T241-FABRIC-4 | N/A | +----------------+-----------------+-----------------+-----------------------------+ +----------------+-----------------+-----------------+-----------------------------+
arch/arm64/Kconfig +2 -1
@@ -1167,7 +1167,7 @@ config ARM64_ERRATUM_4193714 If unsure, say Y. config ARM64_ERRATUM_4118414 - bool "Cortex-*/Neoverse-*/C1-*: Completion of affected memory accesses might not be guaranteed by completion of a TLBI" + bool "Various: Completion of affected memory accesses might not be guaranteed by completion of a TLBI" default y select ARM64_WORKAROUND_REPEAT_TLBI help
@@ -1194,6 +1194,7 @@ config ARM64_ERRATUM_4118414 * ARM Neoverse-V2 erratum 4193787 * ARM Neoverse-V3 erratum 4193784 * ARM Neoverse-V3AE erratum 4193784 + * NVIDIA Olympus erratum T410-OLY-1029 On affected cores, some memory accesses might not be completed by broadcast TLB invalidation.
arch/arm64/kernel/cpu_errata.c +1 -0
@@ -340,6 +340,7 @@ static const struct arm64_cpu_capabilitiMIDR_ALL_VERSIONS (MIDR_NEOVERSE_V2 ),MIDR_ALL_VERSIONS (MIDR_NEOVERSE_V3 ),MIDR_ALL_VERSIONS (MIDR_NEOVERSE_V3AE ), + MIDR_ALL_VERSIONS(MIDR_NVIDIA_OLYMPUS), {} })), },
Greg Kroah-Hartman
maintainerPATCH 324/325 arm64: errata: Mitigate TLBI errata on Microsoft Azure Cobalt 100 CPU
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Will Deacon <[email protected]>
commit 1940e70a8144bf75e6df26bf6f600862ea7f7ea1 upstream.
Commit fb091ff39479 ("arm64: Subscribe Microsoft Azure Cobalt 100 to ARM Neoverse N2 errata") states that Microsoft Azure Cobalt 100 CPU "is a Microsoft implemented CPU based on r0p0 of the ARM Neoverse N2 CPU, and therefore suffers from all the same errata.".
So enable the workaround for the latest broadcast TLB invalidation bug on these parts.
--- Documentation/arch/arm64/silicon-errata.rst | 2 ++ arch/arm64/Kconfig | 1 + arch/arm64/kernel/cpu_errata.c | 1 + 3 files changed, 4 insertions(+)
Documentation/arch/arm64/silicon-errata.rst +2 -0
@@ -351,3 +351,5 @@ stable kernels. +----------------+-----------------+-----------------+-----------------------------+ | Microsoft | Azure Cobalt 100| #3324339 | ARM64_ERRATUM_3194386 | +----------------+-----------------+-----------------+-----------------------------+ +| Microsoft | Azure Cobalt 100| #4193789 | ARM64_ERRATUM_4118414 | ++----------------+-----------------+-----------------+-----------------------------+
arch/arm64/Kconfig +1 -0
@@ -1194,6 +1194,7 @@ config ARM64_ERRATUM_4118414 * ARM Neoverse-V2 erratum 4193787 * ARM Neoverse-V3 erratum 4193784 * ARM Neoverse-V3AE erratum 4193784 + * Microsoft Azure Cobalt 100 4193789 * NVIDIA Olympus erratum T410-OLY-1029 On affected cores, some memory accesses might not be completed by
arch/arm64/kernel/cpu_errata.c +1 -0
@@ -341,6 +341,7 @@ static const struct arm64_cpu_capabilitiMIDR_ALL_VERSIONS (MIDR_NEOVERSE_V3 ),MIDR_ALL_VERSIONS (MIDR_NEOVERSE_V3AE ),MIDR_ALL_VERSIONS (MIDR_NVIDIA_OLYMPUS ), + MIDR_ALL_VERSIONS(MIDR_MICROSOFT_AZURE_COBALT_100), {} })), },
Greg Kroah-Hartman
maintainerPATCH 325/325 block: fix handling of dead zone write plugs
In reply to Greg Kroah-Hartman6.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Damien Le Moal <[email protected]>
commit 836efd35c472d89c838d7b17ef339ddb3286ffc5 upstream.
Shin'ichiro reported hard to reproduce unaligned write errors with zoned block devices. Under normal operation conditions (e.g. running XFS on an SMR disk), these errors are nearly impossible to trigger. But using a "slow" kernel with many debug options enables and some specific use cases (e.g. fio zbd test case 46), the errors can be reproduced fairly easily.
The unaligned write errors come from mishandling a valid reference counting pattern of zone write plugs. Such pattern triggers for instance if a process A writes a zone (not necessarilly to the full state), another process B immediately resets the zone and immediately following the completion of the zone reset, starts issuing writes to the zone. With such pattern, in some cases, the zone write plugs worker thread of the device may still be holding a reference to the zone write plug of the zone taken when process A was writing to the zone. The following zone reset from process B marks the zone as dead but does not remove the zone write plug from the device hash table as a reference to the plug still exist. Once process B starts issuing new writes, the zone write plug is seen as dead and the writes from process B are immediately failed, despite this write pattern being perfectly legal.
Fix this by allowing restoring a dead zone write plug to a live state if a write is issued to the zone when the zone is: marked as dead, empty and the write sector corresponds to the first sector of the zone (that is, the write is aligned to the zone write pointer). This is done with the new helper function disk_check_zone_wplug_dead(), which restores a dead zone write plug to a live state by clearing the BLK_ZONE_WPLUG_DEAD flag and restoring the initial reference to the zone write plug taken when the plug was added to the device hash table.
--- block/blk-zoned.c | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-)
block/blk-zoned.c +27 -5
@@ -505,6 +505,28 @@ static void disk_mark_zone_wplug_dead(st } } +static inline bool disk_check_zone_wplug_dead (struct blk_zone_wplug *zwplug) +{ +if (!(zwplug->flags &BLK_ZONE_WPLUG_DEAD )) +return false; + +/* +* If a new write is received right after a zone reset completes and +* while the disk_zone_wplugs_worker() thread has not yet released the +* reference on the zone write plug after processing the last write to +* the zone, then the new write BIO will see the zone write plug marked +* as dead. This case is however a false positive and a perfectly valid +* pattern. In such case, restore the zone write plug to a live one. +*/ +if (!zwplug->wp_offset &&bio_list_empty (&zwplug->bio_list)) { + zwplug->flags &= ~BLK_ZONE_WPLUG_DEAD ; +refcount_inc (&zwplug->ref); +return false; + } + +return true; +} +static void blk_zone_wplug_bio_work (struct work_struct *work);/*
@@ -1027,12 +1049,12 @@ static bool blk_zone_wplug_handle_write( }/* -* If we got a zone write plug marked as dead, then the user is issuing -* writes to a full zone, or without synchronizing with zone reset or -* zone finish operations. In such case, fail the BIO to signal this -* invalid usage. +* Check if we got a zone write plug marked as dead. If yes, then the +* user is likely issuing writes to a full zone, or without +* synchronizing with zone reset or zone finish operations. In such +* case, fail the BIO to signal this invalid usage. */ -if (zwplug->flags &BLK_ZONE_WPLUG_DEAD ) { +if (disk_check_zone_wplug_dead (zwplug)) {spin_unlock_irqrestore (&zwplug->lock, flags);disk_put_zone_wplug (zwplug);bio_io_error (bio);
# Librecast Test Results
020/020 [ OK ] liblcrq
010/010 [ OK ] libmld
120/120 [ OK ] liblibrecast
CPU/kernel: Linux auntie 6.18.36-rc1-g1b6356bc9016 #1 SMP PREEMPT_DYNAMIC Tue Jun 16 16:02:41 -00 2026 x86_64 AMD Ryzen 9 9950X 16-Core Processor AuthenticAMD GNU/Linux
Quoted 7 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.18.36 release. There are 325 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu, 18 Jun 2026 14:49:57 +0000. Anything received after that time might be too late.
test_progs, test_progs-no_alu32, test_progs-cpuv4, test_maps, test_verifier in BPF selftests all passes[1] on x86_64.
1: https://github.com/shunghsiyu/libbpf/actions/runs/27647340765/job/81762433328
[...]
Build tested in our x86,arm64,loongarch,riscv config successfully without error.
BRs
Wentao Guan
defconfigs:
https://gist.github.com/opsiff/a840ae9e3d6857f5b7bacb9cdc49f8e9
Log:
Linux version 6.18.36-rc1-g1b6356bc9016 (guanwentao@uos-PC) (aarch64-linux-gnu-gcc-12 (Deepin 12.3.0-17deepin8) 12.3.0, GNU ld (GNU Binutils for Deepin) 2.41) # SMP PREEMPT_DYNAMIC Linux version 6.18.36-rc1-g1b6356bc9016 (guanwentao@uos-PC) (aarch64-linux-gnu-gcc-12 (Deepin 12.3.0-17deepin8) 12.3.0, GNU ld (GNU Binutils for Deepin) 2.41) #2 SMP PREEMPT_DYNAMIC Wed Jun 17 10:22:33 CST 2026 Linux version 6.18.36-rc1-g1b6356bc9016 (guanwentao@uos-PC) (loongarch64-linux-gnu-gcc-12 (Deepin 12.3.0-17deepin8) 12.3.0, GNU ld (GNU Binutils for Deepin) 2.41) # SMP PREEMPT_DYNAMIC Linux version 6.18.36-rc1-g1b6356bc9016 (guanwentao@uos-PC) (loongarch64-linux-gnu-gcc-12 (Deepin 12.3.0-17deepin8) 12.3.0, GNU ld (GNU Binutils for Deepin) 2.41) #3 SMP PREEMPT_DYNAMIC Wed Jun 17 10:45:35 CST 2026 Linux version 6.18.36-rc1+ (guanwentao@uos-PC) (riscv64-linux-gnu-gcc-12 (Deepin 12.3.0-17deepin8) 12.3.0, GNU ld (GNU Binutils for Deepin) 2.41) # SMP PREEMPT
Linux version 6.18.36-rc1+ (guanwentao@uos-PC) (riscv64-linux-gnu-gcc-12 (Deepin 12.3.0-17deepin8) 12.3.0, GNU ld (GNU Binutils for Deepin) 2.41) #4 SMP PREEMPT Wed Jun 17 11:02:54 CST 2026 Linux version 6.18.36-rc1-g1b6356bc9016 (guanwentao@uos-PC) (gcc (Deepin 12.3.0-17deepin15) 12.3.0, GNU ld (GNU Binutils for Deepin) 2.41) # SMP PREEMPT_DYNAMIC
Linux version 6.18.36-rc1-g1b6356bc9016 (guanwentao@uos-PC) (gcc (Deepin 12.3.0-17deepin15) 12.3.0, GNU ld (GNU Binutils for Deepin) 2.41) #1 SMP PREEMPT_DYNAMIC Wed Jun 17 09:57:57 CST 2026
Quoted 8 lines · On Tue, 16 Jun 2026 20:26:36 +0530 Greg Kroah-Hartman…
This is the start of the stable review cycle for the 6.18.36 release. There are 325 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu, 18 Jun 2026 14:49:57 +0000. Anything received after that time might be too late.
Boot-tested under QEMU for Rust x86_64, arm64 and riscv64; built-tested for loongarch64 and arm32:
Thanks!
Cheers,
Miguel
Quoted 4 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.18.36 release. There are 325 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.18.36 release. There are 325 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu, 18 Jun 2026 14:49:57 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.18.36-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.18.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
Am 16.06.2026 um 16:56 schrieb Greg Kroah-Hartman:
Quoted 4 lines
This is the start of the stable review cycle for the 6.18.36 release. There are 325 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Builds, boots and works on my 2-socket Ivy Bridge Xeon E5-2697 v2 server. No dmesg oddities or regressions found.
Beste Grüße,
Peter Schneider
Signature · 8 lines
Climb the mountain not to plant your flag, but to embrace the challenge, enjoy the air and behold the view. Climb it so you can see the world, not so the world can see you. -- David McCullough Jr. OpenPGP: 0xA3828BD796CCE11A8CADE8866E3A92C92C3FF244 Download: https://www.peters-netzplatz.de/download/pschneider1968_pub.asc https://keys.mailvelope.com/pks/lookup?op=get&[email protected] https://keys.mailvelope.com/pks/lookup?op=get&[email protected]
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.18.36 release. There are 325 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu, 18 Jun 2026 14:49:57 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.18.36-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.18.y
and the diffstat can be found below.thanks,
greg k-h
Built and booted successfully on RISC-V RV64 (HiFive Unmatched).
Hi!
Quoted 4 lines
This is the start of the stable review cycle for the 6.18.36 release. There are 325 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
CIP testing did not find any problems here:
https://gitlab.com/cip-project/cip-testing/linux-stable-rc-ci/-/tree/linux-6.18.y
Best regards,
Pavel
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.18.36 release. There are 325 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu, 18 Jun 2026 14:49:57 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.18.36-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.18.y
and the diffstat can be found below.thanks,
greg k-h
On ARCH_BRCMSTB using 32-bit and 64-bit ARM kernels, build tested on BMIPS_GENEIRC:
Signature · 1 line
Florian
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.18.36 release. There are 325 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Thu, 18 Jun 2026 14:49:57 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.18.36-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.18.y
and the diffstat can be found below.thanks,
greg k-h
FWIW now running on my laptop (t480s).
Willy