From 736e4317c76509d2ca1af233345826a4440f6313 Mon Sep 17 00:00:00 2001 From: HiGarfield Date: Fri, 10 Jan 2025 02:36:48 +0800 Subject: [PATCH] dawn: refresh patches --- ...ge-fix-use-after-free-compiler-error.patch | 27 +++++++++++++++++++ ...t-kick-if-data-rate-is-at-threshold.patch} | 9 ++----- ...datastorage-fix-a-use-after-free-bug.patch | 21 +++++++++++++++ 3 files changed, 50 insertions(+), 7 deletions(-) create mode 100644 package/extra/dawn/patches/0001-datastorage-fix-use-after-free-compiler-error.patch rename package/extra/dawn/patches/{0001-don-t-kick-if-data-rate-is-at-threshold.patch => 0002-don-t-kick-if-data-rate-is-at-threshold.patch} (80%) create mode 100644 package/extra/dawn/patches/0003-datastorage-fix-a-use-after-free-bug.patch diff --git a/package/extra/dawn/patches/0001-datastorage-fix-use-after-free-compiler-error.patch b/package/extra/dawn/patches/0001-datastorage-fix-use-after-free-compiler-error.patch new file mode 100644 index 000000000..3cb104c56 --- /dev/null +++ b/package/extra/dawn/patches/0001-datastorage-fix-use-after-free-compiler-error.patch @@ -0,0 +1,27 @@ +From 518ad70bd1340de7e63ae806524bfb1e5350959d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Martin=20Mat=C4=9Bjek?= +Date: Sun, 23 Oct 2022 22:05:48 +0200 +Subject: [PATCH 1/3] datastorage: fix use-after-free compiler error +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Closes: #198 + +Signed-off-by: Martin Matějek +--- + src/storage/datastorage.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/src/storage/datastorage.c ++++ b/src/storage/datastorage.c +@@ -1332,8 +1332,8 @@ void insert_macs_from_file() { + } + } + +- fclose(fp); + dawn_unregmem(fp); ++ fclose(fp); + if (line) + { + free(line); diff --git a/package/extra/dawn/patches/0001-don-t-kick-if-data-rate-is-at-threshold.patch b/package/extra/dawn/patches/0002-don-t-kick-if-data-rate-is-at-threshold.patch similarity index 80% rename from package/extra/dawn/patches/0001-don-t-kick-if-data-rate-is-at-threshold.patch rename to package/extra/dawn/patches/0002-don-t-kick-if-data-rate-is-at-threshold.patch index 44180956a..af8e84023 100644 --- a/package/extra/dawn/patches/0001-don-t-kick-if-data-rate-is-at-threshold.patch +++ b/package/extra/dawn/patches/0002-don-t-kick-if-data-rate-is-at-threshold.patch @@ -1,4 +1,4 @@ -From 734a2d650603c3f7a5c7ce2a1a5ac398ee20cf63 Mon Sep 17 00:00:00 2001 +From 1806e0fbc6f32d5db3c1efc357f870ad24c0e064 Mon Sep 17 00:00:00 2001 From: HarvsG <11440490+HarvsG@users.noreply.github.com> Date: Fri, 15 Sep 2023 11:00:05 +0100 Subject: [PATCH] don't kick if data rate is at threshold @@ -7,11 +7,9 @@ Subject: [PATCH] don't kick if data rate is at threshold src/storage/datastorage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/src/storage/datastorage.c b/src/storage/datastorage.c -index 7e6da46..655727a 100644 --- a/src/storage/datastorage.c +++ b/src/storage/datastorage.c -@@ -565,7 +565,7 @@ int kick_clients(struct dawn_mac bssid_mac, uint32_t id) { +@@ -565,7 +565,7 @@ int kick_clients(struct dawn_mac bssid_m // only use rx_rate for indicating if transmission is going on // <= 6MBits <- probably no transmission // tx_rate has always some weird value so don't use ist @@ -20,6 +18,3 @@ index 7e6da46..655727a 100644 dawnlog_info("Client " MACSTR ": Don't kick due to active data transfer: RX rate %f exceeds %d limit\n", MAC2STR(j->client_addr.u8), rx_rate, dawn_metric.bandwidth_threshold); } else --- -2.25.1 - diff --git a/package/extra/dawn/patches/0003-datastorage-fix-a-use-after-free-bug.patch b/package/extra/dawn/patches/0003-datastorage-fix-a-use-after-free-bug.patch new file mode 100644 index 000000000..05714861e --- /dev/null +++ b/package/extra/dawn/patches/0003-datastorage-fix-a-use-after-free-bug.patch @@ -0,0 +1,21 @@ +From 9f8fe0fb9cce6e24f8136e9569b34989195d83a7 Mon Sep 17 00:00:00 2001 +From: HiGarfield +Date: Fri, 10 Jan 2025 02:56:53 +0800 +Subject: [PATCH 3/3] datastorage: fix a use-after-free bug + +--- + src/storage/datastorage.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/src/storage/datastorage.c ++++ b/src/storage/datastorage.c +@@ -1336,8 +1336,8 @@ void insert_macs_from_file() { + fclose(fp); + if (line) + { +- free(line); + dawn_unregmem(line); ++ free(line); + } + + //exit(EXIT_SUCCESS);