nss-packages-breeze303/qca/qca-nss-ecm/patches/0010-frontends-drop-udp_get_timeouts-and-use-standard-ups.patch
Ansuel Smith 2a9e76182d qca-nss-ecm: bump to QSDK 12.0.5
qca-nss-ecm: avoid a memcpy overflow in ecm_db

Reference:
https://github.com/robimarko/nss-packages/pull/10/files

qca-nss-ecm: fix nf_ct_net null pointer reference

Fixed by xsm1997, massive thanks!
It fixes a null pointer access which is introduced in previous qca-nss-ecm patches.

Reference:
https://github.com/bitthief/openwrt/issues/9
2023-02-11 05:21:49 +02:00

74 lines
2.4 KiB
Diff

From ef638a84405c9f6556a9d7c257ccbba74efd228e Mon Sep 17 00:00:00 2001
From: Ansuel Smith <ansuelsmth@gmail.com>
Date: Sat, 14 May 2022 20:15:10 +0200
Subject: [PATCH 10/12] frontends: drop udp_get_timeouts and use standard
upstream api
Drop udp_get_timeouts and use nf_udp_pernet and ->timeouts
instead or relying on a downstream api not present upstream.
---
frontends/nss/ecm_nss_ipv4.c | 3 ++-
frontends/nss/ecm_nss_ipv6.c | 3 ++-
frontends/sfe/ecm_sfe_ipv4.c | 3 ++-
frontends/sfe/ecm_sfe_ipv6.c | 3 ++-
4 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/frontends/nss/ecm_nss_ipv4.c b/frontends/nss/ecm_nss_ipv4.c
index 719a747..558819a 100644
--- a/frontends/nss/ecm_nss_ipv4.c
+++ b/frontends/nss/ecm_nss_ipv4.c
@@ -607,7 +607,8 @@ sync_conntrack:
#else
timeouts = nf_ct_timeout_lookup(ct);
if (!timeouts) {
- timeouts = udp_get_timeouts(nf_ct_net(ct));
+ struct nf_udp_net *un = nf_udp_pernet(nf_ct_net(ct));
+ timeouts = un->timeouts;
}
spin_lock_bh(&ct->lock);
diff --git a/frontends/nss/ecm_nss_ipv6.c b/frontends/nss/ecm_nss_ipv6.c
index 67ee364..51eb069 100644
--- a/frontends/nss/ecm_nss_ipv6.c
+++ b/frontends/nss/ecm_nss_ipv6.c
@@ -586,7 +586,8 @@ sync_conntrack:
#else
timeouts = nf_ct_timeout_lookup(ct);
if (!timeouts) {
- timeouts = udp_get_timeouts(nf_ct_net(ct));
+ struct nf_udp_net *un = nf_udp_pernet(nf_ct_net(ct));
+ timeouts = un->timeouts;
}
spin_lock_bh(&ct->lock);
diff --git a/frontends/sfe/ecm_sfe_ipv4.c b/frontends/sfe/ecm_sfe_ipv4.c
index 3f30821..931af5d 100644
--- a/frontends/sfe/ecm_sfe_ipv4.c
+++ b/frontends/sfe/ecm_sfe_ipv4.c
@@ -527,7 +527,8 @@ sync_conntrack:
#else
timeouts = nf_ct_timeout_lookup(ct);
if (!timeouts) {
- timeouts = udp_get_timeouts(nf_ct_net(ct));
+ struct nf_udp_net *un = nf_udp_pernet(nf_ct_net(ct));
+ timeouts = un->timeouts;
}
spin_lock_bh(&ct->lock);
diff --git a/frontends/sfe/ecm_sfe_ipv6.c b/frontends/sfe/ecm_sfe_ipv6.c
index 54fdbf3..63d8888 100644
--- a/frontends/sfe/ecm_sfe_ipv6.c
+++ b/frontends/sfe/ecm_sfe_ipv6.c
@@ -516,7 +516,8 @@ sync_conntrack:
#else
timeouts = nf_ct_timeout_lookup(ct);
if (!timeouts) {
- timeouts = udp_get_timeouts(nf_ct_net(ct));
+ struct nf_udp_net *un = nf_udp_pernet(nf_ct_net(ct));
+ timeouts = un->timeouts;
}
spin_lock_bh(&ct->lock);
--
2.34.1