kernel: xt_FLOWOFFLOAD: fix use of uninitialized dir variable
authorQingfang Deng <qingfang.deng@siflower.com.cn>
Wed, 13 Mar 2024 03:48:44 +0000 (11:48 +0800)
committerChuanhong Guo <gch981213@gmail.com>
Sat, 16 Mar 2024 07:30:03 +0000 (15:30 +0800)
The dir variable has been used uninitialized since the port to 5.10, and
somehow this remains undetected by GCC.

Fixes: b10d6044599d ("kernel: add linux 5.10 support")
Signed-off-by: Qingfang Deng <qingfang.deng@siflower.com.cn>
target/linux/generic/hack-5.15/650-netfilter-add-xt_FLOWOFFLOAD-target.patch
target/linux/generic/hack-6.1/650-netfilter-add-xt_FLOWOFFLOAD-target.patch
target/linux/generic/hack-6.6/650-netfilter-add-xt_FLOWOFFLOAD-target.patch

index da603344980cfab7172752988f476187609933a6..ec887539d5446f5762cbc2d9792951f84fbf27ed 100644 (file)
@@ -609,6 +609,8 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 +      if (!nf_ct_is_confirmed(ct))
 +              return XT_CONTINUE;
 +
++      dir = CTINFO2DIR(ctinfo);
++
 +      devs[dir] = xt_out(par);
 +      devs[!dir] = xt_in(par);
 +
@@ -618,8 +620,6 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 +      if (test_and_set_bit(IPS_OFFLOAD_BIT, &ct->status))
 +              return XT_CONTINUE;
 +
-+      dir = CTINFO2DIR(ctinfo);
-+
 +      if (xt_flowoffload_route(skb, ct, par, &route, dir, devs) < 0)
 +              goto err_flow_route;
 +
index 59a5fb4d9104607e6723a5e54cd0339b21b9ef55..1dfd556ce881df73ab8b2a68672d80bcc377281e 100644 (file)
@@ -547,6 +547,8 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 +      if (!nf_ct_is_confirmed(ct))
 +              return XT_CONTINUE;
 +
++      dir = CTINFO2DIR(ctinfo);
++
 +      devs[dir] = xt_out(par);
 +      devs[!dir] = xt_in(par);
 +
@@ -556,8 +558,6 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 +      if (test_and_set_bit(IPS_OFFLOAD_BIT, &ct->status))
 +              return XT_CONTINUE;
 +
-+      dir = CTINFO2DIR(ctinfo);
-+
 +      if (xt_flowoffload_route(skb, ct, par, &route, dir, devs) < 0)
 +              goto err_flow_route;
 +
index cb7ac007b11d12e45e5881af389d53f46d83b484..1c75a2cf3d24f9bcf4da0b13137dc549290d4f18 100644 (file)
@@ -547,6 +547,8 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 +      if (!nf_ct_is_confirmed(ct))
 +              return XT_CONTINUE;
 +
++      dir = CTINFO2DIR(ctinfo);
++
 +      devs[dir] = xt_out(par);
 +      devs[!dir] = xt_in(par);
 +
@@ -556,8 +558,6 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 +      if (test_and_set_bit(IPS_OFFLOAD_BIT, &ct->status))
 +              return XT_CONTINUE;
 +
-+      dir = CTINFO2DIR(ctinfo);
-+
 +      if (xt_flowoffload_route(skb, ct, par, &route, dir, devs) < 0)
 +              goto err_flow_route;
 +