From: Alexei Starovoitov Date: Tue, 15 Oct 2024 18:16:25 +0000 (-0700) Subject: Merge branch 'fix-truncation-bug-in-coerce_reg_to_size_sx-and-extend-selftests' X-Git-Tag: v6.12-rc4~18^2~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee230090f62fbb1c63c7f305d57289ab753221ef;p=thirdparty%2Fkernel%2Flinux.git Merge branch 'fix-truncation-bug-in-coerce_reg_to_size_sx-and-extend-selftests' Dimitar Kanaliev says: ==================== Fix truncation bug in coerce_reg_to_size_sx and extend selftests. This patch series addresses a truncation bug in the eBPF verifier function coerce_reg_to_size_sx(). The issue was caused by the incorrect ordering of assignments between 32-bit and 64-bit min/max values, leading to improper truncation when updating the register state. This issue has been reported previously by Zac Ecob[1] , but was not followed up on. The first patch fixes the assignment order in coerce_reg_to_size_sx() to ensure correct truncation. The subsequent patches add selftests for coerce_{reg,subreg}_to_size_sx. Changelog: v1 -> v2: - Moved selftests inside the conditional check for cpuv4 [1] (https://lore.kernel.org/bpf/h3qKLDEO6m9nhif0eAQX4fVrqdO0D_OPb0y5HfMK9jBePEKK33wQ3K-bqSVnr0hiZdFZtSJOsbNkcEQGpv_yJk61PAAiO8fUkgMRSO-lB50=@protonmail.com/) ==================== Link: https://lore.kernel.org/r/20241014121155.92887-1-dimitar.kanaliev@siteground.com Signed-off-by: Alexei Starovoitov --- ee230090f62fbb1c63c7f305d57289ab753221ef