kernel_samsung_a53x/net/mptcp
Matthieu Baerts (NGI0) 4f36f19902 mptcp: fix sometimes-uninitialized warning
Nathan reported this issue:

  $ make -skj"$(nproc)" ARCH=x86_64 LLVM=1 LLVM_IAS=1 mrproper allmodconfig net/mptcp/subflow.o
  net/mptcp/subflow.c:877:6: warning: variable 'incr' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
    877 |         if (WARN_ON_ONCE(offset > skb->len))
        |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  include/asm-generic/bug.h:101:33: note: expanded from macro 'WARN_ON_ONCE'
    101 | #define WARN_ON_ONCE(condition) ({                              \
        |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    102 |         int __ret_warn_on = !!(condition);                      \
        |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    103 |         if (unlikely(__ret_warn_on))                            \
        |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    104 |                 __WARN_FLAGS(BUGFLAG_ONCE |                     \
        |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    105 |                              BUGFLAG_TAINT(TAINT_WARN));        \
        |                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    106 |         unlikely(__ret_warn_on);                                \
        |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    107 | })
        | ~~
  net/mptcp/subflow.c:893:6: note: uninitialized use occurs here
    893 |         if (incr)
        |             ^~~~
  net/mptcp/subflow.c:877:2: note: remove the 'if' if its condition is always false
    877 |         if (WARN_ON_ONCE(offset > skb->len))
        |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    878 |                 goto out;
        |                 ~~~~~~~~
  net/mptcp/subflow.c:874:18: note: initialize the variable 'incr' to silence this warning
    874 |         u32 offset, incr, avail_len;
        |                         ^
        |                          = 0
  1 warning generated.

As mentioned by Nathan, this issue is present because 5.10 does not
include commit ea4ca586b16f ("mptcp: refine MPTCP-level ack scheduling"),
which removed the use of 'incr' in the error path added by this change.
This other commit does not really look suitable for stable, hence this
dedicated patch for 5.10.

Fixes: e93fa44f0714 ("mptcp: fix duplicate data handling")
Reported-by: Nathan Chancellor <nathan@kernel.org>
Closes: https://lore.kernel.org/20240928175524.GA1713144@thelio-3990X
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-23 23:21:29 +01:00
..
crypto.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
crypto_test.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ctrl.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
diag.c mptcp: correct MPTCP_SUBFLOW_ATTR_SSN_OFFSET reserved size 2024-11-23 23:20:43 +01:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mib.c mptcp: mib: count MPJ with backup flag 2024-11-23 23:20:30 +01:00
mib.h mptcp: mib: count MPJ with backup flag 2024-11-23 23:20:30 +01:00
mptcp_diag.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
options.c mptcp: validate 'id' when stopping the ADD_ADDR retransmit timer 2024-11-23 23:21:16 +01:00
pm.c mptcp: pr_debug: add missing \n at the end 2024-11-23 23:21:01 +01:00
pm_netlink.c mptcp: pm: Fix uaf in __timer_delete_sync 2024-11-23 23:21:16 +01:00
protocol.c mptcp: pr_debug: add missing \n at the end 2024-11-23 23:21:01 +01:00
protocol.h mptcp: validate 'id' when stopping the ADD_ADDR retransmit timer 2024-11-23 23:21:16 +01:00
subflow.c mptcp: fix sometimes-uninitialized warning 2024-11-23 23:21:29 +01:00
syncookies.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
token.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
token_test.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00