Compare commits
99 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5e4533cdd4 | ||
|
|
9d401013fc | ||
|
|
e70772311d | ||
|
|
cdc2937edd | ||
|
|
f024b4c83d | ||
|
|
700f66ae95 | ||
|
|
c4a2e5102d | ||
|
|
61df1285ce | ||
|
|
51431de30d | ||
|
|
0880275d5e | ||
|
|
b2fba59f10 | ||
|
|
a2fe698a40 | ||
|
|
dff0b2104d | ||
|
|
3b8db97a52 | ||
|
|
96a87b90ef | ||
|
|
a857fc2ded | ||
|
|
31181fa062 | ||
|
|
9628612abe | ||
|
|
1737131c9d | ||
|
|
778243b3b4 | ||
|
|
d513f28351 | ||
|
|
6f1a71c2d0 | ||
|
|
491e839262 | ||
|
|
4acc0db480 | ||
|
|
3699327da3 | ||
|
|
45a2c0f309 | ||
|
|
e289a4133c | ||
|
|
a63edb4691 | ||
|
|
2698157d54 | ||
|
|
952bafa03c | ||
|
|
7e1db8f27c | ||
|
|
d32cf52674 | ||
|
|
745292ba10 | ||
|
|
5880dd48d5 | ||
|
|
90f6af5108 | ||
|
|
e545808e89 | ||
|
|
59e42f9e3e | ||
|
|
418cf097e7 | ||
|
|
6f677d6848 | ||
|
|
c5ed9f4344 | ||
|
|
556f86bbfd | ||
|
|
2d257351f3 | ||
|
|
2a22e41fe4 | ||
|
|
f9dec32be7 | ||
|
|
7393ce8d87 | ||
|
|
f6de1fa6c6 | ||
|
|
7ac6044632 | ||
|
|
9d1cd9d098 | ||
|
|
4b5c77ca2f | ||
|
|
73bba470a4 | ||
|
|
8bc800aa56 | ||
|
|
c948a74158 | ||
|
|
09d63fb0a6 | ||
|
|
564d81e944 | ||
|
|
5e3b21c916 | ||
|
|
2df2b75208 | ||
|
|
09bdc14419 | ||
|
|
e058fb3658 | ||
|
|
28dc34f249 | ||
|
|
24967a6c42 | ||
|
|
30815d65d2 | ||
|
|
dc2f2a16d3 | ||
|
|
c99ceb7030 | ||
|
|
89808e211c | ||
|
|
349714a491 | ||
|
|
0a4a82a431 | ||
|
|
8a83892662 | ||
|
|
0bce1d0db9 | ||
|
|
958411aa61 | ||
|
|
2807f84b62 | ||
|
|
7e4ce0c655 | ||
|
|
b7e7d220e7 | ||
|
|
df53824f46 | ||
|
|
76d1e8a0c2 | ||
|
|
ef9c13fb5d | ||
|
|
41e3f12e00 | ||
|
|
f51e2d031e | ||
|
|
95745e26b3 | ||
|
|
65a405382b | ||
|
|
a68be42f99 | ||
|
|
8231f67218 | ||
|
|
627bb0b8dc | ||
|
|
e6af9c017b | ||
|
|
33e7beeb31 | ||
|
|
687977bfc9 | ||
|
|
6ee6c97ded | ||
|
|
aced9de9a4 | ||
|
|
3bbd16da46 | ||
|
|
b84f761d91 | ||
|
|
f6429577c5 | ||
|
|
ef686b7292 | ||
|
|
3dc740257b | ||
|
|
a2c22b8776 | ||
|
|
d5ff0897cb | ||
|
|
18266fc6c0 | ||
|
|
5e771160b8 | ||
|
|
9c6fb1d67a | ||
|
|
6c1bef833d | ||
|
|
467adaf6c5 |
@@ -34,6 +34,10 @@ menu "Global build settings"
|
||||
bool "Cryptographically signed package lists"
|
||||
default y
|
||||
|
||||
config SIGNATURE_CHECK
|
||||
bool "Enable signature checking in opkg"
|
||||
default SIGNED_PACKAGES
|
||||
|
||||
comment "General build options"
|
||||
|
||||
config DISPLAY_SUPPORT
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
src-git packages https://git.openwrt.org/feed/packages.git^7879bbdb4ba35888c096a85367f98efbc617ebec
|
||||
src-git luci https://git.openwrt.org/project/luci.git^4d6d8bc5b0d7ee71c7b29b12e7e0c2e1e86cb268
|
||||
src-git routing https://git.openwrt.org/feed/routing.git^7589804a56baac804421b492c93004c28a627abb
|
||||
src-git telephony https://git.openwrt.org/feed/telephony.git^16bad9e04dcff392e9a92eea005127c06dfebd9c
|
||||
src-git packages https://git.openwrt.org/feed/packages.git^340d5ce71ee60c1d699e7e0ead9422bed6f8519f
|
||||
src-git luci https://git.openwrt.org/project/luci.git^bc17ef673f734ea8e7e696ba5735588da9111dcd
|
||||
src-git routing https://git.openwrt.org/feed/routing.git^c52779c05a4cf838c736327d8b042ee59f782331
|
||||
src-git telephony https://git.openwrt.org/feed/telephony.git^06a5323734038c3866f507787256581dba3d8522
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
LINUX_RELEASE?=1
|
||||
|
||||
LINUX_VERSION-4.9 = .182
|
||||
LINUX_VERSION-4.14 = .128
|
||||
LINUX_VERSION-4.9 = .198
|
||||
LINUX_VERSION-4.14 = .151
|
||||
|
||||
LINUX_KERNEL_HASH-4.9.182 = b16e12681a0638368479d73a9b1b8e9407c1ae4b7ae52fdf236d9e5657999695
|
||||
LINUX_KERNEL_HASH-4.14.128 = e93c2c754f1f9c610314b2fe9f27a9636ad3a7f43983469bb8e0f44a531f2913
|
||||
LINUX_KERNEL_HASH-4.9.198 = 9572ebfa6ba0efcf9f1ec7b62c7b89baa36a621ab9fd4c5ad025196c549605ac
|
||||
LINUX_KERNEL_HASH-4.14.151 = ff519c428ee9bbb513a84db5ec32a7e3705cd8c23a57104b25b944cb79583fae
|
||||
|
||||
remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))
|
||||
sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1)))))))
|
||||
|
||||
@@ -258,7 +258,11 @@ $(eval $(call nf_add,IPT_DEBUG,CONFIG_NETFILTER_XT_TARGET_TRACE, $(P_XT)xt_TRACE
|
||||
# tproxy
|
||||
|
||||
$(eval $(call nf_add,IPT_TPROXY,CONFIG_NETFILTER_XT_MATCH_SOCKET, $(P_XT)xt_socket))
|
||||
$(eval $(call nf_add,IPT_TPROXY,CONFIG_NF_SOCKET_IPV4, $(P_V4)nf_socket_ipv4, ge 4.10))
|
||||
$(eval $(call nf_add,IPT_TPROXY,CONFIG_NF_SOCKET_IPV6, $(P_V6)nf_socket_ipv6, ge 4.10))
|
||||
$(eval $(call nf_add,IPT_TPROXY,CONFIG_NETFILTER_XT_TARGET_TPROXY, $(P_XT)xt_TPROXY))
|
||||
$(eval $(call nf_add,IPT_TPROXY,CONFIG_NF_TPROXY_IPV4, $(P_V4)nf_tproxy_ipv4, ge 4.18))
|
||||
$(eval $(call nf_add,IPT_TPROXY,CONFIG_NF_TPROXY_IPV6, $(P_V6)nf_tproxy_ipv6, ge 4.18))
|
||||
|
||||
# led
|
||||
$(eval $(call nf_add,IPT_LED,CONFIG_NETFILTER_XT_TARGET_LED, $(P_XT)xt_LED))
|
||||
|
||||
@@ -26,13 +26,13 @@ PKG_CONFIG_DEPENDS += \
|
||||
sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1))))
|
||||
|
||||
VERSION_NUMBER:=$(call qstrip,$(CONFIG_VERSION_NUMBER))
|
||||
VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),18.06.3)
|
||||
VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),18.06.5)
|
||||
|
||||
VERSION_CODE:=$(call qstrip,$(CONFIG_VERSION_CODE))
|
||||
VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r7798-97ae9e0ccb)
|
||||
VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r7897-9d401013fc)
|
||||
|
||||
VERSION_REPO:=$(call qstrip,$(CONFIG_VERSION_REPO))
|
||||
VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),http://downloads.openwrt.org/releases/18.06.3)
|
||||
VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),http://downloads.openwrt.org/releases/18.06.5)
|
||||
|
||||
VERSION_DIST:=$(call qstrip,$(CONFIG_VERSION_DIST))
|
||||
VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),OpenWrt)
|
||||
|
||||
@@ -84,8 +84,12 @@ $(curdir)/index: FORCE
|
||||
mkdir -p $$d; \
|
||||
cd $$d || continue; \
|
||||
$(SCRIPT_DIR)/ipkg-make-index.sh . 2>&1 > Packages.manifest; \
|
||||
grep -vE '^(Maintainer|LicenseFiles|Source|Require)' Packages.manifest > Packages && \
|
||||
gzip -9nc Packages > Packages.gz; \
|
||||
grep -vE '^(Maintainer|LicenseFiles|Source|Require)' Packages.manifest > Packages; \
|
||||
case "$$(((64 + $$(stat -L -c%s Packages)) % 128))" in 110|111) \
|
||||
$(call ERROR_MESSAGE,WARNING: Applying padding in $$d/Packages to workaround usign SHA-512 bug!); \
|
||||
{ echo ""; echo ""; } >> Packages;; \
|
||||
esac; \
|
||||
gzip -9nc Packages > Packages.gz; \
|
||||
); done
|
||||
ifdef CONFIG_SIGNED_PACKAGES
|
||||
@echo Signing package index...
|
||||
|
||||
@@ -4,7 +4,7 @@ get_mac_binary() {
|
||||
local path="$1"
|
||||
local offset="$2"
|
||||
|
||||
if [ -z "$path" ]; then
|
||||
if ! [ -e "$path" ]; then
|
||||
echo "get_mac_binary: file $path not found!" >&2
|
||||
return
|
||||
fi
|
||||
|
||||
@@ -183,7 +183,7 @@ if VERSIONOPT
|
||||
config VERSION_REPO
|
||||
string
|
||||
prompt "Release repository"
|
||||
default "http://downloads.openwrt.org/releases/18.06.3"
|
||||
default "http://downloads.openwrt.org/releases/18.06.5"
|
||||
help
|
||||
This is the repository address embedded in the image, it defaults
|
||||
to the trunk snapshot repo; the url may contain the following placeholders:
|
||||
|
||||
@@ -554,6 +554,8 @@ define KernelPackage/ipt-tproxy
|
||||
TITLE:=Transparent proxying support
|
||||
DEPENDS+=+kmod-ipt-conntrack +IPV6:kmod-nf-conntrack6 +IPV6:kmod-ip6tables
|
||||
KCONFIG:= \
|
||||
CONFIG_NF_SOCKET_IPV4 \
|
||||
CONFIG_NF_SOCKET_IPV6 \
|
||||
CONFIG_NETFILTER_XT_MATCH_SOCKET \
|
||||
CONFIG_NETFILTER_XT_TARGET_TPROXY
|
||||
FILES:= \
|
||||
|
||||
@@ -852,6 +852,7 @@ define KernelPackage/usb-serial-wwan
|
||||
TITLE:=Support for GSM and CDMA modems
|
||||
KCONFIG:=CONFIG_USB_SERIAL_WWAN
|
||||
FILES:=$(LINUX_DIR)/drivers/usb/serial/usb_wwan.ko
|
||||
HIDDEN:=1
|
||||
AUTOLOAD:=$(call AutoProbe,usb_wwan)
|
||||
$(call AddDepends/usb-serial)
|
||||
endef
|
||||
@@ -865,11 +866,10 @@ $(eval $(call KernelPackage,usb-serial-wwan))
|
||||
|
||||
define KernelPackage/usb-serial-option
|
||||
TITLE:=Support for Option HSDPA modems
|
||||
DEPENDS:=+kmod-usb-serial-wwan
|
||||
KCONFIG:=CONFIG_USB_SERIAL_OPTION
|
||||
FILES:=$(LINUX_DIR)/drivers/usb/serial/option.ko
|
||||
AUTOLOAD:=$(call AutoProbe,option)
|
||||
$(call AddDepends/usb-serial)
|
||||
$(call AddDepends/usb-serial,+kmod-usb-serial-wwan)
|
||||
endef
|
||||
|
||||
define KernelPackage/usb-serial-option/description
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
From bbfab331e3abd9fa8767eea6bf5c4684cdd4b934 Mon Sep 17 00:00:00 2001
|
||||
From: Neo Jou <neojou@gmail.com>
|
||||
Date: Tue, 21 May 2019 17:12:20 +0800
|
||||
Subject: [PATCH] brcmfmac: use strlcpy() instead of strcpy()
|
||||
|
||||
The function strcpy() is inherently not safe. Though the function
|
||||
works without problems here, it would be better to use other safer
|
||||
function, e.g. strlcpy(), to replace strcpy() still.
|
||||
|
||||
Signed-off-by: Neo Jou <neojou@gmail.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
|
||||
@@ -269,7 +269,7 @@ int brcmf_c_preinit_dcmds(struct brcmf_i
|
||||
|
||||
/* query for 'ver' to get version info from firmware */
|
||||
memset(buf, 0, sizeof(buf));
|
||||
- strcpy(buf, "ver");
|
||||
+ strlcpy(buf, "ver", sizeof(buf));
|
||||
err = brcmf_fil_iovar_data_get(ifp, "ver", buf, sizeof(buf));
|
||||
if (err < 0) {
|
||||
bphy_err(drvr, "Retrieving version information failed, %d\n",
|
||||
@@ -0,0 +1,56 @@
|
||||
From f491645f039420fb7e14283e21b90772571c807c Mon Sep 17 00:00:00 2001
|
||||
From: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Date: Thu, 11 Jul 2019 10:45:30 +0200
|
||||
Subject: [PATCH] brcmfmac: add 160MHz in chandef_to_chanspec()
|
||||
|
||||
The function chandef_to_chanspec() was not handling 160MHz bandwidth
|
||||
resulting in wrong encoding of the channel. That resulting in firmware
|
||||
rejecting the provided channel specification.
|
||||
|
||||
Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
|
||||
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
|
||||
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
|
||||
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
.../broadcom/brcm80211/brcmfmac/cfg80211.c | 21 ++++++++++++++++++-
|
||||
1 file changed, 20 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
@@ -287,8 +287,26 @@ static u16 chandef_to_chanspec(struct br
|
||||
else
|
||||
ch_inf.sb = BRCMU_CHAN_SB_UU;
|
||||
break;
|
||||
- case NL80211_CHAN_WIDTH_80P80:
|
||||
case NL80211_CHAN_WIDTH_160:
|
||||
+ ch_inf.bw = BRCMU_CHAN_BW_160;
|
||||
+ if (primary_offset == -70)
|
||||
+ ch_inf.sb = BRCMU_CHAN_SB_LLL;
|
||||
+ else if (primary_offset == -50)
|
||||
+ ch_inf.sb = BRCMU_CHAN_SB_LLU;
|
||||
+ else if (primary_offset == -30)
|
||||
+ ch_inf.sb = BRCMU_CHAN_SB_LUL;
|
||||
+ else if (primary_offset == -10)
|
||||
+ ch_inf.sb = BRCMU_CHAN_SB_LUU;
|
||||
+ else if (primary_offset == 10)
|
||||
+ ch_inf.sb = BRCMU_CHAN_SB_ULL;
|
||||
+ else if (primary_offset == 30)
|
||||
+ ch_inf.sb = BRCMU_CHAN_SB_ULU;
|
||||
+ else if (primary_offset == 50)
|
||||
+ ch_inf.sb = BRCMU_CHAN_SB_UUL;
|
||||
+ else
|
||||
+ ch_inf.sb = BRCMU_CHAN_SB_UUU;
|
||||
+ break;
|
||||
+ case NL80211_CHAN_WIDTH_80P80:
|
||||
case NL80211_CHAN_WIDTH_5:
|
||||
case NL80211_CHAN_WIDTH_10:
|
||||
default:
|
||||
@@ -307,6 +325,7 @@ static u16 chandef_to_chanspec(struct br
|
||||
}
|
||||
d11inf->encchspec(&ch_inf);
|
||||
|
||||
+ brcmf_dbg(TRACE, "chanspec: 0x%x\n", ch_inf.chspec);
|
||||
return ch_inf.chspec;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,168 @@
|
||||
From a84a60ccdd65278485fb495f468a5ab91a75c649 Mon Sep 17 00:00:00 2001
|
||||
From: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Date: Thu, 11 Jul 2019 11:05:06 +0200
|
||||
Subject: [PATCH] Revert "brcmfmac: fix NULL pointer derefence during USB
|
||||
disconnect"
|
||||
|
||||
This reverts commit 5cdb0ef6144f47440850553579aa923c20a63f23. Subsequent
|
||||
changes make rework the driver code fixing the issue differently.
|
||||
|
||||
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
.../wireless/broadcom/brcm80211/brcmfmac/bcdc.c | 11 ++---------
|
||||
.../wireless/broadcom/brcm80211/brcmfmac/bcdc.h | 6 ++----
|
||||
.../wireless/broadcom/brcm80211/brcmfmac/core.c | 4 +---
|
||||
.../broadcom/brcm80211/brcmfmac/fwsignal.c | 16 ++++------------
|
||||
.../broadcom/brcm80211/brcmfmac/fwsignal.h | 3 +--
|
||||
.../wireless/broadcom/brcm80211/brcmfmac/proto.c | 10 ++--------
|
||||
.../wireless/broadcom/brcm80211/brcmfmac/proto.h | 3 +--
|
||||
7 files changed, 13 insertions(+), 40 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
|
||||
@@ -490,18 +490,11 @@ fail:
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
-void brcmf_proto_bcdc_detach_pre_delif(struct brcmf_pub *drvr)
|
||||
-{
|
||||
- struct brcmf_bcdc *bcdc = drvr->proto->pd;
|
||||
-
|
||||
- brcmf_fws_detach_pre_delif(bcdc->fws);
|
||||
-}
|
||||
-
|
||||
-void brcmf_proto_bcdc_detach_post_delif(struct brcmf_pub *drvr)
|
||||
+void brcmf_proto_bcdc_detach(struct brcmf_pub *drvr)
|
||||
{
|
||||
struct brcmf_bcdc *bcdc = drvr->proto->pd;
|
||||
|
||||
drvr->proto->pd = NULL;
|
||||
- brcmf_fws_detach_post_delif(bcdc->fws);
|
||||
+ brcmf_fws_detach(bcdc->fws);
|
||||
kfree(bcdc);
|
||||
}
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.h
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.h
|
||||
@@ -18,16 +18,14 @@
|
||||
|
||||
#ifdef CPTCFG_BRCMFMAC_PROTO_BCDC
|
||||
int brcmf_proto_bcdc_attach(struct brcmf_pub *drvr);
|
||||
-void brcmf_proto_bcdc_detach_pre_delif(struct brcmf_pub *drvr);
|
||||
-void brcmf_proto_bcdc_detach_post_delif(struct brcmf_pub *drvr);
|
||||
+void brcmf_proto_bcdc_detach(struct brcmf_pub *drvr);
|
||||
void brcmf_proto_bcdc_txflowblock(struct device *dev, bool state);
|
||||
void brcmf_proto_bcdc_txcomplete(struct device *dev, struct sk_buff *txp,
|
||||
bool success);
|
||||
struct brcmf_fws_info *drvr_to_fws(struct brcmf_pub *drvr);
|
||||
#else
|
||||
static inline int brcmf_proto_bcdc_attach(struct brcmf_pub *drvr) { return 0; }
|
||||
-static void brcmf_proto_bcdc_detach_pre_delif(struct brcmf_pub *drvr) {};
|
||||
-static inline void brcmf_proto_bcdc_detach_post_delif(struct brcmf_pub *drvr) {}
|
||||
+static inline void brcmf_proto_bcdc_detach(struct brcmf_pub *drvr) {}
|
||||
#endif
|
||||
|
||||
#endif /* BRCMFMAC_BCDC_H */
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
||||
@@ -1344,8 +1344,6 @@ void brcmf_detach(struct device *dev)
|
||||
|
||||
brcmf_bus_change_state(bus_if, BRCMF_BUS_DOWN);
|
||||
|
||||
- brcmf_proto_detach_pre_delif(drvr);
|
||||
-
|
||||
/* make sure primary interface removed last */
|
||||
for (i = BRCMF_MAX_IFS-1; i > -1; i--)
|
||||
brcmf_remove_interface(drvr->iflist[i], false);
|
||||
@@ -1355,7 +1353,7 @@ void brcmf_detach(struct device *dev)
|
||||
|
||||
brcmf_bus_stop(drvr->bus_if);
|
||||
|
||||
- brcmf_proto_detach_post_delif(drvr);
|
||||
+ brcmf_proto_detach(drvr);
|
||||
|
||||
bus_if->drvr = NULL;
|
||||
wiphy_free(drvr->wiphy);
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c
|
||||
@@ -2416,25 +2416,17 @@ struct brcmf_fws_info *brcmf_fws_attach(
|
||||
return fws;
|
||||
|
||||
fail:
|
||||
- brcmf_fws_detach_pre_delif(fws);
|
||||
- brcmf_fws_detach_post_delif(fws);
|
||||
+ brcmf_fws_detach(fws);
|
||||
return ERR_PTR(rc);
|
||||
}
|
||||
|
||||
-void brcmf_fws_detach_pre_delif(struct brcmf_fws_info *fws)
|
||||
+void brcmf_fws_detach(struct brcmf_fws_info *fws)
|
||||
{
|
||||
if (!fws)
|
||||
return;
|
||||
- if (fws->fws_wq) {
|
||||
- destroy_workqueue(fws->fws_wq);
|
||||
- fws->fws_wq = NULL;
|
||||
- }
|
||||
-}
|
||||
|
||||
-void brcmf_fws_detach_post_delif(struct brcmf_fws_info *fws)
|
||||
-{
|
||||
- if (!fws)
|
||||
- return;
|
||||
+ if (fws->fws_wq)
|
||||
+ destroy_workqueue(fws->fws_wq);
|
||||
|
||||
/* cleanup */
|
||||
brcmf_fws_lock(fws);
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.h
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.h
|
||||
@@ -19,8 +19,7 @@
|
||||
#define FWSIGNAL_H_
|
||||
|
||||
struct brcmf_fws_info *brcmf_fws_attach(struct brcmf_pub *drvr);
|
||||
-void brcmf_fws_detach_pre_delif(struct brcmf_fws_info *fws);
|
||||
-void brcmf_fws_detach_post_delif(struct brcmf_fws_info *fws);
|
||||
+void brcmf_fws_detach(struct brcmf_fws_info *fws);
|
||||
void brcmf_fws_debugfs_create(struct brcmf_pub *drvr);
|
||||
bool brcmf_fws_queue_skbs(struct brcmf_fws_info *fws);
|
||||
bool brcmf_fws_fc_active(struct brcmf_fws_info *fws);
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.c
|
||||
@@ -67,22 +67,16 @@ fail:
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
-void brcmf_proto_detach_post_delif(struct brcmf_pub *drvr)
|
||||
+void brcmf_proto_detach(struct brcmf_pub *drvr)
|
||||
{
|
||||
brcmf_dbg(TRACE, "Enter\n");
|
||||
|
||||
if (drvr->proto) {
|
||||
if (drvr->bus_if->proto_type == BRCMF_PROTO_BCDC)
|
||||
- brcmf_proto_bcdc_detach_post_delif(drvr);
|
||||
+ brcmf_proto_bcdc_detach(drvr);
|
||||
else if (drvr->bus_if->proto_type == BRCMF_PROTO_MSGBUF)
|
||||
brcmf_proto_msgbuf_detach(drvr);
|
||||
kfree(drvr->proto);
|
||||
drvr->proto = NULL;
|
||||
}
|
||||
}
|
||||
-
|
||||
-void brcmf_proto_detach_pre_delif(struct brcmf_pub *drvr)
|
||||
-{
|
||||
- if (drvr->proto && drvr->bus_if->proto_type == BRCMF_PROTO_BCDC)
|
||||
- brcmf_proto_bcdc_detach_pre_delif(drvr);
|
||||
-}
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.h
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.h
|
||||
@@ -54,8 +54,7 @@ struct brcmf_proto {
|
||||
|
||||
|
||||
int brcmf_proto_attach(struct brcmf_pub *drvr);
|
||||
-void brcmf_proto_detach_pre_delif(struct brcmf_pub *drvr);
|
||||
-void brcmf_proto_detach_post_delif(struct brcmf_pub *drvr);
|
||||
+void brcmf_proto_detach(struct brcmf_pub *drvr);
|
||||
|
||||
static inline int brcmf_proto_hdrpull(struct brcmf_pub *drvr, bool do_fws,
|
||||
struct sk_buff *skb,
|
||||
@@ -0,0 +1,67 @@
|
||||
From 14fcfd1cc0c05ea58f47dd693fdd13f25dfe995e Mon Sep 17 00:00:00 2001
|
||||
From: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Date: Thu, 11 Jul 2019 11:05:07 +0200
|
||||
Subject: [PATCH] brcmfmac: change the order of things in brcmf_detach()
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
When brcmf_detach() from the bus layer upon rmmod we can no longer
|
||||
communicate. Hence we will set the bus state to DOWN and cleanup
|
||||
the event and protocol layer. The network interfaces need to be
|
||||
deleted before brcmf_cfg80211_detach() because the latter does the
|
||||
wiphy_unregister() which issues a warning if there are still network
|
||||
devices linked to the wiphy instance.
|
||||
|
||||
Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
|
||||
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
|
||||
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
|
||||
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Tested-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
.../broadcom/brcm80211/brcmfmac/core.c | 27 ++++++++++---------
|
||||
1 file changed, 14 insertions(+), 13 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
||||
@@ -1337,25 +1337,26 @@ void brcmf_detach(struct device *dev)
|
||||
unregister_inet6addr_notifier(&drvr->inet6addr_notifier);
|
||||
#endif
|
||||
|
||||
- /* stop firmware event handling */
|
||||
- brcmf_fweh_detach(drvr);
|
||||
- if (drvr->config)
|
||||
- brcmf_p2p_detach(&drvr->config->p2p);
|
||||
-
|
||||
brcmf_bus_change_state(bus_if, BRCMF_BUS_DOWN);
|
||||
-
|
||||
- /* make sure primary interface removed last */
|
||||
- for (i = BRCMF_MAX_IFS-1; i > -1; i--)
|
||||
- brcmf_remove_interface(drvr->iflist[i], false);
|
||||
-
|
||||
- brcmf_cfg80211_detach(drvr->config);
|
||||
- drvr->config = NULL;
|
||||
-
|
||||
brcmf_bus_stop(drvr->bus_if);
|
||||
|
||||
+ brcmf_fweh_detach(drvr);
|
||||
brcmf_proto_detach(drvr);
|
||||
|
||||
+ /* make sure primary interface removed last */
|
||||
+ for (i = BRCMF_MAX_IFS - 1; i > -1; i--) {
|
||||
+ if (drvr->iflist[i])
|
||||
+ brcmf_del_if(drvr, drvr->iflist[i]->bsscfgidx, false);
|
||||
+ }
|
||||
+
|
||||
+ if (drvr->config) {
|
||||
+ brcmf_p2p_detach(&drvr->config->p2p);
|
||||
+ brcmf_cfg80211_detach(drvr->config);
|
||||
+ drvr->config = NULL;
|
||||
+ }
|
||||
+
|
||||
bus_if->drvr = NULL;
|
||||
+
|
||||
wiphy_free(drvr->wiphy);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
From c613085b74941024194e41b200601b9aa6ee388f Mon Sep 17 00:00:00 2001
|
||||
From: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Date: Thu, 11 Jul 2019 11:05:08 +0200
|
||||
Subject: [PATCH] brcmfmac: avoid firmware command in brcmf_netdev_open() when
|
||||
bus is down
|
||||
|
||||
No point in sending a firmware command when bus is down so make it
|
||||
conditional checking the state.
|
||||
|
||||
Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
|
||||
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
|
||||
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
|
||||
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
||||
@@ -589,7 +589,8 @@ static int brcmf_netdev_stop(struct net_
|
||||
|
||||
brcmf_cfg80211_down(ndev);
|
||||
|
||||
- brcmf_fil_iovar_data_set(ifp, "arp_hostip_clear", NULL, 0);
|
||||
+ if (ifp->drvr->bus_if->state == BRCMF_BUS_UP)
|
||||
+ brcmf_fil_iovar_data_set(ifp, "arp_hostip_clear", NULL, 0);
|
||||
|
||||
brcmf_net_setcarrier(ifp, false);
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
From c33330ac06fe863289643e7a13ecdb6a2502dad7 Mon Sep 17 00:00:00 2001
|
||||
From: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Date: Thu, 11 Jul 2019 11:05:09 +0200
|
||||
Subject: [PATCH] brcmfmac: clear events in brcmf_fweh_detach() will always
|
||||
fail
|
||||
|
||||
Clearing firmware events in brcmf_fweh_detach() is always failing
|
||||
because it is called only upon driver remove and communication
|
||||
with firmware is no longer possible.
|
||||
|
||||
Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
|
||||
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
|
||||
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
|
||||
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c | 9 ---------
|
||||
1 file changed, 9 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c
|
||||
@@ -314,16 +314,7 @@ void brcmf_fweh_attach(struct brcmf_pub
|
||||
void brcmf_fweh_detach(struct brcmf_pub *drvr)
|
||||
{
|
||||
struct brcmf_fweh_info *fweh = &drvr->fweh;
|
||||
- struct brcmf_if *ifp = brcmf_get_ifp(drvr, 0);
|
||||
- s8 eventmask[BRCMF_EVENTING_MASK_LEN];
|
||||
|
||||
- if (ifp) {
|
||||
- /* clear all events */
|
||||
- memset(eventmask, 0, BRCMF_EVENTING_MASK_LEN);
|
||||
- (void)brcmf_fil_iovar_data_set(ifp, "event_msgs",
|
||||
- eventmask,
|
||||
- BRCMF_EVENTING_MASK_LEN);
|
||||
- }
|
||||
/* cancel the worker */
|
||||
cancel_work_sync(&fweh->event_work);
|
||||
WARN_ON(!list_empty(&fweh->event_q));
|
||||
@@ -0,0 +1,79 @@
|
||||
From 1ac11ae949dd883854f4523ef8e3a32aabfd6256 Mon Sep 17 00:00:00 2001
|
||||
From: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Date: Thu, 11 Jul 2019 11:05:10 +0200
|
||||
Subject: [PATCH] brcmfmac: avoid firmware commands when bus is down
|
||||
|
||||
Upon rmmod a few attempts are made to inform firmware, but there is
|
||||
no point as the bus is down and these will fail. Avoid them to keep
|
||||
the logs clean.
|
||||
|
||||
Reported-by: Stefan Wahren <stefan.wahren@i2se.com>
|
||||
Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
|
||||
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
|
||||
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
|
||||
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
.../broadcom/brcm80211/brcmfmac/cfg80211.c | 23 +++++++++++--------
|
||||
1 file changed, 13 insertions(+), 10 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
@@ -1297,17 +1297,21 @@ static void brcmf_link_down(struct brcmf
|
||||
{
|
||||
struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(vif->wdev.wiphy);
|
||||
struct brcmf_pub *drvr = cfg->pub;
|
||||
+ bool bus_up = drvr->bus_if->state == BRCMF_BUS_UP;
|
||||
s32 err = 0;
|
||||
|
||||
brcmf_dbg(TRACE, "Enter\n");
|
||||
|
||||
if (test_and_clear_bit(BRCMF_VIF_STATUS_CONNECTED, &vif->sme_state)) {
|
||||
- brcmf_dbg(INFO, "Call WLC_DISASSOC to stop excess roaming\n ");
|
||||
- err = brcmf_fil_cmd_data_set(vif->ifp,
|
||||
- BRCMF_C_DISASSOC, NULL, 0);
|
||||
- if (err) {
|
||||
- bphy_err(drvr, "WLC_DISASSOC failed (%d)\n", err);
|
||||
+ if (bus_up) {
|
||||
+ brcmf_dbg(INFO, "Call WLC_DISASSOC to stop excess roaming\n");
|
||||
+ err = brcmf_fil_cmd_data_set(vif->ifp,
|
||||
+ BRCMF_C_DISASSOC, NULL, 0);
|
||||
+ if (err)
|
||||
+ bphy_err(drvr, "WLC_DISASSOC failed (%d)\n",
|
||||
+ err);
|
||||
}
|
||||
+
|
||||
if ((vif->wdev.iftype == NL80211_IFTYPE_STATION) ||
|
||||
(vif->wdev.iftype == NL80211_IFTYPE_P2P_CLIENT))
|
||||
cfg80211_disconnected(vif->wdev.netdev, reason, NULL, 0,
|
||||
@@ -1317,7 +1321,8 @@ static void brcmf_link_down(struct brcmf
|
||||
clear_bit(BRCMF_SCAN_STATUS_SUPPRESS, &cfg->scan_status);
|
||||
brcmf_btcoex_set_mode(vif, BRCMF_BTCOEX_ENABLED, 0);
|
||||
if (vif->profile.use_fwsup != BRCMF_PROFILE_FWSUP_NONE) {
|
||||
- brcmf_set_pmk(vif->ifp, NULL, 0);
|
||||
+ if (bus_up)
|
||||
+ brcmf_set_pmk(vif->ifp, NULL, 0);
|
||||
vif->profile.use_fwsup = BRCMF_PROFILE_FWSUP_NONE;
|
||||
}
|
||||
brcmf_dbg(TRACE, "Exit\n");
|
||||
@@ -5006,18 +5011,16 @@ static int brcmf_cfg80211_get_channel(st
|
||||
struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
|
||||
struct net_device *ndev = wdev->netdev;
|
||||
struct brcmf_pub *drvr = cfg->pub;
|
||||
- struct brcmf_if *ifp;
|
||||
struct brcmu_chan ch;
|
||||
enum nl80211_band band = 0;
|
||||
enum nl80211_chan_width width = 0;
|
||||
u32 chanspec;
|
||||
int freq, err;
|
||||
|
||||
- if (!ndev)
|
||||
+ if (!ndev || drvr->bus_if->state != BRCMF_BUS_UP)
|
||||
return -ENODEV;
|
||||
- ifp = netdev_priv(ndev);
|
||||
|
||||
- err = brcmf_fil_iovar_int_get(ifp, "chanspec", &chanspec);
|
||||
+ err = brcmf_fil_iovar_int_get(netdev_priv(ndev), "chanspec", &chanspec);
|
||||
if (err) {
|
||||
bphy_err(drvr, "chanspec failed (%d)\n", err);
|
||||
return err;
|
||||
@@ -0,0 +1,33 @@
|
||||
From e0bfb9601d4812719167cc4124a0d6db1e2f55e4 Mon Sep 17 00:00:00 2001
|
||||
From: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Date: Thu, 11 Jul 2019 11:05:11 +0200
|
||||
Subject: [PATCH] brcmfmac: simply remove flowring if bus is down
|
||||
|
||||
When the bus is down, eg. due to rmmod, there is no need to
|
||||
attempt to inform firmware about it.
|
||||
|
||||
Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
|
||||
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
|
||||
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
|
||||
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
|
||||
@@ -1408,6 +1408,13 @@ void brcmf_msgbuf_delete_flowring(struct
|
||||
u8 ifidx;
|
||||
int err;
|
||||
|
||||
+ /* no need to submit if firmware can not be reached */
|
||||
+ if (drvr->bus_if->state != BRCMF_BUS_UP) {
|
||||
+ brcmf_dbg(MSGBUF, "bus down, flowring will be removed\n");
|
||||
+ brcmf_msgbuf_remove_flowring(msgbuf, flowid);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
commonring = msgbuf->commonrings[BRCMF_H2D_MSGRING_CONTROL_SUBMIT];
|
||||
brcmf_commonring_lock(commonring);
|
||||
ret_ptr = brcmf_commonring_reserve_for_write(commonring);
|
||||
@@ -0,0 +1,28 @@
|
||||
From 4b11c915f00caeef3292ed0429acc579b9da762a Mon Sep 17 00:00:00 2001
|
||||
From: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Date: Thu, 11 Jul 2019 11:05:12 +0200
|
||||
Subject: [PATCH] brcmfmac: remove unnecessary strlcpy() upon obtaining "ver"
|
||||
iovar
|
||||
|
||||
Recently a strcpy() was replaced by strlcpy(). However, the strcpy()
|
||||
was not needed in the first place. So removing that line of code.
|
||||
|
||||
Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
|
||||
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
|
||||
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
|
||||
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
|
||||
@@ -269,7 +269,6 @@ int brcmf_c_preinit_dcmds(struct brcmf_i
|
||||
|
||||
/* query for 'ver' to get version info from firmware */
|
||||
memset(buf, 0, sizeof(buf));
|
||||
- strlcpy(buf, "ver", sizeof(buf));
|
||||
err = brcmf_fil_iovar_data_get(ifp, "ver", buf, sizeof(buf));
|
||||
if (err < 0) {
|
||||
bphy_err(drvr, "Retrieving version information failed, %d\n",
|
||||
@@ -0,0 +1,38 @@
|
||||
From e3b1d879ccda9ffd5332777bb1beeb2cc913faa8 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Sun, 21 Jul 2019 21:52:17 +0200
|
||||
Subject: [PATCH] brcmfmac: don't net_ratelimit() CONSOLE messages on firmware
|
||||
crash
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Firmware crash is a pretty rare event and can't happen too frequently as
|
||||
it has to be followed by a hardware reinitialization and config reload.
|
||||
It should be safe to don't use net_ratelimit() when it happens.
|
||||
|
||||
For reporting & debugging purposes it's important to provide a complete
|
||||
log as the last lines are actually the most important. This change
|
||||
modifies brcmfmac to print all messages in an unlimited way in that
|
||||
specific case. With this change there should be finally a backtrace of
|
||||
firmware finally visible after a crash.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
|
||||
@@ -804,7 +804,8 @@ static void brcmf_pcie_bus_console_read(
|
||||
if (ch == '\n') {
|
||||
console->log_str[console->log_idx] = 0;
|
||||
if (error)
|
||||
- brcmf_err(bus, "CONSOLE: %s", console->log_str);
|
||||
+ __brcmf_err(bus, __func__, "CONSOLE: %s",
|
||||
+ console->log_str);
|
||||
else
|
||||
pr_debug("CONSOLE: %s", console->log_str);
|
||||
console->log_idx = 0;
|
||||
@@ -0,0 +1,54 @@
|
||||
From cddecd92d1ec2fd05ed1123455e7c6cf6906b5a5 Mon Sep 17 00:00:00 2001
|
||||
From: YueHaibing <yuehaibing@huawei.com>
|
||||
Date: Wed, 24 Jul 2019 22:12:01 +0800
|
||||
Subject: [PATCH] brcmfmac: remove set but not used variable 'dtim_period'
|
||||
|
||||
Fixes gcc '-Wunused-but-set-variable' warning:
|
||||
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c: In function brcmf_update_bss_info:
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c:2962:5: warning: variable dtim_period set but not used [-Wunused-but-set-variable]
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c: In function brcmf_update_bss_info:
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c:2961:6: warning: variable beacon_interval set but not used [-Wunused-but-set-variable]
|
||||
|
||||
They are never used so can be removed.
|
||||
|
||||
Reported-by: Hulk Robot <hulkci@huawei.com>
|
||||
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
.../net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 8 +-------
|
||||
1 file changed, 1 insertion(+), 7 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
@@ -2985,8 +2985,6 @@ static s32 brcmf_update_bss_info(struct
|
||||
struct brcmf_pub *drvr = cfg->pub;
|
||||
struct brcmf_bss_info_le *bi;
|
||||
const struct brcmf_tlv *tim;
|
||||
- u16 beacon_interval;
|
||||
- u8 dtim_period;
|
||||
size_t ie_len;
|
||||
u8 *ie;
|
||||
s32 err = 0;
|
||||
@@ -3010,12 +3008,9 @@ static s32 brcmf_update_bss_info(struct
|
||||
|
||||
ie = ((u8 *)bi) + le16_to_cpu(bi->ie_offset);
|
||||
ie_len = le32_to_cpu(bi->ie_length);
|
||||
- beacon_interval = le16_to_cpu(bi->beacon_period);
|
||||
|
||||
tim = brcmf_parse_tlvs(ie, ie_len, WLAN_EID_TIM);
|
||||
- if (tim)
|
||||
- dtim_period = tim->data[1];
|
||||
- else {
|
||||
+ if (!tim) {
|
||||
/*
|
||||
* active scan was done so we could not get dtim
|
||||
* information out of probe response.
|
||||
@@ -3027,7 +3022,6 @@ static s32 brcmf_update_bss_info(struct
|
||||
bphy_err(drvr, "wl dtim_assoc failed (%d)\n", err);
|
||||
goto update_bss_info_out;
|
||||
}
|
||||
- dtim_period = (u8)var;
|
||||
}
|
||||
|
||||
update_bss_info_out:
|
||||
@@ -0,0 +1,26 @@
|
||||
From 73c742bb9c9ba30871fdd5c730d5ca8b6712833a Mon Sep 17 00:00:00 2001
|
||||
From: Colin Ian King <colin.king@canonical.com>
|
||||
Date: Fri, 9 Aug 2019 18:22:17 +0100
|
||||
Subject: [PATCH] brcmfmac: remove redundant assignment to pointer hash
|
||||
|
||||
The pointer hash is being initialized with a value that is never read
|
||||
and is being re-assigned a little later on. The assignment is
|
||||
redundant and hence can be removed.
|
||||
|
||||
Addresses-Coverity: ("Unused value")
|
||||
Signed-off-by: Colin Ian King <colin.king@canonical.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c
|
||||
@@ -1478,7 +1478,6 @@ static int brcmf_msgbuf_stats_read(struc
|
||||
seq_printf(seq, "\nh2d_flowrings: depth %u\n",
|
||||
BRCMF_H2D_TXFLOWRING_MAX_ITEM);
|
||||
seq_puts(seq, "Active flowrings:\n");
|
||||
- hash = msgbuf->flow->hash;
|
||||
for (i = 0; i < msgbuf->flow->nrofrings; i++) {
|
||||
if (!msgbuf->flow->rings[i])
|
||||
continue;
|
||||
@@ -0,0 +1,36 @@
|
||||
From 5f42b382ead278c1f6c3854765c97eb20491aa2a Mon Sep 17 00:00:00 2001
|
||||
From: Xulin Sun <xulin.sun@windriver.com>
|
||||
Date: Fri, 23 Aug 2019 15:47:08 +0800
|
||||
Subject: [PATCH] brcmfmac: replace strncpy() by strscpy()
|
||||
|
||||
The strncpy() may truncate the copied string,
|
||||
replace it by the safer strscpy().
|
||||
|
||||
To avoid below compile warning with gcc 8.2:
|
||||
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c:In function 'brcmf_vndr_ie':
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c:4227:2:
|
||||
warning: 'strncpy' output truncated before terminating nul copying 3 bytes from a string of the same length [-Wstringop-truncation]
|
||||
strncpy(iebuf, add_del_cmd, VNDR_IE_CMD_LEN - 1);
|
||||
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Signed-off-by: Xulin Sun <xulin.sun@windriver.com>
|
||||
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 4 +---
|
||||
1 file changed, 1 insertion(+), 3 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
@@ -4246,9 +4246,7 @@ next:
|
||||
static u32
|
||||
brcmf_vndr_ie(u8 *iebuf, s32 pktflag, u8 *ie_ptr, u32 ie_len, s8 *add_del_cmd)
|
||||
{
|
||||
-
|
||||
- strncpy(iebuf, add_del_cmd, VNDR_IE_CMD_LEN - 1);
|
||||
- iebuf[VNDR_IE_CMD_LEN - 1] = '\0';
|
||||
+ strscpy(iebuf, add_del_cmd, VNDR_IE_CMD_LEN);
|
||||
|
||||
put_unaligned_le32(1, &iebuf[VNDR_IE_COUNT_OFFSET]);
|
||||
|
||||
@@ -1,19 +1,29 @@
|
||||
From 82f93cf46d6007ffa003b2d4a2834563b6b84d21 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Subject: [PATCH] brcmfmac: get RAM info right before downloading PCIe firmware
|
||||
Date: Thu, 29 Aug 2019 10:27:01 +0200
|
||||
Subject: [PATCH] brcmfmac: get chip's default RAM info during PCIe setup
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
It's important as brcmf_chip_get_raminfo() also makes sure that memory
|
||||
is properly setup. Without it the firmware could report invalid RAM
|
||||
address like 0x04000001.
|
||||
Getting RAM info just once per driver's lifetime (during chip
|
||||
recognition) is not enough as it may get adjusted later (depending on
|
||||
the used firmware). Subsequent inits may load different firmwares so a
|
||||
full RAM recognition is required on every PCIe setup. This is especially
|
||||
important since implementing hardware reset on a firmware crash.
|
||||
|
||||
During a normal brcmfmac lifetime brcmf_chip_get_raminfo() is called on
|
||||
probe by the brcmf_chip_recognition(). This change allows implementing
|
||||
further improvements like handling errors by resetting a device with
|
||||
the brcmf_pcie_reset_device() and redownloading a firmware afterwards.
|
||||
Moreover calling brcmf_chip_get_raminfo() makes sure that RAM core is
|
||||
up. It's important as having BCMA_CORE_SYS_MEM down on BCM4366 was
|
||||
resulting in firmware failing to initialize and following error:
|
||||
[ 65.657546] brcmfmac 0000:01:00.0: brcmf_pcie_download_fw_nvram: Invalid shared RAM address 0x04000001
|
||||
|
||||
This change makes brcmf_chip_get_raminfo() call during chip recognition
|
||||
redundant for PCIe devices but SDIO and USB still need it and it's a
|
||||
very small overhead anyway.
|
||||
|
||||
Fixes: 4684997d9eea ("brcmfmac: reset PCIe bus on a firmware crash")
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.c | 6 ++++--
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/chip.h | 1 +
|
||||
@@ -55,7 +65,7 @@ Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
void brcmf_chip_detach(struct brcmf_chip *chip);
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
|
||||
@@ -1779,6 +1779,12 @@ static void brcmf_pcie_setup(struct devi
|
||||
@@ -1780,6 +1780,12 @@ static void brcmf_pcie_setup(struct devi
|
||||
nvram_len = fwreq->items[BRCMF_PCIE_FW_NVRAM].nv_data.len;
|
||||
kfree(fwreq);
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
From cb34212b1c25f7656a315f956d72696777e88340 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Sun, 1 Sep 2019 13:34:35 +0200
|
||||
Subject: [PATCH] brcmfmac: add stub version of brcmf_debugfs_get_devdir()
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
In case of compiling driver without DEBUG expose a stub function to make
|
||||
writing debug code much simpler (no extra conditions). This will allow
|
||||
e.g. using debugfs_create_file() without any magic if or #ifdef.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h
|
||||
@@ -132,6 +132,10 @@ int brcmf_debugfs_add_entry(struct brcmf
|
||||
int brcmf_debug_create_memdump(struct brcmf_bus *bus, const void *data,
|
||||
size_t len);
|
||||
#else
|
||||
+static inline struct dentry *brcmf_debugfs_get_devdir(struct brcmf_pub *drvr)
|
||||
+{
|
||||
+ return ERR_PTR(-ENOENT);
|
||||
+}
|
||||
static inline
|
||||
int brcmf_debugfs_add_entry(struct brcmf_pub *drvr, const char *fn,
|
||||
int (*read_fn)(struct seq_file *seq, void *data))
|
||||
@@ -0,0 +1,59 @@
|
||||
From 2f8c8e62cd50d72ac68de884a09c6f5a969a269c Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Sun, 1 Sep 2019 13:34:36 +0200
|
||||
Subject: [PATCH] brcmfmac: add "reset" debugfs entry for testing reset
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This is a trivial debugfs entry for triggering reset just like in case
|
||||
of firmware crash. It works by writing 1 to it:
|
||||
echo 1 > reset
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
.../broadcom/brcm80211/brcmfmac/core.c | 25 +++++++++++++++++++
|
||||
1 file changed, 25 insertions(+)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
||||
@@ -1117,6 +1117,29 @@ static void brcmf_core_bus_reset(struct
|
||||
brcmf_bus_reset(drvr->bus_if);
|
||||
}
|
||||
|
||||
+static ssize_t bus_reset_write(struct file *file, const char __user *user_buf,
|
||||
+ size_t count, loff_t *ppos)
|
||||
+{
|
||||
+ struct brcmf_pub *drvr = file->private_data;
|
||||
+ u8 value;
|
||||
+
|
||||
+ if (kstrtou8_from_user(user_buf, count, 0, &value))
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ if (value != 1)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ schedule_work(&drvr->bus_reset);
|
||||
+
|
||||
+ return count;
|
||||
+}
|
||||
+
|
||||
+static const struct file_operations bus_reset_fops = {
|
||||
+ .open = simple_open,
|
||||
+ .llseek = no_llseek,
|
||||
+ .write = bus_reset_write,
|
||||
+};
|
||||
+
|
||||
static int brcmf_bus_started(struct brcmf_pub *drvr, struct cfg80211_ops *ops)
|
||||
{
|
||||
int ret = -1;
|
||||
@@ -1192,6 +1215,8 @@ static int brcmf_bus_started(struct brcm
|
||||
|
||||
/* populate debugfs */
|
||||
brcmf_debugfs_add_entry(drvr, "revinfo", brcmf_revinfo_read);
|
||||
+ debugfs_create_file("reset", 0600, brcmf_debugfs_get_devdir(drvr), drvr,
|
||||
+ &bus_reset_fops);
|
||||
brcmf_feat_debugfs_create(drvr);
|
||||
brcmf_proto_debugfs_create(drvr);
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
From 0e48b86d9a8f5c695bb02c9c02f6dc7d2ec8f2e2 Mon Sep 17 00:00:00 2001
|
||||
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
|
||||
Date: Wed, 4 Sep 2019 20:50:52 +0300
|
||||
Subject: [PATCH] brcmfmac: use %*ph to print small buffer
|
||||
|
||||
Use %*ph format to print small buffer as hex string.
|
||||
|
||||
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
.../broadcom/brcm80211/brcmfmac/cfg80211.c | 18 ++++++------------
|
||||
1 file changed, 6 insertions(+), 12 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
@@ -4224,10 +4224,8 @@ brcmf_parse_vndr_ies(const u8 *vndr_ie_b
|
||||
|
||||
vndr_ies->count++;
|
||||
|
||||
- brcmf_dbg(TRACE, "** OUI %02x %02x %02x, type 0x%02x\n",
|
||||
- parsed_info->vndrie.oui[0],
|
||||
- parsed_info->vndrie.oui[1],
|
||||
- parsed_info->vndrie.oui[2],
|
||||
+ brcmf_dbg(TRACE, "** OUI %3ph, type 0x%02x\n",
|
||||
+ parsed_info->vndrie.oui,
|
||||
parsed_info->vndrie.oui_type);
|
||||
|
||||
if (vndr_ies->count >= VNDR_IE_PARSE_LIMIT)
|
||||
@@ -4351,12 +4349,10 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c
|
||||
for (i = 0; i < old_vndr_ies.count; i++) {
|
||||
vndrie_info = &old_vndr_ies.ie_info[i];
|
||||
|
||||
- brcmf_dbg(TRACE, "DEL ID : %d, Len: %d , OUI:%02x:%02x:%02x\n",
|
||||
+ brcmf_dbg(TRACE, "DEL ID : %d, Len: %d , OUI:%3ph\n",
|
||||
vndrie_info->vndrie.id,
|
||||
vndrie_info->vndrie.len,
|
||||
- vndrie_info->vndrie.oui[0],
|
||||
- vndrie_info->vndrie.oui[1],
|
||||
- vndrie_info->vndrie.oui[2]);
|
||||
+ vndrie_info->vndrie.oui);
|
||||
|
||||
del_add_ie_buf_len = brcmf_vndr_ie(curr_ie_buf, pktflag,
|
||||
vndrie_info->ie_ptr,
|
||||
@@ -4388,12 +4384,10 @@ s32 brcmf_vif_set_mgmt_ie(struct brcmf_c
|
||||
remained_buf_len -= (vndrie_info->ie_len +
|
||||
VNDR_IE_VSIE_OFFSET);
|
||||
|
||||
- brcmf_dbg(TRACE, "ADDED ID : %d, Len: %d, OUI:%02x:%02x:%02x\n",
|
||||
+ brcmf_dbg(TRACE, "ADDED ID : %d, Len: %d, OUI:%3ph\n",
|
||||
vndrie_info->vndrie.id,
|
||||
vndrie_info->vndrie.len,
|
||||
- vndrie_info->vndrie.oui[0],
|
||||
- vndrie_info->vndrie.oui[1],
|
||||
- vndrie_info->vndrie.oui[2]);
|
||||
+ vndrie_info->vndrie.oui);
|
||||
|
||||
del_add_ie_buf_len = brcmf_vndr_ie(curr_ie_buf, pktflag,
|
||||
vndrie_info->ie_ptr,
|
||||
@@ -0,0 +1,95 @@
|
||||
From ba76ff25ee64d5cfc86209d1fbb3c294b2c04412 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Tue, 3 Sep 2019 06:29:26 +0200
|
||||
Subject: [PATCH 1/3] brcmfmac: move "cfg80211_ops" pointer to another struct
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This moves "ops" pointer from "struct brcmf_cfg80211_info" to the
|
||||
"struct brcmf_pub". This movement makes it possible to allocate wiphy
|
||||
without attaching cfg80211 (brcmf_cfg80211_attach()). It's required for
|
||||
later separation of wiphy allocation and driver initialization.
|
||||
|
||||
While at it fix also an unlikely memory leak in the brcmf_attach().
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
.../net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 1 -
|
||||
.../net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h | 1 -
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c | 9 ++++++---
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h | 1 +
|
||||
4 files changed, 7 insertions(+), 5 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
@@ -7186,7 +7186,6 @@ void brcmf_cfg80211_detach(struct brcmf_
|
||||
brcmf_pno_detach(cfg);
|
||||
brcmf_btcoex_detach(cfg);
|
||||
wiphy_unregister(cfg->wiphy);
|
||||
- kfree(cfg->ops);
|
||||
wl_deinit_priv(cfg);
|
||||
brcmf_free_wiphy(cfg->wiphy);
|
||||
kfree(cfg);
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h
|
||||
@@ -303,7 +303,6 @@ struct brcmf_cfg80211_wowl {
|
||||
*/
|
||||
struct brcmf_cfg80211_info {
|
||||
struct wiphy *wiphy;
|
||||
- struct cfg80211_ops *ops;
|
||||
struct brcmf_cfg80211_conf *conf;
|
||||
struct brcmf_p2p_info p2p;
|
||||
struct brcmf_btcoex_info *btcoex;
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
||||
@@ -1254,12 +1254,15 @@ int brcmf_attach(struct device *dev, str
|
||||
return -ENOMEM;
|
||||
|
||||
wiphy = wiphy_new(ops, sizeof(*drvr));
|
||||
- if (!wiphy)
|
||||
+ if (!wiphy) {
|
||||
+ kfree(ops);
|
||||
return -ENOMEM;
|
||||
+ }
|
||||
|
||||
set_wiphy_dev(wiphy, dev);
|
||||
drvr = wiphy_priv(wiphy);
|
||||
drvr->wiphy = wiphy;
|
||||
+ drvr->ops = ops;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(drvr->if2bss); i++)
|
||||
drvr->if2bss[i] = BRCMF_BSSIDX_INVALID;
|
||||
@@ -1292,12 +1295,10 @@ int brcmf_attach(struct device *dev, str
|
||||
goto fail;
|
||||
}
|
||||
|
||||
- drvr->config->ops = ops;
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
brcmf_detach(dev);
|
||||
- kfree(ops);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -1383,6 +1384,8 @@ void brcmf_detach(struct device *dev)
|
||||
|
||||
bus_if->drvr = NULL;
|
||||
|
||||
+ kfree(drvr->ops);
|
||||
+
|
||||
wiphy_free(drvr->wiphy);
|
||||
}
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
|
||||
@@ -108,6 +108,7 @@ struct brcmf_pub {
|
||||
struct brcmf_bus *bus_if;
|
||||
struct brcmf_proto *proto;
|
||||
struct wiphy *wiphy;
|
||||
+ struct cfg80211_ops *ops;
|
||||
struct brcmf_cfg80211_info *config;
|
||||
|
||||
/* Internal brcmf items */
|
||||
@@ -0,0 +1,255 @@
|
||||
From 450914c39f88d1adada26256360dea7050ff4e83 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Tue, 3 Sep 2019 06:29:27 +0200
|
||||
Subject: [PATCH 2/3] brcmfmac: split brcmf_attach() and brcmf_detach()
|
||||
functions
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Move code allocating/freeing wiphy out of above functions. This will
|
||||
allow reinitializing the driver (e.g. on some error) without allocating
|
||||
a new wiphy.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
.../broadcom/brcm80211/brcmfmac/bus.h | 4 ++-
|
||||
.../broadcom/brcm80211/brcmfmac/core.c | 33 ++++++++++++++----
|
||||
.../broadcom/brcm80211/brcmfmac/pcie.c | 13 +++++--
|
||||
.../broadcom/brcm80211/brcmfmac/sdio.c | 15 ++++++--
|
||||
.../broadcom/brcm80211/brcmfmac/usb.c | 34 +++++++++++++++----
|
||||
5 files changed, 80 insertions(+), 19 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h
|
||||
@@ -254,10 +254,12 @@ void brcmf_rx_frame(struct device *dev,
|
||||
/* Receive async event packet from firmware. Callee disposes of rxp. */
|
||||
void brcmf_rx_event(struct device *dev, struct sk_buff *rxp);
|
||||
|
||||
+int brcmf_alloc(struct device *dev, struct brcmf_mp_device *settings);
|
||||
/* Indication from bus module regarding presence/insertion of dongle. */
|
||||
-int brcmf_attach(struct device *dev, struct brcmf_mp_device *settings);
|
||||
+int brcmf_attach(struct device *dev);
|
||||
/* Indication from bus module regarding removal/absence of dongle */
|
||||
void brcmf_detach(struct device *dev);
|
||||
+void brcmf_free(struct device *dev);
|
||||
/* Indication from bus module that dongle should be reset */
|
||||
void brcmf_dev_reset(struct device *dev);
|
||||
/* Request from bus module to initiate a coredump */
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
||||
@@ -1239,13 +1239,11 @@ fail:
|
||||
return ret;
|
||||
}
|
||||
|
||||
-int brcmf_attach(struct device *dev, struct brcmf_mp_device *settings)
|
||||
+int brcmf_alloc(struct device *dev, struct brcmf_mp_device *settings)
|
||||
{
|
||||
struct wiphy *wiphy;
|
||||
struct cfg80211_ops *ops;
|
||||
struct brcmf_pub *drvr = NULL;
|
||||
- int ret = 0;
|
||||
- int i;
|
||||
|
||||
brcmf_dbg(TRACE, "Enter\n");
|
||||
|
||||
@@ -1263,6 +1261,21 @@ int brcmf_attach(struct device *dev, str
|
||||
drvr = wiphy_priv(wiphy);
|
||||
drvr->wiphy = wiphy;
|
||||
drvr->ops = ops;
|
||||
+ drvr->bus_if = dev_get_drvdata(dev);
|
||||
+ drvr->bus_if->drvr = drvr;
|
||||
+ drvr->settings = settings;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int brcmf_attach(struct device *dev)
|
||||
+{
|
||||
+ struct brcmf_bus *bus_if = dev_get_drvdata(dev);
|
||||
+ struct brcmf_pub *drvr = bus_if->drvr;
|
||||
+ int ret = 0;
|
||||
+ int i;
|
||||
+
|
||||
+ brcmf_dbg(TRACE, "Enter\n");
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(drvr->if2bss); i++)
|
||||
drvr->if2bss[i] = BRCMF_BSSIDX_INVALID;
|
||||
@@ -1271,9 +1284,6 @@ int brcmf_attach(struct device *dev, str
|
||||
|
||||
/* Link to bus module */
|
||||
drvr->hdrlen = 0;
|
||||
- drvr->bus_if = dev_get_drvdata(dev);
|
||||
- drvr->bus_if->drvr = drvr;
|
||||
- drvr->settings = settings;
|
||||
|
||||
/* Attach and link in the protocol */
|
||||
ret = brcmf_proto_attach(drvr);
|
||||
@@ -1289,7 +1299,7 @@ int brcmf_attach(struct device *dev, str
|
||||
/* attach firmware event handler */
|
||||
brcmf_fweh_attach(drvr);
|
||||
|
||||
- ret = brcmf_bus_started(drvr, ops);
|
||||
+ ret = brcmf_bus_started(drvr, drvr->ops);
|
||||
if (ret != 0) {
|
||||
bphy_err(drvr, "dongle is not responding: err=%d\n", ret);
|
||||
goto fail;
|
||||
@@ -1381,6 +1391,15 @@ void brcmf_detach(struct device *dev)
|
||||
brcmf_cfg80211_detach(drvr->config);
|
||||
drvr->config = NULL;
|
||||
}
|
||||
+}
|
||||
+
|
||||
+void brcmf_free(struct device *dev)
|
||||
+{
|
||||
+ struct brcmf_bus *bus_if = dev_get_drvdata(dev);
|
||||
+ struct brcmf_pub *drvr = bus_if->drvr;
|
||||
+
|
||||
+ if (!drvr)
|
||||
+ return;
|
||||
|
||||
bus_if->drvr = NULL;
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
|
||||
@@ -1440,6 +1440,7 @@ static int brcmf_pcie_reset(struct devic
|
||||
brcmf_pcie_bus_console_read(devinfo, true);
|
||||
|
||||
brcmf_detach(dev);
|
||||
+ brcmf_free(dev);
|
||||
|
||||
brcmf_pcie_release_irq(devinfo);
|
||||
brcmf_pcie_release_scratchbuffers(devinfo);
|
||||
@@ -1834,11 +1835,18 @@ static void brcmf_pcie_setup(struct devi
|
||||
|
||||
brcmf_pcie_intr_enable(devinfo);
|
||||
brcmf_pcie_hostready(devinfo);
|
||||
- if (brcmf_attach(&devinfo->pdev->dev, devinfo->settings) == 0)
|
||||
- return;
|
||||
+
|
||||
+ ret = brcmf_alloc(&devinfo->pdev->dev, devinfo->settings);
|
||||
+ if (ret)
|
||||
+ goto fail;
|
||||
+ ret = brcmf_attach(&devinfo->pdev->dev);
|
||||
+ if (ret)
|
||||
+ goto fail;
|
||||
|
||||
brcmf_pcie_bus_console_read(devinfo, false);
|
||||
|
||||
+ return;
|
||||
+
|
||||
fail:
|
||||
device_release_driver(dev);
|
||||
}
|
||||
@@ -1981,6 +1989,7 @@ brcmf_pcie_remove(struct pci_dev *pdev)
|
||||
brcmf_pcie_intr_disable(devinfo);
|
||||
|
||||
brcmf_detach(&pdev->dev);
|
||||
+ brcmf_free(&pdev->dev);
|
||||
|
||||
kfree(bus->bus_priv.pcie);
|
||||
kfree(bus->msgbuf->flowrings);
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
|
||||
@@ -4140,10 +4140,17 @@ static void brcmf_sdio_firmware_callback
|
||||
sdiod->bus_if->chip = bus->ci->chip;
|
||||
sdiod->bus_if->chiprev = bus->ci->chiprev;
|
||||
|
||||
+ err = brcmf_alloc(sdiod->dev, sdiod->settings);
|
||||
+ if (err) {
|
||||
+ brcmf_err("brcmf_alloc failed\n");
|
||||
+ goto fail;
|
||||
+ }
|
||||
+
|
||||
/* Attach to the common layer, reserve hdr space */
|
||||
- err = brcmf_attach(sdiod->dev, sdiod->settings);
|
||||
+ err = brcmf_attach(sdiod->dev);
|
||||
if (err != 0) {
|
||||
brcmf_err("brcmf_attach failed\n");
|
||||
+ brcmf_free(sdiod->dev);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
|
||||
@@ -1191,8 +1191,12 @@ static void brcmf_usb_probe_phase2(struc
|
||||
if (ret)
|
||||
goto error;
|
||||
|
||||
+ ret = brcmf_alloc(devinfo->dev, devinfo->settings);
|
||||
+ if (ret)
|
||||
+ goto error;
|
||||
+
|
||||
/* Attach to the common driver interface */
|
||||
- ret = brcmf_attach(devinfo->dev, devinfo->settings);
|
||||
+ ret = brcmf_attach(devinfo->dev);
|
||||
if (ret)
|
||||
goto error;
|
||||
|
||||
@@ -1264,7 +1268,10 @@ static int brcmf_usb_probe_cb(struct brc
|
||||
}
|
||||
|
||||
if (!brcmf_usb_dlneeded(devinfo)) {
|
||||
- ret = brcmf_attach(devinfo->dev, devinfo->settings);
|
||||
+ ret = brcmf_alloc(devinfo->dev, devinfo->settings);
|
||||
+ if (ret)
|
||||
+ goto fail;
|
||||
+ ret = brcmf_attach(devinfo->dev);
|
||||
if (ret)
|
||||
goto fail;
|
||||
/* we are done */
|
||||
@@ -1292,6 +1299,7 @@ static int brcmf_usb_probe_cb(struct brc
|
||||
|
||||
fail:
|
||||
/* Release resources in reverse order */
|
||||
+ brcmf_free(devinfo->dev);
|
||||
kfree(bus);
|
||||
brcmf_usb_detach(devinfo);
|
||||
return ret;
|
||||
@@ -1305,6 +1313,7 @@ brcmf_usb_disconnect_cb(struct brcmf_usb
|
||||
brcmf_dbg(USB, "Enter, bus_pub %p\n", devinfo);
|
||||
|
||||
brcmf_detach(devinfo->dev);
|
||||
+ brcmf_free(devinfo->dev);
|
||||
kfree(devinfo->bus_pub.bus);
|
||||
brcmf_usb_detach(devinfo);
|
||||
}
|
||||
@@ -1449,10 +1458,12 @@ static int brcmf_usb_suspend(struct usb_
|
||||
|
||||
brcmf_dbg(USB, "Enter\n");
|
||||
devinfo->bus_pub.state = BRCMFMAC_USB_STATE_SLEEP;
|
||||
- if (devinfo->wowl_enabled)
|
||||
+ if (devinfo->wowl_enabled) {
|
||||
brcmf_cancel_all_urbs(devinfo);
|
||||
- else
|
||||
+ } else {
|
||||
brcmf_detach(&usb->dev);
|
||||
+ brcmf_free(&usb->dev);
|
||||
+ }
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1465,8 +1476,19 @@ static int brcmf_usb_resume(struct usb_i
|
||||
struct brcmf_usbdev_info *devinfo = brcmf_usb_get_businfo(&usb->dev);
|
||||
|
||||
brcmf_dbg(USB, "Enter\n");
|
||||
- if (!devinfo->wowl_enabled)
|
||||
- return brcmf_attach(devinfo->dev, devinfo->settings);
|
||||
+ if (!devinfo->wowl_enabled) {
|
||||
+ int err;
|
||||
+
|
||||
+ err = brcmf_alloc(&usb->dev, devinfo->settings);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
+ err = brcmf_attach(devinfo->dev);
|
||||
+ if (err) {
|
||||
+ brcmf_free(devinfo->dev);
|
||||
+ return err;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
devinfo->bus_pub.state = BRCMFMAC_USB_STATE_UP;
|
||||
brcmf_usb_rx_fill_all(devinfo);
|
||||
@@ -0,0 +1,51 @@
|
||||
From a1f5aac1765afbeace9581afa27da34085f68e1d Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
|
||||
Date: Tue, 3 Sep 2019 06:29:28 +0200
|
||||
Subject: [PATCH 3/3] brcmfmac: don't realloc wiphy during PCIe reset
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Providing a new wiphy on every PCIe reset was confusing and was causing
|
||||
configuration problems for some users (supplicant and authenticators).
|
||||
Sticking to the existing wiphy should make error recovery much simpler
|
||||
and more reliable.
|
||||
|
||||
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
|
||||
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
|
||||
@@ -1440,7 +1440,6 @@ static int brcmf_pcie_reset(struct devic
|
||||
brcmf_pcie_bus_console_read(devinfo, true);
|
||||
|
||||
brcmf_detach(dev);
|
||||
- brcmf_free(dev);
|
||||
|
||||
brcmf_pcie_release_irq(devinfo);
|
||||
brcmf_pcie_release_scratchbuffers(devinfo);
|
||||
@@ -1836,9 +1835,6 @@ static void brcmf_pcie_setup(struct devi
|
||||
brcmf_pcie_intr_enable(devinfo);
|
||||
brcmf_pcie_hostready(devinfo);
|
||||
|
||||
- ret = brcmf_alloc(&devinfo->pdev->dev, devinfo->settings);
|
||||
- if (ret)
|
||||
- goto fail;
|
||||
ret = brcmf_attach(&devinfo->pdev->dev);
|
||||
if (ret)
|
||||
goto fail;
|
||||
@@ -1941,6 +1937,10 @@ brcmf_pcie_probe(struct pci_dev *pdev, c
|
||||
bus->wowl_supported = pci_pme_capable(pdev, PCI_D3hot);
|
||||
dev_set_drvdata(&pdev->dev, bus);
|
||||
|
||||
+ ret = brcmf_alloc(&devinfo->pdev->dev, devinfo->settings);
|
||||
+ if (ret)
|
||||
+ goto fail_bus;
|
||||
+
|
||||
fwreq = brcmf_pcie_prepare_fw_request(devinfo);
|
||||
if (!fwreq) {
|
||||
ret = -ENOMEM;
|
||||
@@ -0,0 +1,94 @@
|
||||
From 4420866ef1b602682b009e0186fbb8aefd2125be Mon Sep 17 00:00:00 2001
|
||||
From: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||
Date: Tue, 20 Aug 2019 18:20:19 +0200
|
||||
Subject: [PATCH 1/4] ath9k: dynack: introduce ath_dynack_set_timeout routine
|
||||
|
||||
Introduce ath_dynack_set_timeout routine to configure slottime/ack/cts
|
||||
timeouts and remove duplicated code
|
||||
|
||||
Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
|
||||
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||
---
|
||||
drivers/net/wireless/ath/ath9k/dynack.c | 37 ++++++++++++++-----------
|
||||
1 file changed, 21 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/wireless/ath/ath9k/dynack.c b/drivers/net/wireless/ath/ath9k/dynack.c
|
||||
index f112fa5b2eac..38dbe25919f7 100644
|
||||
--- a/drivers/net/wireless/ath/ath9k/dynack.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/dynack.c
|
||||
@@ -78,6 +78,24 @@ static inline bool ath_dynack_bssidmask(struct ath_hw *ah, const u8 *mac)
|
||||
return true;
|
||||
}
|
||||
|
||||
+/**
|
||||
+ * ath_dynack_set_timeout - configure timeouts/slottime registers
|
||||
+ * @ah: ath hw
|
||||
+ * @to: timeout value
|
||||
+ *
|
||||
+ */
|
||||
+static void ath_dynack_set_timeout(struct ath_hw *ah, int to)
|
||||
+{
|
||||
+ struct ath_common *common = ath9k_hw_common(ah);
|
||||
+ int slottime = (to - 3) / 2;
|
||||
+
|
||||
+ ath_dbg(common, DYNACK, "ACK timeout %u slottime %u\n",
|
||||
+ to, slottime);
|
||||
+ ath9k_hw_setslottime(ah, slottime);
|
||||
+ ath9k_hw_set_ack_timeout(ah, to);
|
||||
+ ath9k_hw_set_cts_timeout(ah, to);
|
||||
+}
|
||||
+
|
||||
/**
|
||||
* ath_dynack_compute_ackto - compute ACK timeout as the maximum STA timeout
|
||||
* @ah: ath hw
|
||||
@@ -86,7 +104,6 @@ static inline bool ath_dynack_bssidmask(struct ath_hw *ah, const u8 *mac)
|
||||
*/
|
||||
static void ath_dynack_compute_ackto(struct ath_hw *ah)
|
||||
{
|
||||
- struct ath_common *common = ath9k_hw_common(ah);
|
||||
struct ath_dynack *da = &ah->dynack;
|
||||
struct ath_node *an;
|
||||
int to = 0;
|
||||
@@ -96,15 +113,8 @@ static void ath_dynack_compute_ackto(struct ath_hw *ah)
|
||||
to = an->ackto;
|
||||
|
||||
if (to && da->ackto != to) {
|
||||
- u32 slottime;
|
||||
-
|
||||
- slottime = (to - 3) / 2;
|
||||
+ ath_dynack_set_timeout(ah, to);
|
||||
da->ackto = to;
|
||||
- ath_dbg(common, DYNACK, "ACK timeout %u slottime %u\n",
|
||||
- da->ackto, slottime);
|
||||
- ath9k_hw_setslottime(ah, slottime);
|
||||
- ath9k_hw_set_ack_timeout(ah, da->ackto);
|
||||
- ath9k_hw_set_cts_timeout(ah, da->ackto);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -198,10 +208,7 @@ void ath_dynack_sample_tx_ts(struct ath_hw *ah, struct sk_buff *skb,
|
||||
ieee80211_is_assoc_resp(hdr->frame_control) ||
|
||||
ieee80211_is_auth(hdr->frame_control)) {
|
||||
ath_dbg(common, DYNACK, "late ack\n");
|
||||
-
|
||||
- ath9k_hw_setslottime(ah, (LATEACK_TO - 3) / 2);
|
||||
- ath9k_hw_set_ack_timeout(ah, LATEACK_TO);
|
||||
- ath9k_hw_set_cts_timeout(ah, LATEACK_TO);
|
||||
+ ath_dynack_set_timeout(ah, LATEACK_TO);
|
||||
if (sta) {
|
||||
struct ath_node *an;
|
||||
|
||||
@@ -340,9 +347,7 @@ void ath_dynack_reset(struct ath_hw *ah)
|
||||
da->ack_rbf.h_rb = 0;
|
||||
|
||||
/* init acktimeout */
|
||||
- ath9k_hw_setslottime(ah, (ackto - 3) / 2);
|
||||
- ath9k_hw_set_ack_timeout(ah, ackto);
|
||||
- ath9k_hw_set_cts_timeout(ah, ackto);
|
||||
+ ath_dynack_set_timeout(ah, ackto);
|
||||
}
|
||||
EXPORT_SYMBOL(ath_dynack_reset);
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
From e5b56ce50eab31d24df6a70cf025db3acc4aa3ac Mon Sep 17 00:00:00 2001
|
||||
From: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||
Date: Tue, 20 Aug 2019 18:20:20 +0200
|
||||
Subject: [PATCH 2/4] ath9k: dynack: properly set last timeout timestamp in
|
||||
ath_dynack_reset
|
||||
|
||||
Add compute timeout to last computation timestamp in
|
||||
ath_dynack_reset in order to not run ath_dynack_compute_ackto
|
||||
immediately
|
||||
|
||||
Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
|
||||
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||
---
|
||||
drivers/net/wireless/ath/ath9k/dynack.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/net/wireless/ath/ath9k/dynack.c b/drivers/net/wireless/ath/ath9k/dynack.c
|
||||
index 38dbe25919f7..398ea872751f 100644
|
||||
--- a/drivers/net/wireless/ath/ath9k/dynack.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/dynack.c
|
||||
@@ -338,7 +338,7 @@ void ath_dynack_reset(struct ath_hw *ah)
|
||||
u32 ackto = 9 + 16 + 64;
|
||||
struct ath_dynack *da = &ah->dynack;
|
||||
|
||||
- da->lto = jiffies;
|
||||
+ da->lto = jiffies + COMPUTE_TO;
|
||||
da->ackto = ackto;
|
||||
|
||||
da->st_rbf.t_rb = 0;
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
From 3f737abb7d53cc80d619a3b4a30b6fa63cdc8df7 Mon Sep 17 00:00:00 2001
|
||||
From: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||
Date: Tue, 20 Aug 2019 18:20:21 +0200
|
||||
Subject: [PATCH 3/4] ath9k: dynack: set max timeout according to channel width
|
||||
|
||||
Compute maximum configurable ackimeout/ctstimeout according to channel
|
||||
width (clockrate)
|
||||
|
||||
Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
|
||||
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||
---
|
||||
drivers/net/wireless/ath/ath9k/dynack.c | 38 +++++++++++++++++++------
|
||||
1 file changed, 30 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/wireless/ath/ath9k/dynack.c b/drivers/net/wireless/ath/ath9k/dynack.c
|
||||
index 398ea872751f..fe9181533de3 100644
|
||||
--- a/drivers/net/wireless/ath/ath9k/dynack.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/dynack.c
|
||||
@@ -20,11 +20,30 @@
|
||||
|
||||
#define COMPUTE_TO (5 * HZ)
|
||||
#define LATEACK_DELAY (10 * HZ)
|
||||
-#define LATEACK_TO 256
|
||||
-#define MAX_DELAY 300
|
||||
#define EWMA_LEVEL 96
|
||||
#define EWMA_DIV 128
|
||||
|
||||
+/**
|
||||
+ * ath_dynack_get_max_to - set max timeout according to channel width
|
||||
+ * @ah: ath hw
|
||||
+ *
|
||||
+ */
|
||||
+static u32 ath_dynack_get_max_to(struct ath_hw *ah)
|
||||
+{
|
||||
+ const struct ath9k_channel *chan = ah->curchan;
|
||||
+
|
||||
+ if (!chan)
|
||||
+ return 300;
|
||||
+
|
||||
+ if (IS_CHAN_HT40(chan))
|
||||
+ return 300;
|
||||
+ if (IS_CHAN_HALF_RATE(chan))
|
||||
+ return 750;
|
||||
+ if (IS_CHAN_QUARTER_RATE(chan))
|
||||
+ return 1500;
|
||||
+ return 600;
|
||||
+}
|
||||
+
|
||||
/**
|
||||
* ath_dynack_ewma - EWMA (Exponentially Weighted Moving Average) calculation
|
||||
*
|
||||
@@ -126,15 +145,16 @@ static void ath_dynack_compute_ackto(struct ath_hw *ah)
|
||||
*/
|
||||
static void ath_dynack_compute_to(struct ath_hw *ah)
|
||||
{
|
||||
- u32 ackto, ack_ts;
|
||||
- u8 *dst, *src;
|
||||
+ struct ath_dynack *da = &ah->dynack;
|
||||
+ u32 ackto, ack_ts, max_to;
|
||||
struct ieee80211_sta *sta;
|
||||
- struct ath_node *an;
|
||||
struct ts_info *st_ts;
|
||||
- struct ath_dynack *da = &ah->dynack;
|
||||
+ struct ath_node *an;
|
||||
+ u8 *dst, *src;
|
||||
|
||||
rcu_read_lock();
|
||||
|
||||
+ max_to = ath_dynack_get_max_to(ah);
|
||||
while (da->st_rbf.h_rb != da->st_rbf.t_rb &&
|
||||
da->ack_rbf.h_rb != da->ack_rbf.t_rb) {
|
||||
ack_ts = da->ack_rbf.tstamp[da->ack_rbf.h_rb];
|
||||
@@ -150,7 +170,7 @@ static void ath_dynack_compute_to(struct ath_hw *ah)
|
||||
if (ack_ts > st_ts->tstamp + st_ts->dur) {
|
||||
ackto = ack_ts - st_ts->tstamp - st_ts->dur;
|
||||
|
||||
- if (ackto < MAX_DELAY) {
|
||||
+ if (ackto < max_to) {
|
||||
sta = ieee80211_find_sta_by_ifaddr(ah->hw, dst,
|
||||
src);
|
||||
if (sta) {
|
||||
@@ -207,8 +227,10 @@ void ath_dynack_sample_tx_ts(struct ath_hw *ah, struct sk_buff *skb,
|
||||
if (ieee80211_is_assoc_req(hdr->frame_control) ||
|
||||
ieee80211_is_assoc_resp(hdr->frame_control) ||
|
||||
ieee80211_is_auth(hdr->frame_control)) {
|
||||
+ u32 max_to = ath_dynack_get_max_to(ah);
|
||||
+
|
||||
ath_dbg(common, DYNACK, "late ack\n");
|
||||
- ath_dynack_set_timeout(ah, LATEACK_TO);
|
||||
+ ath_dynack_set_timeout(ah, max_to);
|
||||
if (sta) {
|
||||
struct ath_node *an;
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
From cc783bfa67e87d2e6206f7626b7bbb74d5c5f269 Mon Sep 17 00:00:00 2001
|
||||
From: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||
Date: Tue, 20 Aug 2019 18:20:22 +0200
|
||||
Subject: [PATCH 4/4] ath9k: dynack: set ackto to max timeout in
|
||||
ath_dynack_reset
|
||||
|
||||
Initialize acktimeout to the maximum configurable value in
|
||||
ath_dynack_reset in order to not disconnect long distance static links
|
||||
enabling dynack and even to take care of possible errors configuring
|
||||
a static timeout. Moreover initialize station timeout value to the current
|
||||
acktimeout value
|
||||
|
||||
Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
|
||||
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
|
||||
---
|
||||
drivers/net/wireless/ath/ath9k/dynack.c | 20 +++++++++++++-------
|
||||
1 file changed, 13 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/wireless/ath/ath9k/dynack.c b/drivers/net/wireless/ath/ath9k/dynack.c
|
||||
index fe9181533de3..f786be04d0ac 100644
|
||||
--- a/drivers/net/wireless/ath/ath9k/dynack.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/dynack.c
|
||||
@@ -321,11 +321,9 @@ EXPORT_SYMBOL(ath_dynack_sample_ack_ts);
|
||||
*/
|
||||
void ath_dynack_node_init(struct ath_hw *ah, struct ath_node *an)
|
||||
{
|
||||
- /* ackto = slottime + sifs + air delay */
|
||||
- u32 ackto = 9 + 16 + 64;
|
||||
struct ath_dynack *da = &ah->dynack;
|
||||
|
||||
- an->ackto = ackto;
|
||||
+ an->ackto = da->ackto;
|
||||
|
||||
spin_lock(&da->qlock);
|
||||
list_add_tail(&an->list, &da->nodes);
|
||||
@@ -356,20 +354,26 @@ EXPORT_SYMBOL(ath_dynack_node_deinit);
|
||||
*/
|
||||
void ath_dynack_reset(struct ath_hw *ah)
|
||||
{
|
||||
- /* ackto = slottime + sifs + air delay */
|
||||
- u32 ackto = 9 + 16 + 64;
|
||||
struct ath_dynack *da = &ah->dynack;
|
||||
+ struct ath_node *an;
|
||||
+
|
||||
+ spin_lock_bh(&da->qlock);
|
||||
|
||||
da->lto = jiffies + COMPUTE_TO;
|
||||
- da->ackto = ackto;
|
||||
|
||||
da->st_rbf.t_rb = 0;
|
||||
da->st_rbf.h_rb = 0;
|
||||
da->ack_rbf.t_rb = 0;
|
||||
da->ack_rbf.h_rb = 0;
|
||||
|
||||
+ da->ackto = ath_dynack_get_max_to(ah);
|
||||
+ list_for_each_entry(an, &da->nodes, list)
|
||||
+ an->ackto = da->ackto;
|
||||
+
|
||||
/* init acktimeout */
|
||||
- ath_dynack_set_timeout(ah, ackto);
|
||||
+ ath_dynack_set_timeout(ah, da->ackto);
|
||||
+
|
||||
+ spin_unlock_bh(&da->qlock);
|
||||
}
|
||||
EXPORT_SYMBOL(ath_dynack_reset);
|
||||
|
||||
@@ -386,6 +390,8 @@ void ath_dynack_init(struct ath_hw *ah)
|
||||
|
||||
spin_lock_init(&da->qlock);
|
||||
INIT_LIST_HEAD(&da->nodes);
|
||||
+ /* ackto = slottime + sifs + air delay */
|
||||
+ da->ackto = 9 + 16 + 64;
|
||||
|
||||
ah->hw->wiphy->features |= NL80211_FEATURE_ACKTO_ESTIMATION;
|
||||
}
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -13,7 +13,7 @@ Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
|
||||
@@ -1434,6 +1434,7 @@ int __init brcmf_core_init(void)
|
||||
@@ -1481,6 +1481,7 @@ int __init brcmf_core_init(void)
|
||||
{
|
||||
if (!schedule_work(&brcmf_driver_work))
|
||||
return -EBUSY;
|
||||
|
||||
@@ -10,7 +10,7 @@ Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
@@ -620,8 +620,36 @@ static struct wireless_dev *brcmf_cfg802
|
||||
@@ -639,8 +639,36 @@ static struct wireless_dev *brcmf_cfg802
|
||||
struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
|
||||
struct brcmf_pub *drvr = cfg->pub;
|
||||
struct wireless_dev *wdev;
|
||||
|
||||
@@ -14,7 +14,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
@@ -2774,6 +2774,10 @@ brcmf_cfg80211_set_power_mgmt(struct wip
|
||||
@@ -2798,6 +2798,10 @@ brcmf_cfg80211_set_power_mgmt(struct wip
|
||||
* preference in cfg struct to apply this to
|
||||
* FW later while initializing the dongle
|
||||
*/
|
||||
|
||||
@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libbsd
|
||||
PKG_VERSION:=0.8.7
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||
PKG_HASH:=f548f10e5af5a08b1e22889ce84315b1ebe41505b015c9596bad03fd13a12b31
|
||||
|
||||
30
package/libs/libbsd/patches/010-fix-arc.patch
Normal file
30
package/libs/libbsd/patches/010-fix-arc.patch
Normal file
@@ -0,0 +1,30 @@
|
||||
From f60b6777cc2047f9845de2c88cf092b045c160c0 Mon Sep 17 00:00:00 2001
|
||||
From: Rosen Penev <rosenp@gmail.com>
|
||||
Date: Fri, 17 May 2019 01:44:56 +0000
|
||||
Subject: [PATCH] local-elf: Add ARC support
|
||||
|
||||
Signed-off-by: Rosen Penev <rosenp@gmail.com>
|
||||
---
|
||||
src/local-elf.h | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/src/local-elf.h b/src/local-elf.h
|
||||
index 83ca253..b90baf3 100644
|
||||
--- a/src/local-elf.h
|
||||
+++ b/src/local-elf.h
|
||||
@@ -53,6 +53,12 @@
|
||||
#endif
|
||||
#define ELF_TARG_DATA ELFDATA2LSB
|
||||
|
||||
+#elif defined (__arc__)
|
||||
+
|
||||
+#define ELF_TARG_MACH EM_ARC
|
||||
+#define ELF_TARG_CLASS ELFCLASS32
|
||||
+#define ELF_TARG_DATA ELFDATA2LSB
|
||||
+
|
||||
#elif defined(__arm__)
|
||||
|
||||
#define ELF_TARG_MACH EM_ARM
|
||||
--
|
||||
2.18.1
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=libpcap
|
||||
PKG_VERSION:=1.8.1
|
||||
PKG_VERSION:=1.9.1
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=http://www.us.tcpdump.org/release/ \
|
||||
http://www.tcpdump.org/release/
|
||||
PKG_HASH:=673dbc69fdc3f5a86fb5759ab19899039a8e5e6c631749e48dcd9c6f0c83541e
|
||||
PKG_HASH:=635237637c5b619bcceba91900666b64d56ecb7be63f298f601ec786ce087094
|
||||
PKG_FIXUP:=patch-libtool
|
||||
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
From 64aa033a061c43fc15c711f2490ae41d23b868c3 Mon Sep 17 00:00:00 2001
|
||||
From: Fabio Berton <fabio.berton@ossystems.com.br>
|
||||
Date: Thu, 17 Nov 2016 09:44:42 -0200
|
||||
Subject: [PATCH 1/2] Fix compiler_state_t.ai usage when INET6 is not defined
|
||||
Organization: O.S. Systems Software LTDA.
|
||||
|
||||
Fix error:
|
||||
|
||||
/
|
||||
| ../libpcap-1.8.1/gencode.c: In function 'pcap_compile':
|
||||
| ../libpcap-1.8.1/gencode.c:693:8: error: 'compiler_state_t
|
||||
| {aka struct _compiler_state}' has no member named 'ai'
|
||||
| cstate.ai = NULL;
|
||||
\
|
||||
|
||||
Upstream-Status: Submitted [1]
|
||||
|
||||
[1] https://github.com/the-tcpdump-group/libpcap/pull/541
|
||||
|
||||
Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
|
||||
---
|
||||
gencode.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/gencode.c b/gencode.c
|
||||
index a887f27..e103c70 100644
|
||||
--- a/gencode.c
|
||||
+++ b/gencode.c
|
||||
@@ -690,7 +690,9 @@ pcap_compile(pcap_t *p, struct bpf_program *program,
|
||||
}
|
||||
initchunks(&cstate);
|
||||
cstate.no_optimize = 0;
|
||||
+#ifdef INET6
|
||||
cstate.ai = NULL;
|
||||
+#endif
|
||||
cstate.ic.root = NULL;
|
||||
cstate.ic.cur_mark = 0;
|
||||
cstate.bpf_pcap = p;
|
||||
--
|
||||
2.1.4
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
From 50ec0a088d5924a8305b2d70dcba71b0942dee1a Mon Sep 17 00:00:00 2001
|
||||
From: Fabio Berton <fabio.berton@ossystems.com.br>
|
||||
Date: Thu, 17 Nov 2016 09:47:29 -0200
|
||||
Subject: [PATCH 2/2] Add missing compiler_state_t parameter
|
||||
Organization: O.S. Systems Software LTDA.
|
||||
|
||||
Fix error:
|
||||
|
||||
/
|
||||
|../libpcap-1.8.1/gencode.c: In function 'gen_gateway':
|
||||
|../libpcap-1.8.1/gencode.c:4914:13: error: 'cstate' undeclared
|
||||
| (first use in this function)
|
||||
| bpf_error(cstate, "direction applied to 'gateway'");
|
||||
\
|
||||
|
||||
Upstream-Status: Submitted [1]
|
||||
|
||||
[1] https://github.com/the-tcpdump-group/libpcap/pull/541
|
||||
|
||||
Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
|
||||
---
|
||||
gencode.c | 15 ++++++++-------
|
||||
1 file changed, 8 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/gencode.c b/gencode.c
|
||||
index e103c70..f07c0be 100644
|
||||
--- a/gencode.c
|
||||
+++ b/gencode.c
|
||||
@@ -523,7 +523,7 @@ static struct block *gen_host6(compiler_state_t *, struct in6_addr *,
|
||||
struct in6_addr *, int, int, int);
|
||||
#endif
|
||||
#ifndef INET6
|
||||
-static struct block *gen_gateway(const u_char *, bpf_u_int32 **, int, int);
|
||||
+static struct block *gen_gateway(compiler_state_t *, const u_char *, bpf_u_int32 **, int, int);
|
||||
#endif
|
||||
static struct block *gen_ipfrag(compiler_state_t *);
|
||||
static struct block *gen_portatom(compiler_state_t *, int, bpf_int32);
|
||||
@@ -4904,11 +4904,12 @@ gen_host6(compiler_state_t *cstate, struct in6_addr *addr,
|
||||
|
||||
#ifndef INET6
|
||||
static struct block *
|
||||
-gen_gateway(eaddr, alist, proto, dir)
|
||||
- const u_char *eaddr;
|
||||
- bpf_u_int32 **alist;
|
||||
- int proto;
|
||||
- int dir;
|
||||
+gen_gateway(cstate, eaddr, alist, proto, dir)
|
||||
+ compiler_state_t *cstate;
|
||||
+ const u_char *eaddr;
|
||||
+ bpf_u_int32 **alist;
|
||||
+ int proto;
|
||||
+ int dir;
|
||||
{
|
||||
struct block *b0, *b1, *tmp;
|
||||
|
||||
@@ -6472,7 +6473,7 @@ gen_scode(compiler_state_t *cstate, const char *name, struct qual q)
|
||||
alist = pcap_nametoaddr(name);
|
||||
if (alist == NULL || *alist == NULL)
|
||||
bpf_error(cstate, "unknown host '%s'", name);
|
||||
- b = gen_gateway(eaddr, alist, proto, dir);
|
||||
+ b = gen_gateway(cstate, eaddr, alist, proto, dir);
|
||||
free(eaddr);
|
||||
return b;
|
||||
#else
|
||||
--
|
||||
2.1.4
|
||||
|
||||
@@ -3,7 +3,7 @@ build a shared library.
|
||||
|
||||
--- a/Makefile.in
|
||||
+++ b/Makefile.in
|
||||
@@ -38,6 +38,13 @@ mandir = @mandir@
|
||||
@@ -40,6 +40,13 @@ mandir = @mandir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
@@ -17,17 +17,17 @@ build a shared library.
|
||||
#
|
||||
# You shouldn't need to edit anything below.
|
||||
#
|
||||
@@ -62,7 +69,8 @@ DEPENDENCY_CFLAG = @DEPENDENCY_CFLAG@
|
||||
PROG=libpcap
|
||||
@@ -69,7 +76,8 @@ INSTALL_RPCAPD=@INSTALL_RPCAPD@
|
||||
EXTRA_NETWORK_LIBS=@EXTRA_NETWORK_LIBS@
|
||||
|
||||
# Standard CFLAGS
|
||||
-FULL_CFLAGS = $(CCOPT) $(INCLS) $(DEFS) $(CFLAGS)
|
||||
+FULL_CFLAGS = $(CCOPT) $(INCLS) $(DEFS) $(CFLAGS) $(CPPFLAGS)
|
||||
# Standard CFLAGS for building members of a shared library
|
||||
-FULL_CFLAGS = $(CCOPT) @V_LIB_CCOPT_FAT@ $(SHLIB_CCOPT) $(INCLS) $(DEFS) $(CFLAGS)
|
||||
+FULL_CFLAGS = $(CCOPT) @V_LIB_CCOPT_FAT@ $(SHLIB_CCOPT) $(INCLS) $(DEFS) $(CFLAGS) $(CPPFLAGS)
|
||||
+CFLAGS_SHARED = -shared -Wl,-soname,$(SHAREDLIB)
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
@@ -77,7 +85,11 @@ YACC = @YACC@
|
||||
@@ -84,7 +92,11 @@ YACC = @YACC@
|
||||
# problem if you don't own the file but can write to the directory.
|
||||
.c.o:
|
||||
@rm -f $@
|
||||
@@ -38,9 +38,9 @@ build a shared library.
|
||||
+ @rm -f $@
|
||||
+ $(CC) -fPIC $(FULL_CFLAGS) -c -o $@ $(srcdir)/$*.c
|
||||
|
||||
PSRC = pcap-@V_PCAP@.c @USB_SRC@ @BT_SRC@ @BT_MONITOR_SRC@ @NETFILTER_SRC@ @DBUS_SRC@
|
||||
PSRC = pcap-@V_PCAP@.c @USB_SRC@ @BT_SRC@ @BT_MONITOR_SRC@ @NETFILTER_SRC@ @DBUS_SRC@ @NETMAP_SRC@ @RDMA_SRC@
|
||||
FSRC = @V_FINDALLDEVS@
|
||||
@@ -93,6 +105,7 @@ SRC = $(PSRC) $(FSRC) $(CSRC) $(SSRC) $(
|
||||
@@ -101,6 +113,7 @@ SRC = $(PSRC) $(FSRC) $(CSRC) $(SSRC) $(
|
||||
# We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot
|
||||
# hack the extra indirection
|
||||
OBJ = $(PSRC:.c=.o) $(FSRC:.c=.o) $(CSRC:.c=.o) $(SSRC:.c=.o) $(GENSRC:.c=.o) $(LIBOBJS)
|
||||
@@ -48,16 +48,16 @@ build a shared library.
|
||||
PUBHDR = \
|
||||
pcap.h \
|
||||
pcap-bpf.h \
|
||||
@@ -157,7 +170,7 @@ TAGFILES = \
|
||||
@@ -155,7 +168,7 @@ TAGFILES = \
|
||||
|
||||
CLEANFILES = $(OBJ) libpcap.* $(TESTS) \
|
||||
CLEANFILES = $(OBJ) libpcap.a libpcap.so.`cat $(srcdir)/VERSION` \
|
||||
$(PROG)-`cat $(srcdir)/VERSION`.tar.gz $(GENSRC) $(GENHDR) \
|
||||
- lex.yy.c pcap-config
|
||||
+ lex.yy.c pcap-config $(OBJ_PIC)
|
||||
- lex.yy.c pcap-config libpcap.pc
|
||||
+ lex.yy.c pcap-config libpcap.pc $(OBJ_PIC)
|
||||
|
||||
MAN1 = pcap-config.1
|
||||
|
||||
@@ -365,7 +378,7 @@ libpcap.a: $(OBJ)
|
||||
@@ -392,7 +405,7 @@ libpcap.a: $(OBJ)
|
||||
$(AR) rc $@ $(OBJ) $(ADDLARCHIVEOBJS)
|
||||
$(RANLIB) $@
|
||||
|
||||
@@ -66,7 +66,7 @@ build a shared library.
|
||||
|
||||
libpcap.so: $(OBJ)
|
||||
@rm -f $@
|
||||
@@ -443,6 +456,12 @@ libpcap.shareda: $(OBJ)
|
||||
@@ -468,6 +481,12 @@ libpcap.shareda: $(OBJ)
|
||||
#
|
||||
libpcap.none:
|
||||
|
||||
@@ -79,44 +79,37 @@ build a shared library.
|
||||
scanner.c: $(srcdir)/scanner.l
|
||||
$(LEX) -P pcap_ --header-file=scanner.h --nounput -o scanner.c $<
|
||||
scanner.h: scanner.c
|
||||
@@ -455,6 +474,9 @@ scanner.h: scanner.c
|
||||
@@ -480,6 +499,9 @@ scanner.h: scanner.c
|
||||
scanner.o: scanner.c grammar.h
|
||||
$(CC) $(FULL_CFLAGS) -c scanner.c
|
||||
|
||||
+scanner_pic.o: scanner.c grammar.h
|
||||
+ $(CC) -fPIC $(FULL_CFLAGS) -o $@ -c scanner.c
|
||||
+
|
||||
pcap.o: pcap_version.h
|
||||
|
||||
grammar.c: $(srcdir)/grammar.y
|
||||
@@ -472,9 +494,16 @@ grammar.o: grammar.c
|
||||
$(YACC) -p pcap_ -o grammar.c -d $<
|
||||
grammar.h: grammar.c
|
||||
@@ -492,6 +514,9 @@ grammar.h: grammar.c
|
||||
grammar.o: grammar.c scanner.h
|
||||
$(CC) $(FULL_CFLAGS) -c grammar.c
|
||||
|
||||
+grammar_pic.o: grammar.c scanner.h
|
||||
+ $(CC) -fPIC $(FULL_CFLAGS) -o $@ -c grammar.c
|
||||
+
|
||||
gencode.o: $(srcdir)/gencode.c grammar.h scanner.h
|
||||
$(CC) $(FULL_CFLAGS) -c $(srcdir)/gencode.c
|
||||
|
||||
+grammar_pic.o: grammar.c
|
||||
+ @rm -f $@
|
||||
+ $(CC) -fPIC $(FULL_CFLAGS) -Dyylval=pcap_lval -o $@ -c grammar.c
|
||||
+
|
||||
version.o: version.c
|
||||
$(CC) $(FULL_CFLAGS) -c version.c
|
||||
|
||||
+version_pic.o: version.c
|
||||
+ $(CC) -fPIC $(FULL_CFLAGS) -c version.c -o $@
|
||||
+
|
||||
snprintf.o: $(srcdir)/missing/snprintf.c
|
||||
$(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c
|
||||
|
||||
@@ -501,6 +530,9 @@ bpf_filter.c: $(srcdir)/bpf/net/bpf_filt
|
||||
bpf_filter.o: bpf_filter.c
|
||||
$(CC) $(FULL_CFLAGS) -c bpf_filter.c
|
||||
@@ -539,6 +564,9 @@ pcap-config: $(srcdir)/pcap-config.in ./
|
||||
mv $@.tmp $@
|
||||
chmod a+x $@
|
||||
|
||||
+bpf_filter_pic.o: bpf_filter.c
|
||||
+ $(CC) -fPIC $(FULL_CFLAGS) -c bpf_filter.c -o $@
|
||||
+
|
||||
#
|
||||
# Generate the pcap-config script.
|
||||
# Remote pcap daemon.
|
||||
#
|
||||
@@ -623,14 +655,11 @@ install: install-shared install-archive
|
||||
@@ -632,14 +660,11 @@ install: install-shared install-archive
|
||||
$(DESTDIR)$(mandir)/man@MAN_MISC_INFO@/`echo $$i | sed 's/.manmisc.in/.@MAN_MISC_INFO@/'`; done
|
||||
|
||||
install-shared: install-shared-$(DYEXT)
|
||||
@@ -136,27 +129,27 @@ build a shared library.
|
||||
(mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
|
||||
--- a/aclocal.m4
|
||||
+++ b/aclocal.m4
|
||||
@@ -470,7 +470,7 @@ AC_DEFUN(AC_LBL_SHLIBS_INIT,
|
||||
@@ -507,7 +507,7 @@ AC_DEFUN(AC_LBL_SHLIBS_INIT,
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
- V_CCOPT="$V_CCOPT $PIC_OPT"
|
||||
+ V_CCOPT="$V_CCOPT"
|
||||
- V_SHLIB_CCOPT="$V_SHLIB_CCOPT $PIC_OPT"
|
||||
+ V_SHLIB_CCOPT="$V_SHLIB_CCOPT"
|
||||
V_SONAME_OPT="-Wl,-soname,"
|
||||
V_RPATH_OPT="-Wl,-rpath,"
|
||||
;;
|
||||
@@ -533,7 +533,7 @@ AC_DEFUN(AC_LBL_SHLIBS_INIT,
|
||||
@@ -570,7 +570,7 @@ AC_DEFUN(AC_LBL_SHLIBS_INIT,
|
||||
#
|
||||
# "cc" is GCC.
|
||||
#
|
||||
- V_CCOPT="$V_CCOPT -fpic"
|
||||
+ V_CCOPT="$V_CCOPT"
|
||||
- V_SHLIB_CCOPT="$V_SHLIB_CCOPT -fpic"
|
||||
+ V_SHLIB_CCOPT="$V_SHLIB_CCOPT"
|
||||
V_SHLIB_CMD="\$(CC)"
|
||||
V_SHLIB_OPT="-shared"
|
||||
V_SONAME_OPT="-Wl,-soname,"
|
||||
--- a/pcap-config.in
|
||||
+++ b/pcap-config.in
|
||||
@@ -36,16 +36,6 @@ do
|
||||
@@ -41,16 +41,6 @@ do
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/Makefile.in
|
||||
+++ b/Makefile.in
|
||||
@@ -589,70 +589,12 @@ install: install-shared install-archive
|
||||
@@ -588,14 +588,6 @@ install: install-shared install-archive
|
||||
(mkdir -p $(DESTDIR)$(includedir); chmod 755 $(DESTDIR)$(includedir))
|
||||
[ -d $(DESTDIR)$(includedir)/pcap ] || \
|
||||
(mkdir -p $(DESTDIR)$(includedir)/pcap; chmod 755 $(DESTDIR)$(includedir)/pcap)
|
||||
@@ -15,9 +15,10 @@
|
||||
for i in $(PUBHDR); do \
|
||||
$(INSTALL_DATA) $(srcdir)/$$i \
|
||||
$(DESTDIR)$(includedir)/$$i; done
|
||||
[ -d $(DESTDIR)$(bindir) ] || \
|
||||
(mkdir -p $(DESTDIR)$(bindir); chmod 755 $(DESTDIR)$(bindir))
|
||||
$(INSTALL_PROGRAM) pcap-config $(DESTDIR)$(bindir)/pcap-config
|
||||
@@ -605,59 +597,6 @@ install: install-shared install-archive
|
||||
[ -d $(DESTDIR)$(libdir)/pkgconfig ] || \
|
||||
(mkdir -p $(DESTDIR)$(libdir)/pkgconfig; chmod 755 $(DESTDIR)$(libdir)/pkgconfig)
|
||||
$(INSTALL_DATA) libpcap.pc $(DESTDIR)$(libdir)/pkgconfig/libpcap.pc
|
||||
- for i in $(MAN1); do \
|
||||
- $(INSTALL_DATA) $(srcdir)/$$i \
|
||||
- $(DESTDIR)$(mandir)/man1/$$i; done
|
||||
@@ -31,6 +32,9 @@
|
||||
- rm -f pcap_datalink_val_to_description.3pcap && \
|
||||
- $(LN_S) pcap_datalink_val_to_name.3pcap \
|
||||
- pcap_datalink_val_to_description.3pcap && \
|
||||
- rm -f pcap_datalink_val_to_description_or_dlt.3pcap && \
|
||||
- $(LN_S) pcap_datalink_val_to_name.3pcap \
|
||||
- pcap_datalink_val_to_description_or_dlt.3pcap && \
|
||||
- rm -f pcap_dump_fopen.3pcap && \
|
||||
- $(LN_S) pcap_dump_open.3pcap pcap_dump_fopen.3pcap && \
|
||||
- rm -f pcap_freealldevs.3pcap && \
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
|
||||
--- a/Makefile.in
|
||||
+++ b/Makefile.in
|
||||
@@ -56,7 +56,7 @@ LN_S = @LN_S@
|
||||
MKDEP = @MKDEP@
|
||||
@@ -59,7 +59,7 @@ MKDEP = @MKDEP@
|
||||
CCOPT = @V_CCOPT@
|
||||
SHLIB_CCOPT = @V_SHLIB_CCOPT@
|
||||
INCLS = -I. @V_INCLS@
|
||||
-DEFS = -DBUILDING_PCAP @DEFS@ @V_DEFS@
|
||||
+DEFS = -DBUILDING_PCAP -D_BSD_SOURCE @DEFS@ @V_DEFS@
|
||||
-DEFS = -DBUILDING_PCAP -Dpcap_EXPORTS @DEFS@ @V_DEFS@
|
||||
+DEFS = -DBUILDING_PCAP -D_BSD_SOURCE -Dpcap_EXPORTS @DEFS@ @V_DEFS@
|
||||
ADDLOBJS = @ADDLOBJS@
|
||||
ADDLARCHIVEOBJS = @ADDLARCHIVEOBJS@
|
||||
LIBS = @LIBS@
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/pcap-common.c
|
||||
+++ b/pcap-common.c
|
||||
@@ -1447,14 +1447,23 @@ swap_pseudo_headers(int linktype, struct
|
||||
@@ -1570,14 +1570,23 @@ swap_pseudo_headers(int linktype, struct
|
||||
break;
|
||||
|
||||
case DLT_USB_LINUX:
|
||||
|
||||
@@ -1,142 +0,0 @@
|
||||
This API extension is used by ead (Emergency Access Daemon)
|
||||
|
||||
--- a/pcap-linux.c
|
||||
+++ b/pcap-linux.c
|
||||
@@ -425,7 +425,7 @@ static int iface_get_id(int fd, const ch
|
||||
static int iface_get_mtu(int fd, const char *device, char *ebuf);
|
||||
static int iface_get_arptype(int fd, const char *device, char *ebuf);
|
||||
#ifdef HAVE_PF_PACKET_SOCKETS
|
||||
-static int iface_bind(int fd, int ifindex, char *ebuf);
|
||||
+static int iface_bind(int fd, int ifindex, char *ebuf, unsigned short proto);
|
||||
#ifdef IW_MODE_MONITOR
|
||||
static int has_wext(int sock_fd, const char *device, char *ebuf);
|
||||
#endif /* IW_MODE_MONITOR */
|
||||
@@ -1059,7 +1059,7 @@ pcap_can_set_rfmon_linux(pcap_t *handle)
|
||||
* (We assume that if we have Wireless Extensions support
|
||||
* we also have PF_PACKET support.)
|
||||
*/
|
||||
- sock_fd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
|
||||
+ sock_fd = socket(PF_PACKET, SOCK_RAW, p->opt.proto);
|
||||
if (sock_fd == -1) {
|
||||
(void)pcap_snprintf(handle->errbuf, PCAP_ERRBUF_SIZE,
|
||||
"socket: %s", pcap_strerror(errno));
|
||||
@@ -1456,6 +1456,9 @@ pcap_activate_linux(pcap_t *handle)
|
||||
handle->read_op = pcap_read_linux;
|
||||
handle->stats_op = pcap_stats_linux;
|
||||
|
||||
+ if (handle->opt.proto < 0)
|
||||
+ handle->opt.proto = (int) htons(ETH_P_ALL);
|
||||
+
|
||||
/*
|
||||
* The "any" device is a special device which causes us not
|
||||
* to bind to a particular device and thus to look at all
|
||||
@@ -3335,8 +3338,8 @@ activate_new(pcap_t *handle)
|
||||
* try a SOCK_RAW socket for the raw interface.
|
||||
*/
|
||||
sock_fd = is_any_device ?
|
||||
- socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_ALL)) :
|
||||
- socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
|
||||
+ socket(PF_PACKET, SOCK_DGRAM, handle->opt.proto) :
|
||||
+ socket(PF_PACKET, SOCK_RAW, handle->opt.proto);
|
||||
|
||||
if (sock_fd == -1) {
|
||||
if (errno == EINVAL || errno == EAFNOSUPPORT) {
|
||||
@@ -3454,7 +3457,7 @@ activate_new(pcap_t *handle)
|
||||
return PCAP_ERROR;
|
||||
}
|
||||
sock_fd = socket(PF_PACKET, SOCK_DGRAM,
|
||||
- htons(ETH_P_ALL));
|
||||
+ handle->opt.proto);
|
||||
if (sock_fd == -1) {
|
||||
pcap_snprintf(handle->errbuf, PCAP_ERRBUF_SIZE,
|
||||
"socket: %s", pcap_strerror(errno));
|
||||
@@ -3518,7 +3521,7 @@ activate_new(pcap_t *handle)
|
||||
}
|
||||
|
||||
if ((err = iface_bind(sock_fd, handlep->ifindex,
|
||||
- handle->errbuf)) != 1) {
|
||||
+ handle->errbuf, handle->opt.proto)) != 1) {
|
||||
close(sock_fd);
|
||||
if (err < 0)
|
||||
return err;
|
||||
@@ -5271,7 +5274,7 @@ iface_get_id(int fd, const char *device,
|
||||
* or a PCAP_ERROR_ value on a hard error.
|
||||
*/
|
||||
static int
|
||||
-iface_bind(int fd, int ifindex, char *ebuf)
|
||||
+iface_bind(int fd, int ifindex, char *ebuf, unsigned short proto)
|
||||
{
|
||||
struct sockaddr_ll sll;
|
||||
int err;
|
||||
@@ -5280,7 +5283,7 @@ iface_bind(int fd, int ifindex, char *eb
|
||||
memset(&sll, 0, sizeof(sll));
|
||||
sll.sll_family = AF_PACKET;
|
||||
sll.sll_ifindex = ifindex;
|
||||
- sll.sll_protocol = htons(ETH_P_ALL);
|
||||
+ sll.sll_protocol = proto;
|
||||
|
||||
if (bind(fd, (struct sockaddr *) &sll, sizeof(sll)) == -1) {
|
||||
if (errno == ENETDOWN) {
|
||||
@@ -6325,7 +6328,7 @@ activate_old(pcap_t *handle)
|
||||
|
||||
/* Open the socket */
|
||||
|
||||
- handle->fd = socket(PF_INET, SOCK_PACKET, htons(ETH_P_ALL));
|
||||
+ handle->fd = socket(PF_INET, SOCK_PACKET, handle->opt.proto);
|
||||
if (handle->fd == -1) {
|
||||
pcap_snprintf(handle->errbuf, PCAP_ERRBUF_SIZE,
|
||||
"socket: %s", pcap_strerror(errno));
|
||||
--- a/pcap.c
|
||||
+++ b/pcap.c
|
||||
@@ -578,6 +578,7 @@ pcap_create_common(char *ebuf, size_t si
|
||||
p->opt.promisc = 0;
|
||||
p->opt.rfmon = 0;
|
||||
p->opt.immediate = 0;
|
||||
+ p->opt.proto = -1;
|
||||
p->opt.tstamp_type = -1; /* default to not setting time stamp type */
|
||||
p->opt.tstamp_precision = PCAP_TSTAMP_PRECISION_MICRO;
|
||||
|
||||
@@ -771,6 +772,15 @@ pcap_get_tstamp_precision(pcap_t *p)
|
||||
}
|
||||
|
||||
int
|
||||
+pcap_set_protocol(pcap_t *p, unsigned short proto)
|
||||
+{
|
||||
+ if (pcap_check_activated(p))
|
||||
+ return PCAP_ERROR_ACTIVATED;
|
||||
+ p->opt.proto = proto;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int
|
||||
pcap_activate(pcap_t *p)
|
||||
{
|
||||
int status;
|
||||
--- a/pcap/pcap.h
|
||||
+++ b/pcap/pcap.h
|
||||
@@ -68,6 +68,7 @@ extern "C" {
|
||||
#define PCAP_VERSION_MINOR 4
|
||||
|
||||
#define PCAP_ERRBUF_SIZE 256
|
||||
+#define HAS_PROTO_EXTENSION
|
||||
|
||||
/*
|
||||
* Compatibility for systems that have a bpf.h that
|
||||
@@ -287,6 +288,7 @@ PCAP_API int pcap_set_timeout(pcap_t *,
|
||||
PCAP_API int pcap_set_tstamp_type(pcap_t *, int);
|
||||
PCAP_API int pcap_set_immediate_mode(pcap_t *, int);
|
||||
PCAP_API int pcap_set_buffer_size(pcap_t *, int);
|
||||
+PCAP_API int pcap_set_protocol(pcap_t *, unsigned short);
|
||||
PCAP_API int pcap_set_tstamp_precision(pcap_t *, int);
|
||||
PCAP_API int pcap_get_tstamp_precision(pcap_t *);
|
||||
PCAP_API int pcap_activate(pcap_t *);
|
||||
--- a/pcap-int.h
|
||||
+++ b/pcap-int.h
|
||||
@@ -111,6 +111,7 @@ struct pcap_opt {
|
||||
char *device;
|
||||
int timeout; /* timeout for buffering */
|
||||
u_int buffer_size;
|
||||
+ int proto; /* protocol for packet socket (linux) */
|
||||
int promisc;
|
||||
int rfmon; /* monitor mode */
|
||||
int immediate; /* immediate mode - deliver packets as soon as they arrive */
|
||||
@@ -2,7 +2,7 @@ Fix USB bus path; /proc/bus/usb is deprecated.
|
||||
|
||||
--- a/pcap-usb-linux.c
|
||||
+++ b/pcap-usb-linux.c
|
||||
@@ -71,7 +71,7 @@
|
||||
@@ -73,7 +73,7 @@
|
||||
#define USB_TEXT_DIR_OLD "/sys/kernel/debug/usbmon"
|
||||
#define USB_TEXT_DIR "/sys/kernel/debug/usb/usbmon"
|
||||
#define SYS_USB_BUS_DIR "/sys/bus/usb/devices"
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=mbedtls
|
||||
PKG_VERSION:=2.16.1
|
||||
PKG_VERSION:=2.16.3
|
||||
PKG_RELEASE:=1
|
||||
PKG_USE_MIPS16:=0
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-gpl.tgz
|
||||
PKG_SOURCE_URL:=https://tls.mbed.org/download/
|
||||
PKG_HASH:=7ab76eaefab0b02f26ca889230d553facb2598f3a8f077886c41ec1801d2131a
|
||||
PKG_HASH:=fd01fe4b289116df7781d05e1ef712b6c98823c5334f4a27404f13a8d066ef6a
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_LICENSE:=GPL-2.0+
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/include/mbedtls/config.h
|
||||
+++ b/include/mbedtls/config.h
|
||||
@@ -599,14 +599,14 @@
|
||||
@@ -633,14 +633,14 @@
|
||||
*
|
||||
* Enable Output Feedback mode (OFB) for symmetric ciphers.
|
||||
*/
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
/**
|
||||
* \def MBEDTLS_CIPHER_NULL_CIPHER
|
||||
@@ -716,19 +716,19 @@
|
||||
@@ -750,19 +750,19 @@
|
||||
*
|
||||
* Comment macros to disable the curve and functions for it
|
||||
*/
|
||||
@@ -46,7 +46,7 @@
|
||||
|
||||
/**
|
||||
* \def MBEDTLS_ECP_NIST_OPTIM
|
||||
@@ -777,7 +777,7 @@
|
||||
@@ -811,7 +811,7 @@
|
||||
*
|
||||
* Comment this macro to disable deterministic ECDSA.
|
||||
*/
|
||||
@@ -55,7 +55,7 @@
|
||||
|
||||
/**
|
||||
* \def MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
|
||||
@@ -830,7 +830,7 @@
|
||||
@@ -864,7 +864,7 @@
|
||||
* See dhm.h for more details.
|
||||
*
|
||||
*/
|
||||
@@ -64,7 +64,7 @@
|
||||
|
||||
/**
|
||||
* \def MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED
|
||||
@@ -850,7 +850,7 @@
|
||||
@@ -884,7 +884,7 @@
|
||||
* MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA
|
||||
* MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA
|
||||
*/
|
||||
@@ -73,7 +73,7 @@
|
||||
|
||||
/**
|
||||
* \def MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED
|
||||
@@ -875,7 +875,7 @@
|
||||
@@ -909,7 +909,7 @@
|
||||
* MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA
|
||||
* MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA
|
||||
*/
|
||||
@@ -82,7 +82,7 @@
|
||||
|
||||
/**
|
||||
* \def MBEDTLS_KEY_EXCHANGE_RSA_ENABLED
|
||||
@@ -1009,7 +1009,7 @@
|
||||
@@ -1043,7 +1043,7 @@
|
||||
* MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256
|
||||
* MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384
|
||||
*/
|
||||
@@ -91,7 +91,7 @@
|
||||
|
||||
/**
|
||||
* \def MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED
|
||||
@@ -1033,7 +1033,7 @@
|
||||
@@ -1067,7 +1067,7 @@
|
||||
* MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256
|
||||
* MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384
|
||||
*/
|
||||
@@ -100,7 +100,7 @@
|
||||
|
||||
/**
|
||||
* \def MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED
|
||||
@@ -1137,7 +1137,7 @@
|
||||
@@ -1171,7 +1171,7 @@
|
||||
* This option is only useful if both MBEDTLS_SHA256_C and
|
||||
* MBEDTLS_SHA512_C are defined. Otherwise the available hash module is used.
|
||||
*/
|
||||
@@ -109,7 +109,7 @@
|
||||
|
||||
/**
|
||||
* \def MBEDTLS_ENTROPY_NV_SEED
|
||||
@@ -1232,14 +1232,14 @@
|
||||
@@ -1266,14 +1266,14 @@
|
||||
* Uncomment this macro to disable the use of CRT in RSA.
|
||||
*
|
||||
*/
|
||||
@@ -126,7 +126,7 @@
|
||||
|
||||
/**
|
||||
* \def MBEDTLS_SHA256_SMALLER
|
||||
@@ -1255,7 +1255,7 @@
|
||||
@@ -1289,7 +1289,7 @@
|
||||
*
|
||||
* Uncomment to enable the smaller implementation of SHA256.
|
||||
*/
|
||||
@@ -135,7 +135,7 @@
|
||||
|
||||
/**
|
||||
* \def MBEDTLS_SSL_ALL_ALERT_MESSAGES
|
||||
@@ -1393,7 +1393,7 @@
|
||||
@@ -1427,7 +1427,7 @@
|
||||
* configuration of this extension).
|
||||
*
|
||||
*/
|
||||
@@ -144,7 +144,7 @@
|
||||
|
||||
/**
|
||||
* \def MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO
|
||||
@@ -1568,7 +1568,7 @@
|
||||
@@ -1602,7 +1602,7 @@
|
||||
*
|
||||
* Comment this macro to disable support for SSL session tickets
|
||||
*/
|
||||
@@ -153,7 +153,7 @@
|
||||
|
||||
/**
|
||||
* \def MBEDTLS_SSL_EXPORT_KEYS
|
||||
@@ -1598,7 +1598,7 @@
|
||||
@@ -1632,7 +1632,7 @@
|
||||
*
|
||||
* Comment this macro to disable support for truncated HMAC in SSL
|
||||
*/
|
||||
@@ -162,7 +162,7 @@
|
||||
|
||||
/**
|
||||
* \def MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT
|
||||
@@ -1657,7 +1657,7 @@
|
||||
@@ -1691,7 +1691,7 @@
|
||||
*
|
||||
* Comment this to disable run-time checking and save ROM space
|
||||
*/
|
||||
@@ -171,7 +171,7 @@
|
||||
|
||||
/**
|
||||
* \def MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3
|
||||
@@ -1987,7 +1987,7 @@
|
||||
@@ -2021,7 +2021,7 @@
|
||||
* MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256
|
||||
* MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256
|
||||
*/
|
||||
@@ -180,7 +180,7 @@
|
||||
|
||||
/**
|
||||
* \def MBEDTLS_ARIA_C
|
||||
@@ -2053,7 +2053,7 @@
|
||||
@@ -2087,7 +2087,7 @@
|
||||
* This module enables the AES-CCM ciphersuites, if other requisites are
|
||||
* enabled as well.
|
||||
*/
|
||||
@@ -189,7 +189,7 @@
|
||||
|
||||
/**
|
||||
* \def MBEDTLS_CERTS_C
|
||||
@@ -2065,7 +2065,7 @@
|
||||
@@ -2099,7 +2099,7 @@
|
||||
*
|
||||
* This module is used for testing (ssl_client/server).
|
||||
*/
|
||||
@@ -198,7 +198,7 @@
|
||||
|
||||
/**
|
||||
* \def MBEDTLS_CHACHA20_C
|
||||
@@ -2074,7 +2074,7 @@
|
||||
@@ -2108,7 +2108,7 @@
|
||||
*
|
||||
* Module: library/chacha20.c
|
||||
*/
|
||||
@@ -207,7 +207,7 @@
|
||||
|
||||
/**
|
||||
* \def MBEDTLS_CHACHAPOLY_C
|
||||
@@ -2085,7 +2085,7 @@
|
||||
@@ -2119,7 +2119,7 @@
|
||||
*
|
||||
* This module requires: MBEDTLS_CHACHA20_C, MBEDTLS_POLY1305_C
|
||||
*/
|
||||
@@ -216,7 +216,7 @@
|
||||
|
||||
/**
|
||||
* \def MBEDTLS_CIPHER_C
|
||||
@@ -2140,7 +2140,7 @@
|
||||
@@ -2174,7 +2174,7 @@
|
||||
*
|
||||
* This module provides debugging functions.
|
||||
*/
|
||||
@@ -225,7 +225,7 @@
|
||||
|
||||
/**
|
||||
* \def MBEDTLS_DES_C
|
||||
@@ -2169,7 +2169,7 @@
|
||||
@@ -2203,7 +2203,7 @@
|
||||
* \warning DES is considered a weak cipher and its use constitutes a
|
||||
* security risk. We recommend considering stronger ciphers instead.
|
||||
*/
|
||||
@@ -234,7 +234,7 @@
|
||||
|
||||
/**
|
||||
* \def MBEDTLS_DHM_C
|
||||
@@ -2332,7 +2332,7 @@
|
||||
@@ -2366,7 +2366,7 @@
|
||||
* This module adds support for the Hashed Message Authentication Code
|
||||
* (HMAC)-based key derivation function (HKDF).
|
||||
*/
|
||||
@@ -243,7 +243,7 @@
|
||||
|
||||
/**
|
||||
* \def MBEDTLS_HMAC_DRBG_C
|
||||
@@ -2346,7 +2346,7 @@
|
||||
@@ -2380,7 +2380,7 @@
|
||||
*
|
||||
* Uncomment to enable the HMAC_DRBG random number geerator.
|
||||
*/
|
||||
@@ -252,7 +252,7 @@
|
||||
|
||||
/**
|
||||
* \def MBEDTLS_NIST_KW_C
|
||||
@@ -2642,7 +2642,7 @@
|
||||
@@ -2676,7 +2676,7 @@
|
||||
*
|
||||
* This module enables abstraction of common (libc) functions.
|
||||
*/
|
||||
@@ -261,7 +261,7 @@
|
||||
|
||||
/**
|
||||
* \def MBEDTLS_POLY1305_C
|
||||
@@ -2652,7 +2652,7 @@
|
||||
@@ -2686,7 +2686,7 @@
|
||||
* Module: library/poly1305.c
|
||||
* Caller: library/chachapoly.c
|
||||
*/
|
||||
@@ -270,7 +270,7 @@
|
||||
|
||||
/**
|
||||
* \def MBEDTLS_RIPEMD160_C
|
||||
@@ -2663,7 +2663,7 @@
|
||||
@@ -2697,7 +2697,7 @@
|
||||
* Caller: library/md.c
|
||||
*
|
||||
*/
|
||||
@@ -279,7 +279,7 @@
|
||||
|
||||
/**
|
||||
* \def MBEDTLS_RSA_C
|
||||
@@ -2770,7 +2770,7 @@
|
||||
@@ -2804,7 +2804,7 @@
|
||||
*
|
||||
* Requires: MBEDTLS_CIPHER_C
|
||||
*/
|
||||
@@ -288,7 +288,7 @@
|
||||
|
||||
/**
|
||||
* \def MBEDTLS_SSL_CLI_C
|
||||
@@ -2870,7 +2870,7 @@
|
||||
@@ -2904,7 +2904,7 @@
|
||||
*
|
||||
* This module provides run-time version information.
|
||||
*/
|
||||
@@ -297,7 +297,7 @@
|
||||
|
||||
/**
|
||||
* \def MBEDTLS_X509_USE_C
|
||||
@@ -2980,7 +2980,7 @@
|
||||
@@ -3014,7 +3014,7 @@
|
||||
* Module: library/xtea.c
|
||||
* Caller:
|
||||
*/
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
From 7aff5a70f3580426865b6c86437a3e47546d13f7 Mon Sep 17 00:00:00 2001
|
||||
From: Hauke Mehrtens <hauke@hauke-m.de>
|
||||
Date: Sun, 16 Dec 2018 13:02:49 +0100
|
||||
Subject: [PATCH] bn_mul.h: Use optimized MULADDC code only on ARM >= 6
|
||||
|
||||
The optimized code uses umaal which was only introduced with ARMv6 and
|
||||
is not available on older versions.
|
||||
This broke compilation with arm926ej-s CPU for me.
|
||||
|
||||
Fixes: 16b1bd89326 ("bn_mul.h: add ARM DSP optimized MULADDC code")
|
||||
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
|
||||
---
|
||||
include/mbedtls/bn_mul.h | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/include/mbedtls/bn_mul.h
|
||||
+++ b/include/mbedtls/bn_mul.h
|
||||
@@ -644,7 +644,8 @@
|
||||
"r6", "r7", "r8", "r9", "cc" \
|
||||
);
|
||||
|
||||
-#elif defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1)
|
||||
+#elif defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1) && \
|
||||
+ __TARGET_ARCH_ARM >= 6
|
||||
|
||||
#define MULADDC_INIT \
|
||||
asm(
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
if(USE_SHARED_MBEDTLS_LIBRARY)
|
||||
add_library(mbedcrypto SHARED ${src_crypto})
|
||||
- set_target_properties(mbedcrypto PROPERTIES VERSION 2.16.1 SOVERSION 3)
|
||||
- set_target_properties(mbedcrypto PROPERTIES VERSION 2.16.3 SOVERSION 3)
|
||||
+ set_target_properties(mbedcrypto PROPERTIES VERSION 2.12.0 SOVERSION 1)
|
||||
target_link_libraries(mbedcrypto ${libs})
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
target_link_libraries(mbedx509 ${libs} mbedcrypto)
|
||||
|
||||
add_library(mbedtls SHARED ${src_tls})
|
||||
- set_target_properties(mbedtls PROPERTIES VERSION 2.16.1 SOVERSION 12)
|
||||
- set_target_properties(mbedtls PROPERTIES VERSION 2.16.3 SOVERSION 12)
|
||||
+ set_target_properties(mbedtls PROPERTIES VERSION 2.12.0 SOVERSION 10)
|
||||
target_link_libraries(mbedtls ${libs} mbedx509)
|
||||
|
||||
@@ -30,5 +30,5 @@
|
||||
-SOEXT_CRYPTO=so.3
|
||||
+SOEXT_CRYPTO=so.1
|
||||
|
||||
# Set AR_DASH= (empty string) to use an ar implentation that does not accept
|
||||
# Set AR_DASH= (empty string) to use an ar implementation that does not accept
|
||||
# the - prefix for command line options (e.g. llvm-ar)
|
||||
|
||||
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=openssl
|
||||
PKG_BASE:=1.0.2
|
||||
PKG_BUGFIX:=s
|
||||
PKG_BUGFIX:=t
|
||||
PKG_VERSION:=$(PKG_BASE)$(PKG_BUGFIX)
|
||||
PKG_RELEASE:=1
|
||||
PKG_USE_MIPS16:=0
|
||||
@@ -24,10 +24,11 @@ PKG_SOURCE_URL:= \
|
||||
http://gd.tuwien.ac.at/infosys/security/openssl/source/ \
|
||||
http://www.openssl.org/source/ \
|
||||
http://www.openssl.org/source/old/$(PKG_BASE)/
|
||||
PKG_HASH:=cabd5c9492825ce5bd23f3c3aeed6a97f8142f606d893df216411f07d1abab96
|
||||
PKG_HASH:=14cb464efe7ac6b54799b34456bd69558a749a4931ecfd9cf9f71d7881cac7bc
|
||||
|
||||
PKG_LICENSE:=OpenSSL
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_MAINTAINER:=Eneas U de Queiroz <cotequeiroz@gmail.com>
|
||||
PKG_CPE_ID:=cpe:/a:openssl:openssl
|
||||
PKG_CONFIG_DEPENDS:= \
|
||||
CONFIG_OPENSSL_ENGINE_CRYPTO \
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/Configure
|
||||
+++ b/Configure
|
||||
@@ -2144,6 +2144,11 @@ EOF
|
||||
@@ -2145,6 +2145,11 @@ EOF
|
||||
close(OUT);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
PKG_NAME:=toolchain
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
PKG_LICENSE:=GPL-3.0-with-GCC-exception
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ustream-ssl
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/ustream-ssl.git
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
From c9b6668215a27f2346d5eedd6f29cc720985b448 Mon Sep 17 00:00:00 2001
|
||||
From: Jo-Philipp Wich <jo@mein.io>
|
||||
Date: Wed, 11 Sep 2019 21:09:59 +0200
|
||||
Subject: [PATCH] ustream-ssl: skip writing pending data if .eof is true after
|
||||
connect
|
||||
|
||||
Check the .eof member of the underlying ustream after the call to
|
||||
__ustream_ssl_connect() since existing users of the library appear
|
||||
to set the eof flag as a way to signal connection termination upon
|
||||
failing certificate verification.
|
||||
|
||||
This is a stop-gap measure to address TALOS-2019-0893 but a proper
|
||||
API redesign is required to give applications proper control over
|
||||
whether certificate failures are to be ignored or not and the default
|
||||
implementation without custom callbacks should always terminate on
|
||||
verification failures.
|
||||
|
||||
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
|
||||
---
|
||||
ustream-ssl.c | 20 ++++++++++++++++++++
|
||||
1 file changed, 20 insertions(+)
|
||||
|
||||
diff --git a/ustream-ssl.c b/ustream-ssl.c
|
||||
index e6b084b..47f66d6 100644
|
||||
--- a/ustream-ssl.c
|
||||
+++ b/ustream-ssl.c
|
||||
@@ -40,6 +40,26 @@ static void ustream_ssl_check_conn(struct ustream_ssl *us)
|
||||
return;
|
||||
|
||||
if (__ustream_ssl_connect(us) == U_SSL_OK) {
|
||||
+
|
||||
+ /* __ustream_ssl_connect() will also return U_SSL_OK when certificate
|
||||
+ * verification failed!
|
||||
+ *
|
||||
+ * Applications may register a custom .notify_verify_error callback in the
|
||||
+ * struct ustream_ssl which is called upon verification failures, but there
|
||||
+ * is no straight forward way for the callback to terminate the connection
|
||||
+ * initiation right away, e.g. through a true or false return value.
|
||||
+ *
|
||||
+ * Instead, existing implementations appear to set .eof field of the underlying
|
||||
+ * ustream in the hope that this inhibits further operations on the stream.
|
||||
+ *
|
||||
+ * Declare this informal behaviour "official" and check for the state of the
|
||||
+ * .eof member after __ustream_ssl_connect() returned, and do not write the
|
||||
+ * pending data if it is set to true.
|
||||
+ */
|
||||
+
|
||||
+ if (us->stream.eof)
|
||||
+ return;
|
||||
+
|
||||
us->connected = true;
|
||||
if (us->notify_connected)
|
||||
us->notify_connected(us);
|
||||
--
|
||||
2.20.1
|
||||
|
||||
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=wolfssl
|
||||
PKG_VERSION:=3.15.3-stable
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).zip
|
||||
# PKG_SOURCE_URL:=https://www.wolfssl.com/
|
||||
@@ -21,7 +21,8 @@ PKG_INSTALL:=1
|
||||
PKG_USE_MIPS16:=0
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_LICENSE:=GPL-2.0+
|
||||
PKG_CPE_ID:=cpe:/a:yassl:cyassl
|
||||
PKG_MAINTAINER:=Eneas U de Queiroz <cotequeiroz@gmail.com>
|
||||
PKG_CPE_ID:=cpe:/a:wolfssl:wolfssl
|
||||
|
||||
PKG_CONFIG_DEPENDS:=\
|
||||
CONFIG_WOLFSSL_HAS_AES_CCM CONFIG_WOLFSSL_HAS_AES_GCM \
|
||||
|
||||
@@ -0,0 +1,562 @@
|
||||
From 278d54d95de9fa80b4ac9f6dd0f900841114ca8c Mon Sep 17 00:00:00 2001
|
||||
From: Sean Parkinson <sean@wolfssl.com>
|
||||
Date: Mon, 27 Aug 2018 10:16:40 +1000
|
||||
Subject: [PATCH] Make RsaUnPad constant time when Block Type 2 message
|
||||
|
||||
(cherry picked from commit ab03f9291b040269ae21d33b9f01529ed8311728)
|
||||
[cherry-pick changes]
|
||||
Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
|
||||
|
||||
--- a/src/internal.c
|
||||
+++ b/src/internal.c
|
||||
@@ -24766,26 +24766,22 @@ static int DoSessionTicket(WOLFSSL* ssl,
|
||||
* indistinguishable from correctly formatted RSA blocks
|
||||
*/
|
||||
|
||||
- ret = args->lastErr;
|
||||
args->lastErr = 0; /* reset */
|
||||
|
||||
/* build PreMasterSecret */
|
||||
ssl->arrays->preMasterSecret[0] = ssl->chVersion.major;
|
||||
ssl->arrays->preMasterSecret[1] = ssl->chVersion.minor;
|
||||
- if (ret == 0 && args->sigSz == SECRET_LEN &&
|
||||
- args->output != NULL) {
|
||||
+ if (args->output != NULL) {
|
||||
XMEMCPY(&ssl->arrays->preMasterSecret[VERSION_SZ],
|
||||
- &args->output[VERSION_SZ],
|
||||
- SECRET_LEN - VERSION_SZ);
|
||||
+ &args->output[VERSION_SZ],
|
||||
+ SECRET_LEN - VERSION_SZ);
|
||||
}
|
||||
- else {
|
||||
- /* preMasterSecret has RNG and version set */
|
||||
- /* return proper length and ignore error */
|
||||
- /* error will be caught as decryption error */
|
||||
- args->sigSz = SECRET_LEN;
|
||||
- ret = 0;
|
||||
- }
|
||||
-
|
||||
+ /* preMasterSecret has RNG and version set
|
||||
+ * return proper length and ignore error
|
||||
+ * error will be caught as decryption error
|
||||
+ */
|
||||
+ args->sigSz = SECRET_LEN;
|
||||
+ ret = 0;
|
||||
break;
|
||||
} /* rsa_kea */
|
||||
#endif /* !NO_RSA */
|
||||
--- a/src/tls.c
|
||||
+++ b/src/tls.c
|
||||
@@ -1136,12 +1136,12 @@ static int Hmac_UpdateFinal_CT(Hmac* hma
|
||||
else if (k < maxLen)
|
||||
b = in[k - WOLFSSL_TLS_HMAC_INNER_SZ];
|
||||
|
||||
- b = ctMaskSel(atEoc, b, 0x80);
|
||||
+ b = ctMaskSel(atEoc, 0x80, b);
|
||||
b &= ~pastEoc;
|
||||
b &= ~isOutBlock | isEocBlock;
|
||||
|
||||
if (j >= blockSz - 8) {
|
||||
- b = ctMaskSel(isOutBlock, b, lenBytes[j - (blockSz - 8)]);
|
||||
+ b = ctMaskSel(isOutBlock, lenBytes[j - (blockSz - 8)], b);
|
||||
}
|
||||
|
||||
hashBlock[j] = b;
|
||||
--- a/wolfcrypt/src/integer.c
|
||||
+++ b/wolfcrypt/src/integer.c
|
||||
@@ -321,6 +321,17 @@ int mp_to_unsigned_bin (mp_int * a, unsi
|
||||
return res;
|
||||
}
|
||||
|
||||
+int mp_to_unsigned_bin_len(mp_int * a, unsigned char *b, int c)
|
||||
+{
|
||||
+ int i, len;
|
||||
+
|
||||
+ len = mp_unsigned_bin_size(a);
|
||||
+
|
||||
+ /* pad front w/ zeros to match length */
|
||||
+ for (i = 0; i < c - len; i++)
|
||||
+ b[i] = 0x00;
|
||||
+ return mp_to_unsigned_bin(a, b + i);
|
||||
+}
|
||||
|
||||
/* creates "a" then copies b into it */
|
||||
int mp_init_copy (mp_int * a, mp_int * b)
|
||||
--- a/wolfcrypt/src/misc.c
|
||||
+++ b/wolfcrypt/src/misc.c
|
||||
@@ -341,10 +341,22 @@ STATIC INLINE byte ctMaskEq(int a, int b
|
||||
return 0 - (a == b);
|
||||
}
|
||||
|
||||
-/* Constant time - select b when mask is set and a otherwise. */
|
||||
+/* Constant time - mask set when a != b. */
|
||||
+STATIC INLINE byte ctMaskNotEq(int a, int b)
|
||||
+{
|
||||
+ return 0 - (a != b);
|
||||
+}
|
||||
+
|
||||
+/* Constant time - select a when mask is set and b otherwise. */
|
||||
STATIC INLINE byte ctMaskSel(byte m, byte a, byte b)
|
||||
{
|
||||
- return (a & ~m) | (b & m);
|
||||
+ return (b & ~m) | (a & m);
|
||||
+}
|
||||
+
|
||||
+/* Constant time - select integer a when mask is set and integer b otherwise. */
|
||||
+STATIC INLINE int ctMaskSelInt(byte m, int a, int b)
|
||||
+{
|
||||
+ return (b & (~(int)(char)m)) | (a & ((int)(char)m));
|
||||
}
|
||||
|
||||
/* Constant time - bit set when a <= b. */
|
||||
--- a/wolfcrypt/src/rsa.c
|
||||
+++ b/wolfcrypt/src/rsa.c
|
||||
@@ -989,10 +989,8 @@ static int RsaUnPad_OAEP(byte *pkcsBlock
|
||||
ret += pkcsBlock[idx++] ^ 0x01; /* separator value is 0x01 */
|
||||
ret += pkcsBlock[0] ^ 0x00; /* Y, the first value, should be 0 */
|
||||
|
||||
- if (ret != 0) {
|
||||
- WOLFSSL_MSG("RsaUnPad_OAEP: Padding Error");
|
||||
- return BAD_PADDING_E;
|
||||
- }
|
||||
+ /* Return 0 data length on error. */
|
||||
+ idx = ctMaskSelInt(ctMaskEq(ret, 0), idx, pkcsBlockLen);
|
||||
|
||||
/* adjust pointer to correct location in array and return size of M */
|
||||
*output = (byte*)(pkcsBlock + idx);
|
||||
@@ -1078,48 +1076,60 @@ static int RsaUnPad_PSS(byte *pkcsBlock,
|
||||
/* UnPad plaintext, set start to *output, return length of plaintext,
|
||||
* < 0 on error */
|
||||
static int RsaUnPad(const byte *pkcsBlock, unsigned int pkcsBlockLen,
|
||||
- byte **output, byte padValue)
|
||||
+ byte **output, byte padValue)
|
||||
{
|
||||
- word32 maxOutputLen = (pkcsBlockLen > 10) ? (pkcsBlockLen - 10) : 0;
|
||||
- word32 invalid = 0;
|
||||
- word32 i = 1;
|
||||
- word32 outputLen;
|
||||
+ int ret;
|
||||
+ word32 i;
|
||||
+ byte invalid = 0;
|
||||
|
||||
if (output == NULL || pkcsBlockLen == 0) {
|
||||
return BAD_FUNC_ARG;
|
||||
}
|
||||
|
||||
- if (pkcsBlock[0] != 0x0) { /* skip past zero */
|
||||
- invalid = 1;
|
||||
- }
|
||||
- pkcsBlock++; pkcsBlockLen--;
|
||||
+ if (padValue == RSA_BLOCK_TYPE_1) {
|
||||
+ /* First byte must be 0x00 and Second byte, block type, 0x01 */
|
||||
+ if (pkcsBlock[0] != 0 || pkcsBlock[1] != RSA_BLOCK_TYPE_1) {
|
||||
+ WOLFSSL_MSG("RsaUnPad error, invalid formatting");
|
||||
+ return RSA_PAD_E;
|
||||
+ }
|
||||
|
||||
- /* Require block type padValue */
|
||||
- invalid = (pkcsBlock[0] != padValue) || invalid;
|
||||
+ /* check the padding until we find the separator */
|
||||
+ for (i = 2; i < pkcsBlockLen && pkcsBlock[i++] == 0xFF; ) { }
|
||||
|
||||
- /* verify the padding until we find the separator */
|
||||
- if (padValue == RSA_BLOCK_TYPE_1) {
|
||||
- while (i<pkcsBlockLen && pkcsBlock[i++] == 0xFF) {/* Null body */}
|
||||
- }
|
||||
- else {
|
||||
- while (i<pkcsBlockLen && pkcsBlock[i++]) {/* Null body */}
|
||||
- }
|
||||
+ /* Minimum of 11 bytes of pre-message data and must have separator. */
|
||||
+ if (i < RSA_MIN_PAD_SZ || pkcsBlock[i-1] != 0) {
|
||||
+ WOLFSSL_MSG("RsaUnPad error, bad formatting");
|
||||
+ return RSA_PAD_E;
|
||||
+ }
|
||||
|
||||
- if (!(i==pkcsBlockLen || pkcsBlock[i-1]==0)) {
|
||||
- WOLFSSL_MSG("RsaUnPad error, bad formatting");
|
||||
- return RSA_PAD_E;
|
||||
+ *output = (byte *)(pkcsBlock + i);
|
||||
+ ret = pkcsBlockLen - i;
|
||||
}
|
||||
+ else {
|
||||
+ word32 j;
|
||||
+ byte pastSep = 0;
|
||||
|
||||
- outputLen = pkcsBlockLen - i;
|
||||
- invalid = (outputLen > maxOutputLen) || invalid;
|
||||
+ /* Decrypted with private key - unpad must be constant time. */
|
||||
+ for (i = 0, j = 2; j < pkcsBlockLen; j++) {
|
||||
+ /* Update i if not passed the separator and at separator. */
|
||||
+ i |= (~pastSep) & ctMaskEq(pkcsBlock[j], 0x00) & (j + 1);
|
||||
+ pastSep |= ctMaskEq(pkcsBlock[j], 0x00);
|
||||
+ }
|
||||
+
|
||||
+ /* Minimum of 11 bytes of pre-message data - including leading 0x00. */
|
||||
+ invalid |= ctMaskLT(i, RSA_MIN_PAD_SZ);
|
||||
+ /* Must have seen separator. */
|
||||
+ invalid |= ~pastSep;
|
||||
+ /* First byte must be 0x00. */
|
||||
+ invalid |= ctMaskNotEq(pkcsBlock[0], 0x00);
|
||||
+ /* Check against expected block type: padValue */
|
||||
+ invalid |= ctMaskNotEq(pkcsBlock[1], padValue);
|
||||
|
||||
- if (invalid) {
|
||||
- WOLFSSL_MSG("RsaUnPad error, invalid formatting");
|
||||
- return RSA_PAD_E;
|
||||
+ *output = (byte *)(pkcsBlock + i);
|
||||
+ ret = ((int)~invalid) & (pkcsBlockLen - i);
|
||||
}
|
||||
|
||||
- *output = (byte *)(pkcsBlock + i);
|
||||
- return outputLen;
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
/* helper function to direct unpadding
|
||||
@@ -1249,7 +1259,7 @@ static int wc_RsaFunctionSync(const byte
|
||||
mp_int rnd, rndi;
|
||||
#endif
|
||||
int ret = 0;
|
||||
- word32 keyLen, len;
|
||||
+ word32 keyLen;
|
||||
#endif
|
||||
|
||||
#ifdef WOLFSSL_HAVE_SP_RSA
|
||||
@@ -1308,6 +1318,7 @@ static int wc_RsaFunctionSync(const byte
|
||||
}
|
||||
#endif
|
||||
|
||||
+#ifndef TEST_UNPAD_CONSTANT_TIME
|
||||
if (mp_read_unsigned_bin(&tmp, (byte*)in, inLen) != MP_OKAY)
|
||||
ERROR_OUT(MP_READ_E);
|
||||
|
||||
@@ -1418,21 +1429,18 @@ static int wc_RsaFunctionSync(const byte
|
||||
ERROR_OUT(RSA_BUFFER_E);
|
||||
}
|
||||
|
||||
- len = mp_unsigned_bin_size(&tmp);
|
||||
-
|
||||
- /* pad front w/ zeros to match key length */
|
||||
- while (len < keyLen) {
|
||||
- *out++ = 0x00;
|
||||
- len++;
|
||||
- }
|
||||
-
|
||||
*outLen = keyLen;
|
||||
-
|
||||
- /* convert */
|
||||
- if (mp_to_unsigned_bin(&tmp, out) != MP_OKAY)
|
||||
+ if (mp_to_unsigned_bin_len(&tmp, out, keyLen) != MP_OKAY)
|
||||
ERROR_OUT(MP_TO_E);
|
||||
|
||||
done:
|
||||
+#else
|
||||
+ (void)type;
|
||||
+ (void)key;
|
||||
+ (void)keyLen;
|
||||
+ XMEMCPY(out, in, inLen);
|
||||
+ *outLen = inLen;
|
||||
+#endif
|
||||
mp_clear(&tmp);
|
||||
#ifdef WC_RSA_BLINDING
|
||||
if (type == RSA_PRIVATE_DECRYPT || type == RSA_PRIVATE_ENCRYPT) {
|
||||
@@ -1633,6 +1641,7 @@ int wc_RsaFunction(const byte* in, word3
|
||||
}
|
||||
#endif
|
||||
|
||||
+#ifndef TEST_UNPAD_CONSTANT_TIME
|
||||
#ifndef NO_RSA_BOUNDS_CHECK
|
||||
if (type == RSA_PRIVATE_DECRYPT &&
|
||||
key->state == RSA_STATE_DECRYPT_EXPTMOD) {
|
||||
@@ -1667,6 +1676,7 @@ int wc_RsaFunction(const byte* in, word3
|
||||
return ret;
|
||||
}
|
||||
#endif /* NO_RSA_BOUNDS_CHECK */
|
||||
+#endif
|
||||
|
||||
#if defined(WOLFSSL_ASYNC_CRYPT) && defined(WC_ASYNC_ENABLE_RSA)
|
||||
if (key->asyncDev.marker == WOLFSSL_ASYNC_MARKER_RSA &&
|
||||
@@ -1880,7 +1890,8 @@ static int RsaPrivateDecryptEx(byte* in,
|
||||
|
||||
/* if not doing this inline then allocate a buffer for it */
|
||||
if (outPtr == NULL) {
|
||||
- key->data = (byte*)XMALLOC(inLen, key->heap, DYNAMIC_TYPE_WOLF_BIGINT);
|
||||
+ key->data = (byte*)XMALLOC(inLen, key->heap,
|
||||
+ DYNAMIC_TYPE_WOLF_BIGINT);
|
||||
key->dataIsAlloc = 1;
|
||||
if (key->data == NULL) {
|
||||
ret = MEMORY_E;
|
||||
@@ -1909,20 +1920,29 @@ static int RsaPrivateDecryptEx(byte* in,
|
||||
ret = wc_RsaUnPad_ex(key->data, key->dataLen, &pad, pad_value, pad_type,
|
||||
hash, mgf, label, labelSz, saltLen,
|
||||
mp_count_bits(&key->n), key->heap);
|
||||
- if (ret > 0 && ret <= (int)outLen && pad != NULL) {
|
||||
+ if (rsa_type == RSA_PUBLIC_DECRYPT && ret > (int)outLen)
|
||||
+ ret = RSA_BUFFER_E;
|
||||
+ else if (ret >= 0 && pad != NULL) {
|
||||
+ char c;
|
||||
+
|
||||
/* only copy output if not inline */
|
||||
if (outPtr == NULL) {
|
||||
- XMEMCPY(out, pad, ret);
|
||||
+ word32 i, j;
|
||||
+ int start = (int)((size_t)pad - (size_t)key->data);
|
||||
+
|
||||
+ for (i = 0, j = 0; j < key->dataLen; j++) {
|
||||
+ out[i] = key->data[j];
|
||||
+ c = ctMaskGTE(j, start);
|
||||
+ c &= ctMaskLT(i, outLen);
|
||||
+ /* 0 - no add, -1 add */
|
||||
+ i += -c;
|
||||
+ }
|
||||
}
|
||||
- else {
|
||||
+ else
|
||||
*outPtr = pad;
|
||||
- }
|
||||
- }
|
||||
- else if (ret >= 0) {
|
||||
- ret = RSA_BUFFER_E;
|
||||
- }
|
||||
- if (ret < 0) {
|
||||
- break;
|
||||
+
|
||||
+ ret = ctMaskSelInt(ctMaskLTE(ret, outLen), ret, RSA_BUFFER_E);
|
||||
+ ret = ctMaskSelInt(ctMaskNotEq(ret, 0), ret, RSA_BUFFER_E);
|
||||
}
|
||||
|
||||
key->state = RSA_STATE_DECRYPT_RES;
|
||||
@@ -1934,12 +1954,14 @@ static int RsaPrivateDecryptEx(byte* in,
|
||||
defined(HAVE_CAVIUM)
|
||||
if (key->asyncDev.marker == WOLFSSL_ASYNC_MARKER_RSA &&
|
||||
pad_type != WC_RSA_PSS_PAD) {
|
||||
- /* convert result */
|
||||
- byte* dataLen = (byte*)&key->dataLen;
|
||||
- ret = (dataLen[0] << 8) | (dataLen[1]);
|
||||
+ if (ret > 0) {
|
||||
+ /* convert result */
|
||||
+ byte* dataLen = (byte*)&key->dataLen;
|
||||
+ ret = (dataLen[0] << 8) | (dataLen[1]);
|
||||
|
||||
- if (outPtr)
|
||||
- *outPtr = in;
|
||||
+ if (outPtr)
|
||||
+ *outPtr = in;
|
||||
+ }
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
--- a/wolfcrypt/src/sp_int.c
|
||||
+++ b/wolfcrypt/src/sp_int.c
|
||||
@@ -286,7 +286,8 @@ int sp_leading_bit(sp_int* a)
|
||||
* The array must be large enough for encoded number - use mp_unsigned_bin_size
|
||||
* to calculate the number of bytes required.
|
||||
*
|
||||
- * a SP integer.
|
||||
+ * a SP integer.
|
||||
+ * out Array to put encoding into.
|
||||
* returns MP_OKAY always.
|
||||
*/
|
||||
int sp_to_unsigned_bin(sp_int* a, byte* out)
|
||||
@@ -305,6 +306,31 @@ int sp_to_unsigned_bin(sp_int* a, byte*
|
||||
return MP_OKAY;
|
||||
}
|
||||
|
||||
+/* Convert the big number to an array of bytes in big-endian format.
|
||||
+ * The array must be large enough for encoded number - use mp_unsigned_bin_size
|
||||
+ * to calculate the number of bytes required.
|
||||
+ * Front-pads the output array with zeros make number the size of the array.
|
||||
+ *
|
||||
+ * a SP integer.
|
||||
+ * out Array to put encoding into.
|
||||
+ * outSz Size of the array.
|
||||
+ * returns MP_OKAY always.
|
||||
+ */
|
||||
+int sp_to_unsigned_bin_len(sp_int* a, byte* out, int outSz)
|
||||
+{
|
||||
+ int i, j, b;
|
||||
+
|
||||
+ j = outSz - 1;
|
||||
+ for (i=0; j>=0; i++) {
|
||||
+ for (b = 0; b < SP_WORD_SIZE; b += 8) {
|
||||
+ out[j--] = a->dp[i] >> b;
|
||||
+ if (j < 0)
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return MP_OKAY;
|
||||
+}
|
||||
/* Ensure the data in the big number is zeroed.
|
||||
*
|
||||
* a SP integer.
|
||||
--- a/wolfcrypt/src/tfm.c
|
||||
+++ b/wolfcrypt/src/tfm.c
|
||||
@@ -1964,6 +1964,48 @@ void fp_to_unsigned_bin(fp_int *a, unsig
|
||||
fp_reverse (b, x);
|
||||
}
|
||||
|
||||
+int fp_to_unsigned_bin_len(fp_int *a, unsigned char *b, int c)
|
||||
+{
|
||||
+#if DIGIT_BIT == 64 || DIGIT_BIT == 32
|
||||
+ int i, j, x;
|
||||
+
|
||||
+ for (x=c-1,j=0,i=0; x >= 0; x--) {
|
||||
+ b[x] = (unsigned char)(a->dp[i] >> j);
|
||||
+ j += 8;
|
||||
+ i += j == DIGIT_BIT;
|
||||
+ j &= DIGIT_BIT - 1;
|
||||
+ }
|
||||
+
|
||||
+ return FP_OKAY;
|
||||
+#else
|
||||
+ int x;
|
||||
+#ifndef WOLFSSL_SMALL_STACK
|
||||
+ fp_int t[1];
|
||||
+#else
|
||||
+ fp_int *t;
|
||||
+#endif
|
||||
+
|
||||
+#ifdef WOLFSSL_SMALL_STACK
|
||||
+ t = (fp_int*)XMALLOC(sizeof(fp_int), NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
||||
+ if (t == NULL)
|
||||
+ return FP_MEM;
|
||||
+#endif
|
||||
+
|
||||
+ fp_init_copy(t, a);
|
||||
+
|
||||
+ for (x = 0; x < c; x++) {
|
||||
+ b[x] = (unsigned char) (t->dp[0] & 255);
|
||||
+ fp_div_2d (t, 8, t, NULL);
|
||||
+ }
|
||||
+ fp_reverse (b, x);
|
||||
+
|
||||
+#ifdef WOLFSSL_SMALL_STACK
|
||||
+ XFREE(t, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
||||
+#endif
|
||||
+ return FP_OKAY;
|
||||
+#endif
|
||||
+}
|
||||
+
|
||||
int fp_unsigned_bin_size(fp_int *a)
|
||||
{
|
||||
int size = fp_count_bits (a);
|
||||
@@ -2435,6 +2477,10 @@ int mp_to_unsigned_bin (mp_int * a, unsi
|
||||
return MP_OKAY;
|
||||
}
|
||||
|
||||
+int mp_to_unsigned_bin_len(mp_int * a, unsigned char *b, int c)
|
||||
+{
|
||||
+ return fp_to_unsigned_bin_len(a, b, c);
|
||||
+}
|
||||
/* reads a unsigned char array, assumes the msb is stored first [big endian] */
|
||||
int mp_read_unsigned_bin (mp_int * a, const unsigned char *b, int c)
|
||||
{
|
||||
--- a/wolfssl/wolfcrypt/integer.h
|
||||
+++ b/wolfssl/wolfcrypt/integer.h
|
||||
@@ -277,6 +277,7 @@ MP_API int mp_unsigned_bin_size(mp_int
|
||||
MP_API int mp_read_unsigned_bin (mp_int * a, const unsigned char *b, int c);
|
||||
MP_API int mp_to_unsigned_bin_at_pos(int x, mp_int *t, unsigned char *b);
|
||||
MP_API int mp_to_unsigned_bin (mp_int * a, unsigned char *b);
|
||||
+MP_API int mp_to_unsigned_bin_len(mp_int * a, unsigned char *b, int c);
|
||||
MP_API int mp_exptmod (mp_int * G, mp_int * X, mp_int * P, mp_int * Y);
|
||||
/* end functions needed by Rsa */
|
||||
|
||||
--- a/wolfssl/wolfcrypt/misc.h
|
||||
+++ b/wolfssl/wolfcrypt/misc.h
|
||||
@@ -97,7 +97,9 @@ WOLFSSL_LOCAL byte ctMaskGTE(int a, int
|
||||
WOLFSSL_LOCAL byte ctMaskLT(int a, int b);
|
||||
WOLFSSL_LOCAL byte ctMaskLTE(int a, int b);
|
||||
WOLFSSL_LOCAL byte ctMaskEq(int a, int b);
|
||||
+WOLFSSL_LOCAL byte ctMaskNotEq(int a, int b);
|
||||
WOLFSSL_LOCAL byte ctMaskSel(byte m, byte a, byte b);
|
||||
+WOLFSSL_LOCAL int ctMaskSelInt(byte m, int a, int b);
|
||||
WOLFSSL_LOCAL byte ctSetLTE(int a, int b);
|
||||
|
||||
#endif /* NO_INLINE */
|
||||
--- a/wolfssl/wolfcrypt/sp_int.h
|
||||
+++ b/wolfssl/wolfcrypt/sp_int.h
|
||||
@@ -119,7 +119,8 @@ MP_API int sp_read_radix(sp_int* a, cons
|
||||
MP_API int sp_cmp(sp_int* a, sp_int* b);
|
||||
MP_API int sp_count_bits(sp_int* a);
|
||||
MP_API int sp_leading_bit(sp_int* a);
|
||||
-MP_API int sp_to_unsigned_bin(sp_int* a, byte* in);
|
||||
+MP_API int sp_to_unsigned_bin(sp_int* a, byte* out);
|
||||
+MP_API int sp_to_unsigned_bin_len(sp_int* a, byte* out, int outSz);
|
||||
MP_API void sp_forcezero(sp_int* a);
|
||||
MP_API int sp_copy(sp_int* a, sp_int* b);
|
||||
MP_API int sp_set(sp_int* a, sp_int_digit d);
|
||||
@@ -156,30 +157,31 @@ typedef sp_digit mp_digit;
|
||||
|
||||
#define mp_free(a)
|
||||
|
||||
-#define mp_init sp_init
|
||||
-#define mp_init_multi sp_init_multi
|
||||
-#define mp_clear sp_clear
|
||||
-#define mp_read_unsigned_bin sp_read_unsigned_bin
|
||||
-#define mp_unsigned_bin_size sp_unsigned_bin_size
|
||||
-#define mp_read_radix sp_read_radix
|
||||
-#define mp_cmp sp_cmp
|
||||
-#define mp_count_bits sp_count_bits
|
||||
-#define mp_leading_bit sp_leading_bit
|
||||
-#define mp_to_unsigned_bin sp_to_unsigned_bin
|
||||
-#define mp_forcezero sp_forcezero
|
||||
-#define mp_copy sp_copy
|
||||
-#define mp_set sp_set
|
||||
-#define mp_iszero sp_iszero
|
||||
-#define mp_clamp sp_clamp
|
||||
-#define mp_grow sp_grow
|
||||
-#define mp_sub_d sp_sub_d
|
||||
-#define mp_cmp_d sp_cmp_d
|
||||
-#define mp_mod sp_mod
|
||||
-#define mp_zero sp_zero
|
||||
-#define mp_add_d sp_add_d
|
||||
-#define mp_lshd sp_lshd
|
||||
-#define mp_add sp_add
|
||||
-#define mp_isodd sp_isodd
|
||||
+#define mp_init sp_init
|
||||
+#define mp_init_multi sp_init_multi
|
||||
+#define mp_clear sp_clear
|
||||
+#define mp_read_unsigned_bin sp_read_unsigned_bin
|
||||
+#define mp_unsigned_bin_size sp_unsigned_bin_size
|
||||
+#define mp_read_radix sp_read_radix
|
||||
+#define mp_cmp sp_cmp
|
||||
+#define mp_count_bits sp_count_bits
|
||||
+#define mp_leading_bit sp_leading_bit
|
||||
+#define mp_to_unsigned_bin sp_to_unsigned_bin
|
||||
+#define mp_to_unsigned_bin_len sp_to_unsigned_bin_len
|
||||
+#define mp_forcezero sp_forcezero
|
||||
+#define mp_copy sp_copy
|
||||
+#define mp_set sp_set
|
||||
+#define mp_iszero sp_iszero
|
||||
+#define mp_clamp sp_clamp
|
||||
+#define mp_grow sp_grow
|
||||
+#define mp_sub_d sp_sub_d
|
||||
+#define mp_cmp_d sp_cmp_d
|
||||
+#define mp_mod sp_mod
|
||||
+#define mp_zero sp_zero
|
||||
+#define mp_add_d sp_add_d
|
||||
+#define mp_lshd sp_lshd
|
||||
+#define mp_add sp_add
|
||||
+#define mp_isodd sp_isodd
|
||||
|
||||
#define MP_INT_DEFINED
|
||||
|
||||
--- a/wolfssl/wolfcrypt/tfm.h
|
||||
+++ b/wolfssl/wolfcrypt/tfm.h
|
||||
@@ -563,6 +563,7 @@ int fp_leading_bit(fp_int *a);
|
||||
int fp_unsigned_bin_size(fp_int *a);
|
||||
void fp_read_unsigned_bin(fp_int *a, const unsigned char *b, int c);
|
||||
void fp_to_unsigned_bin(fp_int *a, unsigned char *b);
|
||||
+int fp_to_unsigned_bin_len(fp_int *a, unsigned char *b, int c);
|
||||
int fp_to_unsigned_bin_at_pos(int x, fp_int *t, unsigned char *b);
|
||||
|
||||
/*int fp_signed_bin_size(fp_int *a);*/
|
||||
@@ -686,6 +687,7 @@ MP_API int mp_unsigned_bin_size(mp_int
|
||||
MP_API int mp_read_unsigned_bin (mp_int * a, const unsigned char *b, int c);
|
||||
MP_API int mp_to_unsigned_bin_at_pos(int x, mp_int *t, unsigned char *b);
|
||||
MP_API int mp_to_unsigned_bin (mp_int * a, unsigned char *b);
|
||||
+MP_API int mp_to_unsigned_bin_len(mp_int * a, unsigned char *b, int c);
|
||||
|
||||
MP_API int mp_sub_d(fp_int *a, fp_digit b, fp_int *c);
|
||||
MP_API int mp_copy(fp_int* a, fp_int* b);
|
||||
@@ -0,0 +1,98 @@
|
||||
From ba4d612892bf6e3aae9cca7edce2a6d6b43e3e22 Mon Sep 17 00:00:00 2001
|
||||
From: Sean Parkinson <sean@wolfssl.com>
|
||||
Date: Wed, 17 Jul 2019 08:26:02 +1000
|
||||
Subject: [PATCH] Improve nonce use in ECC mulmod
|
||||
|
||||
(cherry picked from commit 483f6a5acd9808b405306661c121aa6407464dc2)
|
||||
|
||||
--- a/wolfcrypt/src/ecc.c
|
||||
+++ b/wolfcrypt/src/ecc.c
|
||||
@@ -2039,7 +2039,7 @@ int wc_ecc_mulmod_ex(mp_int* k, ecc_poin
|
||||
#define M_POINTS 8
|
||||
int first = 1, bitbuf = 0, bitcpy = 0, j;
|
||||
#else
|
||||
- #define M_POINTS 3
|
||||
+ #define M_POINTS 4
|
||||
#endif
|
||||
|
||||
ecc_point *tG, *M[M_POINTS];
|
||||
@@ -2253,7 +2253,9 @@ int wc_ecc_mulmod_ex(mp_int* k, ecc_poin
|
||||
mode = 0;
|
||||
bitcnt = 1;
|
||||
buf = 0;
|
||||
- digidx = get_digit_count(k) - 1;
|
||||
+ digidx = get_digit_count(modulus) - 1;
|
||||
+ /* The order MAY be 1 bit longer than the modulus. */
|
||||
+ digidx += (modulus->dp[digidx] >> (DIGIT_BIT-1));
|
||||
|
||||
/* perform ops */
|
||||
if (err == MP_OKAY) {
|
||||
@@ -2272,25 +2274,53 @@ int wc_ecc_mulmod_ex(mp_int* k, ecc_poin
|
||||
i = (buf >> (DIGIT_BIT - 1)) & 1;
|
||||
buf <<= 1;
|
||||
|
||||
- if (mode == 0 && i == 0) {
|
||||
+ if (mode == 0) {
|
||||
+ mode = i;
|
||||
/* timing resistant - dummy operations */
|
||||
if (err == MP_OKAY)
|
||||
- err = ecc_projective_add_point(M[0], M[1], M[2], a, modulus,
|
||||
+ err = ecc_projective_add_point(M[1], M[2], M[2], a, modulus,
|
||||
mp);
|
||||
+#ifdef WC_NO_CACHE_RESISTANT
|
||||
if (err == MP_OKAY)
|
||||
- err = ecc_projective_dbl_point(M[1], M[2], a, modulus, mp);
|
||||
- if (err == MP_OKAY)
|
||||
- continue;
|
||||
- }
|
||||
-
|
||||
- if (mode == 0 && i == 1) {
|
||||
- mode = 1;
|
||||
- /* timing resistant - dummy operations */
|
||||
- if (err == MP_OKAY)
|
||||
- err = ecc_projective_add_point(M[0], M[1], M[2], a, modulus,
|
||||
- mp);
|
||||
- if (err == MP_OKAY)
|
||||
- err = ecc_projective_dbl_point(M[1], M[2], a, modulus, mp);
|
||||
+ err = ecc_projective_dbl_point(M[2], M[3], a, modulus, mp);
|
||||
+#else
|
||||
+ /* instead of using M[i] for double, which leaks key bit to cache
|
||||
+ * monitor, use M[2] as temp, make sure address calc is constant,
|
||||
+ * keep M[0] and M[1] in cache */
|
||||
+ if (err == MP_OKAY)
|
||||
+ err = mp_copy((mp_int*)
|
||||
+ ( ((wolfssl_word)M[0]->x & wc_off_on_addr[i^1]) +
|
||||
+ ((wolfssl_word)M[1]->x & wc_off_on_addr[i])),
|
||||
+ M[2]->x);
|
||||
+ if (err == MP_OKAY)
|
||||
+ err = mp_copy((mp_int*)
|
||||
+ ( ((wolfssl_word)M[0]->y & wc_off_on_addr[i^1]) +
|
||||
+ ((wolfssl_word)M[1]->y & wc_off_on_addr[i])),
|
||||
+ M[2]->y);
|
||||
+ if (err == MP_OKAY)
|
||||
+ err = mp_copy((mp_int*)
|
||||
+ ( ((wolfssl_word)M[0]->z & wc_off_on_addr[i^1]) +
|
||||
+ ((wolfssl_word)M[1]->z & wc_off_on_addr[i])),
|
||||
+ M[2]->z);
|
||||
+ if (err == MP_OKAY)
|
||||
+ err = ecc_projective_dbl_point(M[2], M[3], a, modulus, mp);
|
||||
+ /* copy M[2] back to M[i] */
|
||||
+ if (err == MP_OKAY)
|
||||
+ err = mp_copy(M[2]->x,
|
||||
+ (mp_int*)
|
||||
+ ( ((wolfssl_word)M[0]->x & wc_off_on_addr[i^1]) +
|
||||
+ ((wolfssl_word)M[1]->x & wc_off_on_addr[i])) );
|
||||
+ if (err == MP_OKAY)
|
||||
+ err = mp_copy(M[2]->y,
|
||||
+ (mp_int*)
|
||||
+ ( ((wolfssl_word)M[0]->y & wc_off_on_addr[i^1]) +
|
||||
+ ((wolfssl_word)M[1]->y & wc_off_on_addr[i])) );
|
||||
+ if (err == MP_OKAY)
|
||||
+ err = mp_copy(M[2]->z,
|
||||
+ (mp_int*)
|
||||
+ ( ((wolfssl_word)M[0]->z & wc_off_on_addr[i^1]) +
|
||||
+ ((wolfssl_word)M[1]->z & wc_off_on_addr[i])) );
|
||||
+#endif
|
||||
if (err == MP_OKAY)
|
||||
continue;
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -4140,7 +4140,6 @@ AC_CONFIG_FILES([support/wolfssl.pc])
|
||||
AC_CONFIG_FILES([rpm/spec])
|
||||
@@ -4198,7 +4198,6 @@ AC_CONFIG_FILES([stamp-h], [echo timesta
|
||||
AC_CONFIG_FILES([Makefile wolfssl/version.h wolfssl/options.h cyassl/options.h support/wolfssl.pc rpm/spec])
|
||||
|
||||
AX_CREATE_GENERIC_CONFIG
|
||||
-AX_AM_JOBSERVER([yes])
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=hostapd
|
||||
PKG_RELEASE:=6
|
||||
PKG_RELEASE:=8
|
||||
|
||||
PKG_SOURCE_URL:=http://w1.fi/hostap.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
From 92e1b96c26a84e503847bdd22ebadf697c4031ad Mon Sep 17 00:00:00 2001
|
||||
From: Jouni Malinen <j@w1.fi>
|
||||
Date: Sat, 13 Apr 2019 17:20:57 +0300
|
||||
Subject: EAP-pwd: Disallow ECC groups with a prime under 256 bits
|
||||
|
||||
Based on the SAE implementation guidance update to not allow ECC groups
|
||||
with a prime that is under 256 bits, reject groups 25, 26, and 27 in
|
||||
EAP-pwd.
|
||||
|
||||
Signed-off-by: Jouni Malinen <j@w1.fi>
|
||||
---
|
||||
src/eap_common/eap_pwd_common.c | 13 +++++++++++++
|
||||
1 file changed, 13 insertions(+)
|
||||
|
||||
--- a/src/eap_common/eap_pwd_common.c
|
||||
+++ b/src/eap_common/eap_pwd_common.c
|
||||
@@ -85,10 +85,23 @@ static int eap_pwd_kdf(const u8 *key, si
|
||||
}
|
||||
|
||||
|
||||
+static int eap_pwd_suitable_group(u16 num)
|
||||
+{
|
||||
+ /* Do not allow ECC groups with prime under 256 bits based on guidance
|
||||
+ * for the similar design in SAE. */
|
||||
+ return num == 19 || num == 20 || num == 21 ||
|
||||
+ num == 28 || num == 29 || num == 30;
|
||||
+}
|
||||
+
|
||||
+
|
||||
EAP_PWD_group * get_eap_pwd_group(u16 num)
|
||||
{
|
||||
EAP_PWD_group *grp;
|
||||
|
||||
+ if (!eap_pwd_suitable_group(num)) {
|
||||
+ wpa_printf(MSG_INFO, "EAP-pwd: unsuitable group %u", num);
|
||||
+ return NULL;
|
||||
+ }
|
||||
grp = os_zalloc(sizeof(EAP_PWD_group));
|
||||
if (!grp)
|
||||
return NULL;
|
||||
@@ -0,0 +1,54 @@
|
||||
From db54db11aec763b6fc74715c36e0f9de0d65e206 Mon Sep 17 00:00:00 2001
|
||||
From: Jouni Malinen <jouni@codeaurora.org>
|
||||
Date: Mon, 8 Apr 2019 18:01:07 +0300
|
||||
Subject: SAE: Reject unsuitable groups based on REVmd changes
|
||||
|
||||
The rules defining which DH groups are suitable for SAE use were
|
||||
accepted into IEEE 802.11 REVmd based on this document:
|
||||
https://mentor.ieee.org/802.11/dcn/19/11-19-0387-02-000m-addressing-some-sae-comments.docx
|
||||
|
||||
Enforce those rules in production builds of wpa_supplicant and hostapd.
|
||||
CONFIG_TESTING_OPTIONS=y builds can still be used to select any o the
|
||||
implemented groups to maintain testing coverage.
|
||||
|
||||
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
|
||||
---
|
||||
src/common/sae.c | 23 +++++++++++++++++++++++
|
||||
1 file changed, 23 insertions(+)
|
||||
|
||||
--- a/src/common/sae.c
|
||||
+++ b/src/common/sae.c
|
||||
@@ -18,10 +18,33 @@
|
||||
#include "sae.h"
|
||||
|
||||
|
||||
+static int sae_suitable_group(int group)
|
||||
+{
|
||||
+#ifdef CONFIG_TESTING_OPTIONS
|
||||
+ /* Allow all groups for testing purposes in non-production builds. */
|
||||
+ return 1;
|
||||
+#else /* CONFIG_TESTING_OPTIONS */
|
||||
+ /* Enforce REVmd rules on which SAE groups are suitable for production
|
||||
+ * purposes: FFC groups whose prime is >= 3072 bits and ECC groups
|
||||
+ * defined over a prime field whose prime is >= 256 bits. Furthermore,
|
||||
+ * ECC groups defined over a characteristic 2 finite field and ECC
|
||||
+ * groups with a co-factor greater than 1 are not suitable. */
|
||||
+ return group == 19 || group == 20 || group == 21 ||
|
||||
+ group == 28 || group == 29 || group == 30 ||
|
||||
+ group == 15 || group == 16 || group == 17 || group == 18;
|
||||
+#endif /* CONFIG_TESTING_OPTIONS */
|
||||
+}
|
||||
+
|
||||
+
|
||||
int sae_set_group(struct sae_data *sae, int group)
|
||||
{
|
||||
struct sae_temporary_data *tmp;
|
||||
|
||||
+ if (!sae_suitable_group(group)) {
|
||||
+ wpa_printf(MSG_DEBUG, "SAE: Reject unsuitable group %d", group);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
sae_clear_data(sae);
|
||||
tmp = sae->tmp = os_zalloc(sizeof(*tmp));
|
||||
if (tmp == NULL)
|
||||
@@ -0,0 +1,26 @@
|
||||
From e43f08991f00820c1f711ca254021d5f83b5cd7d Mon Sep 17 00:00:00 2001
|
||||
From: Jouni Malinen <jouni@codeaurora.org>
|
||||
Date: Thu, 25 Apr 2019 18:52:34 +0300
|
||||
Subject: [PATCH 1/6] SAE: Use const_time_memcmp() for pwd_value >= prime
|
||||
comparison
|
||||
|
||||
This reduces timing and memory access pattern differences for an
|
||||
operation that could depend on the used password.
|
||||
|
||||
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
|
||||
(cherry picked from commit 8e14b030e558d23f65d761895c07089404e61cf1)
|
||||
---
|
||||
src/common/sae.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/src/common/sae.c
|
||||
+++ b/src/common/sae.c
|
||||
@@ -317,7 +317,7 @@ static int sae_test_pwd_seed_ecc(struct
|
||||
wpa_hexdump_key(MSG_DEBUG, "SAE: pwd-value",
|
||||
pwd_value, sae->tmp->prime_len);
|
||||
|
||||
- if (os_memcmp(pwd_value, prime, sae->tmp->prime_len) >= 0)
|
||||
+ if (const_time_memcmp(pwd_value, prime, sae->tmp->prime_len) >= 0)
|
||||
return 0;
|
||||
|
||||
x_cand = crypto_bignum_init_set(pwd_value, sae->tmp->prime_len);
|
||||
@@ -0,0 +1,65 @@
|
||||
From 20d7bd83c43fb24c4cf84d3045254d3ee1957166 Mon Sep 17 00:00:00 2001
|
||||
From: Jouni Malinen <jouni@codeaurora.org>
|
||||
Date: Thu, 25 Apr 2019 19:07:05 +0300
|
||||
Subject: [PATCH 2/6] EAP-pwd: Use const_time_memcmp() for pwd_value >= prime
|
||||
comparison
|
||||
|
||||
This reduces timing and memory access pattern differences for an
|
||||
operation that could depend on the used password.
|
||||
|
||||
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
|
||||
(cherry picked from commit 7958223fdcfe82479e6ed71019a84f6d4cbf799c)
|
||||
---
|
||||
src/eap_common/eap_pwd_common.c | 13 ++++++++-----
|
||||
1 file changed, 8 insertions(+), 5 deletions(-)
|
||||
|
||||
--- a/src/eap_common/eap_pwd_common.c
|
||||
+++ b/src/eap_common/eap_pwd_common.c
|
||||
@@ -144,6 +144,7 @@ int compute_password_element(EAP_PWD_gro
|
||||
u8 qnr_bin[MAX_ECC_PRIME_LEN];
|
||||
u8 qr_or_qnr_bin[MAX_ECC_PRIME_LEN];
|
||||
u8 x_bin[MAX_ECC_PRIME_LEN];
|
||||
+ u8 prime_bin[MAX_ECC_PRIME_LEN];
|
||||
struct crypto_bignum *tmp1 = NULL, *tmp2 = NULL, *pm1 = NULL;
|
||||
struct crypto_hash *hash;
|
||||
unsigned char pwe_digest[SHA256_MAC_LEN], *prfbuf = NULL, ctr;
|
||||
@@ -161,6 +162,11 @@ int compute_password_element(EAP_PWD_gro
|
||||
os_memset(x_bin, 0, sizeof(x_bin));
|
||||
|
||||
prime = crypto_ec_get_prime(grp->group);
|
||||
+ primebitlen = crypto_ec_prime_len_bits(grp->group);
|
||||
+ primebytelen = crypto_ec_prime_len(grp->group);
|
||||
+ if (crypto_bignum_to_bin(prime, prime_bin, sizeof(prime_bin),
|
||||
+ primebytelen) < 0)
|
||||
+ return -1;
|
||||
cofactor = crypto_bignum_init();
|
||||
grp->pwe = crypto_ec_point_init(grp->group);
|
||||
tmp1 = crypto_bignum_init();
|
||||
@@ -176,8 +182,6 @@ int compute_password_element(EAP_PWD_gro
|
||||
"curve");
|
||||
goto fail;
|
||||
}
|
||||
- primebitlen = crypto_ec_prime_len_bits(grp->group);
|
||||
- primebytelen = crypto_ec_prime_len(grp->group);
|
||||
if ((prfbuf = os_malloc(primebytelen)) == NULL) {
|
||||
wpa_printf(MSG_INFO, "EAP-pwd: unable to malloc space for prf "
|
||||
"buffer");
|
||||
@@ -243,6 +247,8 @@ int compute_password_element(EAP_PWD_gro
|
||||
if (primebitlen % 8)
|
||||
buf_shift_right(prfbuf, primebytelen,
|
||||
8 - primebitlen % 8);
|
||||
+ if (const_time_memcmp(prfbuf, prime_bin, primebytelen) >= 0)
|
||||
+ continue;
|
||||
|
||||
crypto_bignum_deinit(x_candidate, 1);
|
||||
x_candidate = crypto_bignum_init_set(prfbuf, primebytelen);
|
||||
@@ -252,9 +258,6 @@ int compute_password_element(EAP_PWD_gro
|
||||
goto fail;
|
||||
}
|
||||
|
||||
- if (crypto_bignum_cmp(x_candidate, prime) >= 0)
|
||||
- continue;
|
||||
-
|
||||
wpa_hexdump_key(MSG_DEBUG, "EAP-pwd: x_candidate",
|
||||
prfbuf, primebytelen);
|
||||
const_time_select_bin(found, x_bin, prfbuf, primebytelen,
|
||||
@@ -0,0 +1,61 @@
|
||||
From ee34d8cfbd0fbf7ba7429531d4bee1c43b074d8b Mon Sep 17 00:00:00 2001
|
||||
From: Jouni Malinen <jouni@codeaurora.org>
|
||||
Date: Thu, 25 Apr 2019 19:23:05 +0300
|
||||
Subject: [PATCH 3/6] OpenSSL: Use BN_bn2binpad() or BN_bn2bin_padded() if
|
||||
available
|
||||
|
||||
This converts crypto_bignum_to_bin() to use the OpenSSL/BoringSSL
|
||||
functions BN_bn2binpad()/BN_bn2bin_padded(), when available, to avoid
|
||||
differences in runtime and memory access patterns depending on the
|
||||
leading bytes of the BIGNUM value.
|
||||
|
||||
OpenSSL 1.0.2 and LibreSSL do not include such functions, so those cases
|
||||
are still using the previous implementation where the BN_num_bytes()
|
||||
call may result in different memory access pattern.
|
||||
|
||||
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
|
||||
(cherry picked from commit 1e237903f5b5d3117342daf006c5878cdb45e3d3)
|
||||
---
|
||||
src/crypto/crypto_openssl.c | 16 ++++++++++++++++
|
||||
1 file changed, 16 insertions(+)
|
||||
|
||||
--- a/src/crypto/crypto_openssl.c
|
||||
+++ b/src/crypto/crypto_openssl.c
|
||||
@@ -1226,7 +1226,13 @@ void crypto_bignum_deinit(struct crypto_
|
||||
int crypto_bignum_to_bin(const struct crypto_bignum *a,
|
||||
u8 *buf, size_t buflen, size_t padlen)
|
||||
{
|
||||
+#ifdef OPENSSL_IS_BORINGSSL
|
||||
+#else /* OPENSSL_IS_BORINGSSL */
|
||||
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
|
||||
+#else
|
||||
int num_bytes, offset;
|
||||
+#endif
|
||||
+#endif /* OPENSSL_IS_BORINGSSL */
|
||||
|
||||
if (TEST_FAIL())
|
||||
return -1;
|
||||
@@ -1234,6 +1240,14 @@ int crypto_bignum_to_bin(const struct cr
|
||||
if (padlen > buflen)
|
||||
return -1;
|
||||
|
||||
+#ifdef OPENSSL_IS_BORINGSSL
|
||||
+ if (BN_bn2bin_padded(buf, padlen, (const BIGNUM *) a) == 0)
|
||||
+ return -1;
|
||||
+ return padlen;
|
||||
+#else /* OPENSSL_IS_BORINGSSL */
|
||||
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
|
||||
+ return BN_bn2binpad((const BIGNUM *) a, buf, padlen);
|
||||
+#else
|
||||
num_bytes = BN_num_bytes((const BIGNUM *) a);
|
||||
if ((size_t) num_bytes > buflen)
|
||||
return -1;
|
||||
@@ -1246,6 +1260,8 @@ int crypto_bignum_to_bin(const struct cr
|
||||
BN_bn2bin((const BIGNUM *) a, buf + offset);
|
||||
|
||||
return num_bytes + offset;
|
||||
+#endif
|
||||
+#endif /* OPENSSL_IS_BORINGSSL */
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
From a25b48118d75f3c2d7cb1b2c3b4cffb13091a34c Mon Sep 17 00:00:00 2001
|
||||
From: Jouni Malinen <j@w1.fi>
|
||||
Date: Mon, 24 Jun 2019 23:01:06 +0300
|
||||
Subject: [PATCH 4/6] SAE: Run through prf result processing even if it >=
|
||||
prime
|
||||
|
||||
This reduces differences in timing and memory access within the
|
||||
hunting-and-pecking loop for ECC groups that have a prime that is not
|
||||
close to a power of two (e.g., Brainpool curves).
|
||||
|
||||
Signed-off-by: Jouni Malinen <j@w1.fi>
|
||||
(cherry picked from commit 147bf7b88a9c231322b5b574263071ca6dbb0503)
|
||||
---
|
||||
src/common/sae.c | 15 ++++++++++++---
|
||||
1 file changed, 12 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/src/common/sae.c
|
||||
+++ b/src/common/sae.c
|
||||
@@ -304,6 +304,8 @@ static int sae_test_pwd_seed_ecc(struct
|
||||
struct crypto_bignum *y_sqr, *x_cand;
|
||||
int res;
|
||||
size_t bits;
|
||||
+ int cmp_prime;
|
||||
+ unsigned int in_range;
|
||||
|
||||
wpa_hexdump_key(MSG_DEBUG, "SAE: pwd-seed", pwd_seed, SHA256_MAC_LEN);
|
||||
|
||||
@@ -317,8 +319,13 @@ static int sae_test_pwd_seed_ecc(struct
|
||||
wpa_hexdump_key(MSG_DEBUG, "SAE: pwd-value",
|
||||
pwd_value, sae->tmp->prime_len);
|
||||
|
||||
- if (const_time_memcmp(pwd_value, prime, sae->tmp->prime_len) >= 0)
|
||||
- return 0;
|
||||
+ cmp_prime = const_time_memcmp(pwd_value, prime, sae->tmp->prime_len);
|
||||
+ /* Create a const_time mask for selection based on prf result
|
||||
+ * being smaller than prime. */
|
||||
+ in_range = const_time_fill_msb((unsigned int) cmp_prime);
|
||||
+ /* The algorithm description would skip the next steps if
|
||||
+ * cmp_prime >= 0 (reutnr 0 here), but go through them regardless to
|
||||
+ * minimize externally observable differences in behavior. */
|
||||
|
||||
x_cand = crypto_bignum_init_set(pwd_value, sae->tmp->prime_len);
|
||||
if (!x_cand)
|
||||
@@ -330,7 +337,9 @@ static int sae_test_pwd_seed_ecc(struct
|
||||
|
||||
res = is_quadratic_residue_blind(sae, prime, bits, qr, qnr, y_sqr);
|
||||
crypto_bignum_deinit(y_sqr, 1);
|
||||
- return res;
|
||||
+ if (res < 0)
|
||||
+ return res;
|
||||
+ return const_time_select_int(in_range, res, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
From 00a6cc73da61b03c146b6c341d0d1e572bcef432 Mon Sep 17 00:00:00 2001
|
||||
From: Jouni Malinen <j@w1.fi>
|
||||
Date: Mon, 24 Jun 2019 23:02:51 +0300
|
||||
Subject: [PATCH 5/6] EAP-pwd: Run through prf result processing even if it >=
|
||||
prime
|
||||
|
||||
This reduces differences in timing and memory access within the
|
||||
hunting-and-pecking loop for ECC groups that have a prime that is not
|
||||
close to a power of two (e.g., Brainpool curves).
|
||||
|
||||
Signed-off-by: Jouni Malinen <j@w1.fi>
|
||||
(cherry picked from commit cd803299ca485eb857e37c88f973fccfbb8600e5)
|
||||
---
|
||||
src/eap_common/eap_pwd_common.c | 13 ++++++++++---
|
||||
1 file changed, 10 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/src/eap_common/eap_pwd_common.c
|
||||
+++ b/src/eap_common/eap_pwd_common.c
|
||||
@@ -155,6 +155,8 @@ int compute_password_element(EAP_PWD_gro
|
||||
struct crypto_bignum *x_candidate = NULL, *cofactor = NULL;
|
||||
const struct crypto_bignum *prime;
|
||||
u8 mask, found_ctr = 0, is_odd = 0;
|
||||
+ int cmp_prime;
|
||||
+ unsigned int in_range;
|
||||
|
||||
if (grp->pwe)
|
||||
return -1;
|
||||
@@ -247,8 +249,13 @@ int compute_password_element(EAP_PWD_gro
|
||||
if (primebitlen % 8)
|
||||
buf_shift_right(prfbuf, primebytelen,
|
||||
8 - primebitlen % 8);
|
||||
- if (const_time_memcmp(prfbuf, prime_bin, primebytelen) >= 0)
|
||||
- continue;
|
||||
+ cmp_prime = const_time_memcmp(prfbuf, prime_bin, primebytelen);
|
||||
+ /* Create a const_time mask for selection based on prf result
|
||||
+ * being smaller than prime. */
|
||||
+ in_range = const_time_fill_msb((unsigned int) cmp_prime);
|
||||
+ /* The algorithm description would skip the next steps if
|
||||
+ * cmp_prime >= 0, but go through them regardless to minimize
|
||||
+ * externally observable differences in behavior. */
|
||||
|
||||
crypto_bignum_deinit(x_candidate, 1);
|
||||
x_candidate = crypto_bignum_init_set(prfbuf, primebytelen);
|
||||
@@ -311,7 +318,7 @@ int compute_password_element(EAP_PWD_gro
|
||||
goto fail;
|
||||
mask = const_time_eq(res, check);
|
||||
found_ctr = const_time_select_u8(found, found_ctr, ctr);
|
||||
- found |= mask;
|
||||
+ found |= mask & in_range;
|
||||
}
|
||||
if (found == 0) {
|
||||
wpa_printf(MSG_INFO,
|
||||
@@ -0,0 +1,44 @@
|
||||
From 558518ed63202e5358116ab7e0afd5e85490f2ef Mon Sep 17 00:00:00 2001
|
||||
From: Jouni Malinen <j@w1.fi>
|
||||
Date: Sat, 27 Jul 2019 23:19:17 +0300
|
||||
Subject: [PATCH 6/6] dragonfly: Disable use of groups using Brainpool curves
|
||||
|
||||
Disable groups that use Brainpool curves for now since they leak more
|
||||
timing information due to the prime not being close to a power of two.
|
||||
This removes use of groups 28, 29, and 30 from SAE and EAP-pwd.
|
||||
|
||||
Signed-off-by: Jouni Malinen <j@w1.fi>
|
||||
(cherry picked from commit 876c5eaa6dae1a87a17603fc489a44c29eedc2e3)
|
||||
---
|
||||
src/common/sae.c | 6 ++++--
|
||||
src/eap_common/eap_pwd_common.c | 3 +--
|
||||
2 files changed, 5 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/src/common/sae.c
|
||||
+++ b/src/common/sae.c
|
||||
@@ -28,9 +28,11 @@ static int sae_suitable_group(int group)
|
||||
* purposes: FFC groups whose prime is >= 3072 bits and ECC groups
|
||||
* defined over a prime field whose prime is >= 256 bits. Furthermore,
|
||||
* ECC groups defined over a characteristic 2 finite field and ECC
|
||||
- * groups with a co-factor greater than 1 are not suitable. */
|
||||
+ * groups with a co-factor greater than 1 are not suitable. Disable
|
||||
+ * groups that use Brainpool curves as well for now since they leak more
|
||||
+ * timing information due to the prime not being close to a power of
|
||||
+ * two. */
|
||||
return group == 19 || group == 20 || group == 21 ||
|
||||
- group == 28 || group == 29 || group == 30 ||
|
||||
group == 15 || group == 16 || group == 17 || group == 18;
|
||||
#endif /* CONFIG_TESTING_OPTIONS */
|
||||
}
|
||||
--- a/src/eap_common/eap_pwd_common.c
|
||||
+++ b/src/eap_common/eap_pwd_common.c
|
||||
@@ -89,8 +89,7 @@ static int eap_pwd_suitable_group(u16 nu
|
||||
{
|
||||
/* Do not allow ECC groups with prime under 256 bits based on guidance
|
||||
* for the similar design in SAE. */
|
||||
- return num == 19 || num == 20 || num == 21 ||
|
||||
- num == 28 || num == 29 || num == 30;
|
||||
+ return num == 19 || num == 20 || num == 21;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
From 8c07fa9eda13e835f3f968b2e1c9a8be3a851ff9 Mon Sep 17 00:00:00 2001
|
||||
From: Jouni Malinen <j@w1.fi>
|
||||
Date: Thu, 29 Aug 2019 11:52:04 +0300
|
||||
Subject: [PATCH] AP: Silently ignore management frame from unexpected source
|
||||
address
|
||||
|
||||
Do not process any received Management frames with unexpected/invalid SA
|
||||
so that we do not add any state for unexpected STA addresses or end up
|
||||
sending out frames to unexpected destination. This prevents unexpected
|
||||
sequences where an unprotected frame might end up causing the AP to send
|
||||
out a response to another device and that other device processing the
|
||||
unexpected response.
|
||||
|
||||
In particular, this prevents some potential denial of service cases
|
||||
where the unexpected response frame from the AP might result in a
|
||||
connected station dropping its association.
|
||||
|
||||
Signed-off-by: Jouni Malinen <j@w1.fi>
|
||||
---
|
||||
src/ap/drv_callbacks.c | 13 +++++++++++++
|
||||
src/ap/ieee802_11.c | 12 ++++++++++++
|
||||
2 files changed, 25 insertions(+)
|
||||
|
||||
--- a/src/ap/drv_callbacks.c
|
||||
+++ b/src/ap/drv_callbacks.c
|
||||
@@ -129,6 +129,19 @@ int hostapd_notif_assoc(struct hostapd_d
|
||||
"hostapd_notif_assoc: Skip event with no address");
|
||||
return -1;
|
||||
}
|
||||
+
|
||||
+ if (is_multicast_ether_addr(addr) ||
|
||||
+ is_zero_ether_addr(addr) ||
|
||||
+ os_memcmp(addr, hapd->own_addr, ETH_ALEN) == 0) {
|
||||
+ /* Do not process any frames with unexpected/invalid SA so that
|
||||
+ * we do not add any state for unexpected STA addresses or end
|
||||
+ * up sending out frames to unexpected destination. */
|
||||
+ wpa_printf(MSG_DEBUG, "%s: Invalid SA=" MACSTR
|
||||
+ " in received indication - ignore this indication silently",
|
||||
+ __func__, MAC2STR(addr));
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
random_add_randomness(addr, ETH_ALEN);
|
||||
|
||||
hostapd_logger(hapd, addr, HOSTAPD_MODULE_IEEE80211,
|
||||
--- a/src/ap/ieee802_11.c
|
||||
+++ b/src/ap/ieee802_11.c
|
||||
@@ -3929,6 +3929,18 @@ int ieee802_11_mgmt(struct hostapd_data
|
||||
fc = le_to_host16(mgmt->frame_control);
|
||||
stype = WLAN_FC_GET_STYPE(fc);
|
||||
|
||||
+ if (is_multicast_ether_addr(mgmt->sa) ||
|
||||
+ is_zero_ether_addr(mgmt->sa) ||
|
||||
+ os_memcmp(mgmt->sa, hapd->own_addr, ETH_ALEN) == 0) {
|
||||
+ /* Do not process any frames with unexpected/invalid SA so that
|
||||
+ * we do not add any state for unexpected STA addresses or end
|
||||
+ * up sending out frames to unexpected destination. */
|
||||
+ wpa_printf(MSG_DEBUG, "MGMT: Invalid SA=" MACSTR
|
||||
+ " in received frame - ignore this frame silently",
|
||||
+ MAC2STR(mgmt->sa));
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
if (stype == WLAN_FC_STYPE_BEACON) {
|
||||
handle_beacon(hapd, mgmt, len, fi);
|
||||
return 1;
|
||||
@@ -178,7 +178,7 @@
|
||||
/*
|
||||
--- a/src/ap/drv_callbacks.c
|
||||
+++ b/src/ap/drv_callbacks.c
|
||||
@@ -1515,8 +1515,8 @@ static void hostapd_event_wds_sta_interf
|
||||
@@ -1528,8 +1528,8 @@ static void hostapd_event_wds_sta_interf
|
||||
}
|
||||
|
||||
|
||||
@@ -189,7 +189,7 @@
|
||||
{
|
||||
struct hostapd_data *hapd = ctx;
|
||||
#ifndef CONFIG_NO_STDOUT_DEBUG
|
||||
@@ -1742,7 +1742,7 @@ void wpa_supplicant_event(void *ctx, enu
|
||||
@@ -1755,7 +1755,7 @@ void wpa_supplicant_event(void *ctx, enu
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -193,7 +193,7 @@
|
||||
sta = ap_get_sta(hapd, mgmt->sa);
|
||||
if (sta == NULL) {
|
||||
wpa_msg(hapd->msg_ctx, MSG_DEBUG, "Station " MACSTR " trying "
|
||||
@@ -3951,7 +3980,7 @@ int ieee802_11_mgmt(struct hostapd_data
|
||||
@@ -3963,7 +3992,7 @@ int ieee802_11_mgmt(struct hostapd_data
|
||||
|
||||
|
||||
if (stype == WLAN_FC_STYPE_PROBE_REQ) {
|
||||
@@ -202,7 +202,7 @@
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -3971,17 +4000,17 @@ int ieee802_11_mgmt(struct hostapd_data
|
||||
@@ -3983,17 +4012,17 @@ int ieee802_11_mgmt(struct hostapd_data
|
||||
switch (stype) {
|
||||
case WLAN_FC_STYPE_AUTH:
|
||||
wpa_printf(MSG_DEBUG, "mgmt::auth");
|
||||
@@ -291,7 +291,7 @@
|
||||
|
||||
if (addr == NULL) {
|
||||
/*
|
||||
@@ -195,6 +199,12 @@ int hostapd_notif_assoc(struct hostapd_d
|
||||
@@ -208,6 +212,12 @@ int hostapd_notif_assoc(struct hostapd_d
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=omcproxy
|
||||
PKG_RELEASE:=4
|
||||
PKG_RELEASE:=5
|
||||
|
||||
PKG_SOURCE_URL:=https://github.com/sbyx/omcproxy.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
From 721064f2eb1dabe5bda63dcaff249b73ab891e6c Mon Sep 17 00:00:00 2001
|
||||
From: Eneas U de Queiroz <cote2004-github@yahoo.com>
|
||||
Date: Fri, 14 Dec 2018 15:13:41 -0200
|
||||
Subject: [PATCH] mrib.c: don't use cpu_to_be32 outside of function
|
||||
|
||||
cpu_to_be32 is not a constant, so it can't be used outside of a
|
||||
function.
|
||||
|
||||
Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
|
||||
|
||||
--- a/src/mrib.c
|
||||
+++ b/src/mrib.c
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
+#include <endian.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <unistd.h>
|
||||
@@ -54,7 +55,13 @@ struct mrib_iface {
|
||||
struct uloop_timeout timer;
|
||||
};
|
||||
|
||||
-static uint32_t ipv4_rtr_alert = cpu_to_be32(0x94040000);
|
||||
+/* we can't use cpu_to_be32 outside a function */
|
||||
+#if __BYTE_ORDER == __BIG_ENDIAN
|
||||
+static uint32_t ipv4_rtr_alert = 0x94040000;
|
||||
+#else
|
||||
+static uint32_t ipv4_rtr_alert = 0x00000494;
|
||||
+#endif
|
||||
+
|
||||
static struct {
|
||||
struct ip6_hbh hdr;
|
||||
struct ip6_opt_router rt;
|
||||
@@ -11,12 +11,12 @@ include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=wireguard
|
||||
|
||||
PKG_VERSION:=0.0.20190123
|
||||
PKG_VERSION:=0.0.20190601
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=WireGuard-$(PKG_VERSION).tar.xz
|
||||
PKG_SOURCE_URL:=https://git.zx2c4.com/WireGuard/snapshot/
|
||||
PKG_HASH:=edd13c7631af169e3838621b1a1bff3ef73cf7bc778eec2bd55f7c1089ffdf9b
|
||||
PKG_HASH:=7528461824a0174bd7d4f15e68d8f0ce9a8ea318411502b80759438e8ef65568
|
||||
|
||||
PKG_LICENSE:=GPL-2.0 Apache-2.0
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
|
||||
@@ -146,12 +146,18 @@ proto_ncm_setup() {
|
||||
proto_close_data
|
||||
proto_send_update "$interface"
|
||||
|
||||
local zone="$(fw3 -q network "$interface" 2>/dev/null)"
|
||||
|
||||
[ "$pdptype" = "IP" -o "$pdptype" = "IPV4V6" ] && {
|
||||
json_init
|
||||
json_add_string name "${interface}_4"
|
||||
json_add_string ifname "@$interface"
|
||||
json_add_string proto "dhcp"
|
||||
proto_add_dynamic_defaults
|
||||
[ -n "$zone" ] && {
|
||||
json_add_string zone "$zone"
|
||||
}
|
||||
json_close_object
|
||||
ubus call network add_dynamic "$(json_dump)"
|
||||
}
|
||||
|
||||
@@ -162,6 +168,10 @@ proto_ncm_setup() {
|
||||
json_add_string proto "dhcpv6"
|
||||
json_add_string extendprefix 1
|
||||
proto_add_dynamic_defaults
|
||||
[ -n "$zone" ] && {
|
||||
json_add_string zone "$zone"
|
||||
}
|
||||
json_close_object
|
||||
ubus call network add_dynamic "$(json_dump)"
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=iptables
|
||||
PKG_VERSION:=1.6.2
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=3
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://git.netfilter.org/iptables
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
--- a/iptables/iptables-restore.c
|
||||
+++ b/iptables/iptables-restore.c
|
||||
@@ -129,6 +129,10 @@ static void add_param_to_argv(char *pars
|
||||
* longer a real hacker, but I can live with that */
|
||||
|
||||
for (curchar = parsestart; *curchar; curchar++) {
|
||||
+ if (param_len >= sizeof(param_buffer))
|
||||
+ xtables_error(PARAMETER_PROBLEM,
|
||||
+ "Parameter too long!");
|
||||
+
|
||||
if (quote_open) {
|
||||
if (escaped) {
|
||||
param_buffer[param_len++] = *curchar;
|
||||
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=nftables
|
||||
PKG_VERSION:=0.9.0
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
|
||||
PKG_SOURCE_URL:=https://netfilter.org/projects/$(PKG_NAME)/files
|
||||
|
||||
28
package/network/utils/nftables/patches/010-uclibc-ng.patch
Normal file
28
package/network/utils/nftables/patches/010-uclibc-ng.patch
Normal file
@@ -0,0 +1,28 @@
|
||||
From c65c4f9998587a0c705b3635215f25fa5680c0d3 Mon Sep 17 00:00:00 2001
|
||||
From: Rosen Penev <rosenp@gmail.com>
|
||||
Date: Fri, 3 May 2019 11:49:11 -0700
|
||||
Subject: gmputil: Add missing header for va_list
|
||||
|
||||
Otherwise it errors with unknown type name when using uClibc.
|
||||
|
||||
Signed-off-by: Rosen Penev <rosenp@gmail.com>
|
||||
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
||||
---
|
||||
include/gmputil.h | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/include/gmputil.h b/include/gmputil.h
|
||||
index 73959c17..ad63d67b 100644
|
||||
--- a/include/gmputil.h
|
||||
+++ b/include/gmputil.h
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <gmp.h>
|
||||
#else
|
||||
#include <mini-gmp.h>
|
||||
+#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
/* mini-gmp doesn't come with gmp_vfprintf, so we use our own minimal variant */
|
||||
extern int mpz_vfprintf(FILE *fp, const char *format, va_list args);
|
||||
--
|
||||
cgit v1.2.1
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=tcpdump
|
||||
PKG_VERSION:=4.9.2
|
||||
PKG_VERSION:=4.9.3
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=http://www.us.tcpdump.org/release/ \
|
||||
http://www.tcpdump.org/release/
|
||||
PKG_HASH:=798b3536a29832ce0cbb07fafb1ce5097c95e308a6f592d14052e1ef1505fe79
|
||||
PKG_HASH:=2cd47cb3d460b6ff75f4a9940f594317ad456cfbf2bd2c8e5151e16559db6410
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -6259,97 +6259,6 @@ $as_echo "no" >&6; }
|
||||
@@ -6183,97 +6183,6 @@ $as_echo "no" >&6; }
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -5471,37 +5471,6 @@ $as_echo "Using $pfopen" >&6; }
|
||||
@@ -5395,37 +5395,6 @@ $as_echo "Using $pfopen" >&6; }
|
||||
LIBS="$LIBS $pfopen"
|
||||
fi
|
||||
fi
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
#
|
||||
# Look for pcap-config.
|
||||
@@ -5657,51 +5626,6 @@ if test "x$ac_cv_lib_pcap_main" = xyes;
|
||||
@@ -5581,51 +5550,6 @@ if test "x$ac_cv_lib_pcap_main" = xyes;
|
||||
libpcap="-lpcap"
|
||||
fi
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
+#endif
|
||||
|
||||
tp = lookup_bytestring(ndo, ep, len);
|
||||
if (tp->bs_name)
|
||||
if (tp->bs_name)
|
||||
@@ -1214,6 +1216,7 @@ init_addrtoname(netdissect_options *ndo,
|
||||
init_ipxsaparray(ndo);
|
||||
}
|
||||
@@ -111,7 +111,7 @@
|
||||
const char *
|
||||
dnaddr_string(netdissect_options *ndo, u_short dnaddr)
|
||||
{
|
||||
@@ -1233,6 +1236,7 @@ dnaddr_string(netdissect_options *ndo, u
|
||||
@@ -1230,6 +1233,7 @@ dnaddr_string(netdissect_options *ndo, u
|
||||
|
||||
return(tp->name);
|
||||
}
|
||||
@@ -224,7 +224,7 @@
|
||||
return (1);
|
||||
@@ -368,6 +369,7 @@ ethertype_print(netdissect_options *ndo,
|
||||
}
|
||||
isoclns_print(ndo, p + 1, length - 1);
|
||||
isoclns_print(ndo, p + 1, length - 1);
|
||||
return(1);
|
||||
+#endif
|
||||
|
||||
@@ -321,15 +321,15 @@
|
||||
advance = frag6_print(ndo, cp, (const u_char *)ip6);
|
||||
if (advance < 0 || ndo->ndo_snapend <= cp + advance)
|
||||
@@ -328,6 +329,7 @@ ip6_print(netdissect_options *ndo, const
|
||||
return;
|
||||
return;
|
||||
nh = *cp;
|
||||
return;
|
||||
+#endif
|
||||
case IPPROTO_ROUTING:
|
||||
ND_TCHECK(*cp);
|
||||
ND_TCHECK(*cp);
|
||||
advance = rt6_print(ndo, cp, (const u_char *)ip6);
|
||||
@@ -335,12 +337,14 @@ ip6_print(netdissect_options *ndo, const
|
||||
return;
|
||||
return;
|
||||
nh = *cp;
|
||||
break;
|
||||
+#ifndef TCPDUMP_MINI
|
||||
@@ -350,7 +350,7 @@
|
||||
+#ifndef TCPDUMP_MINI
|
||||
case IPPROTO_AH:
|
||||
advance = ah_print(ndo, cp);
|
||||
if (advance < 0)
|
||||
if (advance < 0)
|
||||
@@ -382,6 +387,7 @@ ip6_print(netdissect_options *ndo, const
|
||||
case IPPROTO_PIM:
|
||||
pim_print(ndo, cp, len, (const u_char *)ip6);
|
||||
@@ -440,7 +440,7 @@
|
||||
+#endif
|
||||
|
||||
default:
|
||||
if (ndo->ndo_nflag==0 && (p_name = netdb_protoname(ipds->nh)) != NULL)
|
||||
if (ndo->ndo_nflag==0 && (p_name = netdb_protoname(ipds->nh)) != NULL)
|
||||
--- a/print-llc.c
|
||||
+++ b/print-llc.c
|
||||
@@ -206,6 +206,7 @@ llc_print(netdissect_options *ndo, const
|
||||
@@ -482,14 +482,14 @@
|
||||
+#ifndef TCPDUMP_MINI
|
||||
if (ssap == LLCSAP_ISONS && dsap == LLCSAP_ISONS
|
||||
&& control == LLC_UI) {
|
||||
isoclns_print(ndo, p, length);
|
||||
isoclns_print(ndo, p, length);
|
||||
return (hdrlen);
|
||||
}
|
||||
-
|
||||
+#endif
|
||||
if (!ndo->ndo_eflag) {
|
||||
if (ssap == dsap) {
|
||||
if (src == NULL || dst == NULL)
|
||||
if (src == NULL || dst == NULL)
|
||||
@@ -480,6 +485,7 @@ snap_print(netdissect_options *ndo, cons
|
||||
|
||||
case OUI_CISCO:
|
||||
@@ -530,7 +530,7 @@
|
||||
|
||||
+#ifndef TCPDUMP_MINI
|
||||
case BSD_AFNUM_ISO:
|
||||
isoclns_print(ndo, p, length);
|
||||
isoclns_print(ndo, p, length);
|
||||
break;
|
||||
@@ -127,6 +128,7 @@ null_if_print(netdissect_options *ndo, c
|
||||
case BSD_AFNUM_IPX:
|
||||
@@ -605,7 +605,7 @@
|
||||
/*
|
||||
--- a/print-sll.c
|
||||
+++ b/print-sll.c
|
||||
@@ -238,12 +238,14 @@ recurse:
|
||||
@@ -249,12 +249,14 @@ recurse:
|
||||
*/
|
||||
switch (ether_type) {
|
||||
|
||||
@@ -683,7 +683,7 @@
|
||||
else if (IS_SRC_OR_DST_PORT(FTP_PORT)) {
|
||||
ND_PRINT((ndo, ": "));
|
||||
ftp_print(ndo, bp, length);
|
||||
@@ -719,6 +730,7 @@ tcp_print(netdissect_options *ndo,
|
||||
@@ -725,6 +736,7 @@ tcp_print(netdissect_options *ndo,
|
||||
* XXX packet could be unaligned, it can go strange
|
||||
*/
|
||||
ns_print(ndo, bp + 2, length - 2, 0);
|
||||
@@ -691,7 +691,7 @@
|
||||
} else if (IS_SRC_OR_DST_PORT(MSDP_PORT)) {
|
||||
msdp_print(ndo, bp, length);
|
||||
} else if (IS_SRC_OR_DST_PORT(RPKI_RTR_PORT)) {
|
||||
@@ -726,6 +738,7 @@ tcp_print(netdissect_options *ndo,
|
||||
@@ -732,6 +744,7 @@ tcp_print(netdissect_options *ndo,
|
||||
}
|
||||
else if (length > 0 && (IS_SRC_OR_DST_PORT(LDP_PORT))) {
|
||||
ldp_print(ndo, bp, length);
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=uqmi
|
||||
PKG_RELEASE:=5
|
||||
PKG_RELEASE:=7
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/uqmi.git
|
||||
PKG_SOURCE_DATE:=2016-12-19
|
||||
PKG_SOURCE_VERSION:=8ceeab690d8c6f1e3afbd4bcaee7bc2ba3fbe165
|
||||
PKG_MIRROR_HASH:=b3637ff04e51769137af1c5e173e73311e11c3c2dcc49eeaca6aa3520f61d247
|
||||
PKG_SOURCE_DATE:=2019-06-27
|
||||
PKG_SOURCE_VERSION:=1965c713937495a5cb029165c16acdb6572c3f87
|
||||
PKG_MIRROR_HASH:=3c39b1c1f20b7d523b0891d08b3d10233331ada8e11d0b55cfd4882816308951
|
||||
PKG_MAINTAINER:=Matti Laakso <malaakso@elisanet.fi>
|
||||
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
@@ -83,7 +83,7 @@ proto_qmi_setup() {
|
||||
fi
|
||||
done
|
||||
|
||||
if uqmi -s -d "$device" --get-pin-status | grep '"Not supported"' > /dev/null; then
|
||||
if uqmi -s -d "$device" --get-pin-status | grep '"Not supported"\|"Invalid QMI command"' > /dev/null; then
|
||||
[ -n "$pincode" ] && {
|
||||
uqmi -s -d "$device" --verify-pin1 "$pincode" > /dev/null || uqmi -s -d "$device" --uim-verify-pin1 "$pincode" > /dev/null || {
|
||||
echo "Unable to verify PIN"
|
||||
@@ -298,6 +298,9 @@ proto_qmi_setup() {
|
||||
}
|
||||
proto_close_data
|
||||
proto_send_update "$interface"
|
||||
|
||||
local zone="$(fw3 -q network "$interface" 2>/dev/null)"
|
||||
|
||||
[ -n "$pdh_6" ] && {
|
||||
if [ -z "$dhcpv6" -o "$dhcpv6" = 0 ]; then
|
||||
json_load "$(uqmi -s -d $device --set-client-id wds,$cid_6 --get-current-settings)"
|
||||
@@ -318,6 +321,11 @@ proto_qmi_setup() {
|
||||
proto_add_dns_server "$dns1_6"
|
||||
proto_add_dns_server "$dns2_6"
|
||||
}
|
||||
[ -n "$zone" ] && {
|
||||
proto_add_data
|
||||
json_add_string zone "$zone"
|
||||
proto_close_data
|
||||
}
|
||||
proto_send_update "$interface"
|
||||
else
|
||||
json_init
|
||||
@@ -328,6 +336,7 @@ proto_qmi_setup() {
|
||||
proto_add_dynamic_defaults
|
||||
# RFC 7278: Extend an IPv6 /64 Prefix to LAN
|
||||
json_add_string extendprefix 1
|
||||
[ -n "$zone" ] && json_add_string zone "$zone"
|
||||
json_close_object
|
||||
ubus call network add_dynamic "$(json_dump)"
|
||||
fi
|
||||
@@ -340,6 +349,7 @@ proto_qmi_setup() {
|
||||
json_add_string proto "dhcp"
|
||||
[ -n "$ip4table" ] && json_add_string ip4table "$ip4table"
|
||||
proto_add_dynamic_defaults
|
||||
[ -n "$zone" ] && json_add_string zone "$zone"
|
||||
json_close_object
|
||||
ubus call network add_dynamic "$(json_dump)"
|
||||
}
|
||||
|
||||
@@ -14,9 +14,9 @@ PKG_FLAGS:=essential
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://git.openwrt.org/project/opkg-lede.git
|
||||
PKG_SOURCE_DATE:=2019-01-18
|
||||
PKG_SOURCE_VERSION:=7708a01a084872bbe4c46f36d2da021fdeb10862
|
||||
PKG_MIRROR_HASH:=117148ece22e64654264afd869606ef5507edd3dc965ffe000c6b1b1074b3f4a
|
||||
PKG_SOURCE_DATE:=2019-06-14
|
||||
PKG_SOURCE_VERSION:=dcbc142e51f5f5f2fb9e4e44657e013d3c36a52b
|
||||
PKG_MIRROR_HASH:=fca7e71dd06f0d5ee0af0d0a493d641d4d5d7e403d64c67879a462a020aa2299
|
||||
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
@@ -25,7 +25,7 @@ PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
|
||||
|
||||
# Extend depends from version.mk
|
||||
PKG_CONFIG_DEPENDS += \
|
||||
CONFIG_SIGNED_PACKAGES \
|
||||
CONFIG_SIGNATURE_CHECK \
|
||||
CONFIG_TARGET_INIT_PATH
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
@@ -88,7 +88,7 @@ define Package/opkg/install
|
||||
$(INSTALL_DATA) ./files/opkg$(2).conf $(1)/etc/opkg.conf
|
||||
$(INSTALL_BIN) ./files/20_migrate-feeds $(1)/etc/uci-defaults/
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/opkg-cl $(1)/bin/opkg
|
||||
ifneq ($(CONFIG_SIGNED_PACKAGES),)
|
||||
ifneq ($(CONFIG_SIGNATURE_CHECK),)
|
||||
echo "option check_signature" >> $(1)/etc/opkg.conf
|
||||
endif
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
|
||||
@@ -5,9 +5,9 @@ PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/usign.git
|
||||
PKG_SOURCE_DATE:=2015-07-04
|
||||
PKG_SOURCE_VERSION:=ef6419142a3b0fbcddcccf536e3c1880302c6f89
|
||||
PKG_MIRROR_HASH:=9499ed7e40889b364e446a428e185c40986b75087888bd7e1496542457a6dbaa
|
||||
PKG_SOURCE_DATE:=2019-08-06
|
||||
PKG_SOURCE_VERSION:=5a52b379902471cef495687547c7b568142f66d2
|
||||
PKG_MIRROR_HASH:=9779f6d6718a7f7cd3e28aa7feefc9b3f4b0c7a85cb58ff18afbeb6b4372177a
|
||||
CMAKE_INSTALL:=1
|
||||
PKG_CHECK_FORMAT_SECURITY:=1
|
||||
PKG_USE_MIPS16:=0
|
||||
|
||||
@@ -38,6 +38,8 @@ endif
|
||||
BUSYBOX_SYM=$(if $(CONFIG_BUSYBOX_CUSTOM),CONFIG,DEFAULT)
|
||||
BUSYBOX_IF_ENABLED=$(if $(CONFIG_BUSYBOX_$(BUSYBOX_SYM)_$(1)),$(2))
|
||||
|
||||
# All files provided by busybox will serve as fallback alternatives by opkg.
|
||||
# There should be no need to enumerate ALTERNATIVES entries here
|
||||
define Package/busybox
|
||||
SECTION:=base
|
||||
CATEGORY:=Base system
|
||||
@@ -46,20 +48,6 @@ define Package/busybox
|
||||
URL:=http://busybox.net/
|
||||
DEPENDS:=+BUSYBOX_USE_LIBRPC:librpc +BUSYBOX_CONFIG_PAM:libpam +BUSYBOX_CONFIG_NTPD:jsonfilter
|
||||
MENU:=1
|
||||
ALTERNATIVES:=\
|
||||
$(call BUSYBOX_IF_ENABLED,FLOCK, 100:/usr/bin/flock:/bin/busybox) \
|
||||
$(call BUSYBOX_IF_ENABLED,FREE, 100:/usr/bin/free:/bin/busybox) \
|
||||
$(call BUSYBOX_IF_ENABLED,IP, 100:/sbin/ip:/bin/busybox) \
|
||||
$(call BUSYBOX_IF_ENABLED,KILL, 100:/bin/kill:/bin/busybox) \
|
||||
$(call BUSYBOX_IF_ENABLED,PGREP, 100:/usr/bin/pgrep:/bin/busybox) \
|
||||
$(call BUSYBOX_IF_ENABLED,PKILL, 100:/usr/bin/pkill:/bin/busybox) \
|
||||
$(call BUSYBOX_IF_ENABLED,PMAP, 100:/usr/bin/pmap:/bin/busybox) \
|
||||
$(call BUSYBOX_IF_ENABLED,PS, 100:/bin/ps:/bin/busybox) \
|
||||
$(call BUSYBOX_IF_ENABLED,PWDX, 100:/usr/bin/pwdx:/bin/busybox) \
|
||||
$(call BUSYBOX_IF_ENABLED,TOP, 100:/usr/bin/top:/bin/busybox) \
|
||||
$(call BUSYBOX_IF_ENABLED,UPTIME, 100:/usr/bin/uptime:/bin/busybox) \
|
||||
$(call BUSYBOX_IF_ENABLED,WATCH, 100:/bin/watch:/bin/busybox) \
|
||||
|
||||
endef
|
||||
|
||||
define Package/busybox/description
|
||||
|
||||
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=bzip2
|
||||
PKG_VERSION:=1.0.6
|
||||
PKG_RELEASE:=4
|
||||
PKG_RELEASE:=5
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=http://www.bzip.org/$(PKG_VERSION)
|
||||
|
||||
65
package/utils/bzip2/patches/020-CVE-2019-12900.patch
Normal file
65
package/utils/bzip2/patches/020-CVE-2019-12900.patch
Normal file
@@ -0,0 +1,65 @@
|
||||
From 812a898b7622de90e98f103ff7fed0984e4548e4 Mon Sep 17 00:00:00 2001
|
||||
From: Mark Wielaard <mark@klomp.org>
|
||||
Date: Wed, 3 Jul 2019 01:28:11 +0200
|
||||
Subject: [PATCH] Accept as many selectors as the file format allows.
|
||||
|
||||
But ignore any larger than the theoretical maximum, BZ_MAX_SELECTORS.
|
||||
|
||||
The theoretical maximum number of selectors depends on the maximum
|
||||
blocksize (900000 bytes) and the number of symbols (50) that can be
|
||||
encoded with a different Huffman tree. BZ_MAX_SELECTORS is 18002.
|
||||
|
||||
But the bzip2 file format allows the number of selectors to be encoded
|
||||
with 15 bits (because 18002 isn't a factor of 2 and doesn't fit in
|
||||
14 bits). So the file format maximum is 32767 selectors.
|
||||
|
||||
Some bzip2 encoders might actually have written out more selectors
|
||||
than the theoretical maximum because they rounded up the number of
|
||||
selectors to some convenient factor of 8.
|
||||
|
||||
The extra 14766 selectors can never be validly used by the decompression
|
||||
algorithm. So we can read them, but then discard them.
|
||||
|
||||
This is effectively what was done (by accident) before we added a
|
||||
check for nSelectors to be at most BZ_MAX_SELECTORS to mitigate
|
||||
CVE-2019-12900.
|
||||
|
||||
The extra selectors were written out after the array inside the
|
||||
EState struct. But the struct has extra space allocated after the
|
||||
selector arrays of 18060 bytes (which is larger than 14766).
|
||||
All of which will be initialized later (so the overwrite of that
|
||||
space with extra selector values would have been harmless).
|
||||
---
|
||||
compress.c | 2 +-
|
||||
decompress.c | 10 +++++++-
|
||||
2 files changed, 8 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/compress.c
|
||||
+++ b/compress.c
|
||||
@@ -454,7 +454,7 @@ void sendMTFValues ( EState* s )
|
||||
|
||||
AssertH( nGroups < 8, 3002 );
|
||||
AssertH( nSelectors < 32768 &&
|
||||
- nSelectors <= (2 + (900000 / BZ_G_SIZE)),
|
||||
+ nSelectors <= BZ_MAX_SELECTORS,
|
||||
3003 );
|
||||
|
||||
|
||||
--- a/decompress.c
|
||||
+++ b/decompress.c
|
||||
@@ -296,8 +296,14 @@ Int32 BZ2_decompress ( DState* s )
|
||||
j++;
|
||||
if (j >= nGroups) RETURN(BZ_DATA_ERROR);
|
||||
}
|
||||
- s->selectorMtf[i] = j;
|
||||
+ /* Having more than BZ_MAX_SELECTORS doesn't make much sense
|
||||
+ since they will never be used, but some implementations might
|
||||
+ "round up" the number of selectors, so just ignore those. */
|
||||
+ if (i < BZ_MAX_SELECTORS)
|
||||
+ s->selectorMtf[i] = j;
|
||||
}
|
||||
+ if (nSelectors > BZ_MAX_SELECTORS)
|
||||
+ nSelectors = BZ_MAX_SELECTORS;
|
||||
|
||||
/*--- Undo the MTF values for the selectors. ---*/
|
||||
{
|
||||
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=xfsprogs
|
||||
PKG_CPE_ID:=cpe:/a:sgi:xfsprogs
|
||||
PKG_RELEASE:=2
|
||||
PKG_RELEASE:=3
|
||||
PKG_VERSION:=4.11.0
|
||||
PKG_SOURCE_URL:=@KERNEL/linux/utils/fs/xfs/xfsprogs
|
||||
PKG_HASH:=c3a6d87b564d7738243c507df82276bed982265e345363a95f2c764e8a5f5bb2
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
From 930f9aa8f08759fa739dd6e615ba8b3a1890008d Mon Sep 17 00:00:00 2001
|
||||
From: Rosen Penev <rosenp@gmail.com>
|
||||
Date: Mon, 6 May 2019 13:56:13 -0700
|
||||
Subject: [PATCH] db/malloc: Use posix_memalign instead of deprecated valloc
|
||||
|
||||
valloc is not available with uClibc-ng as well as being deprecated, which
|
||||
causes compilation errors. aligned_alloc is not available before C11 so
|
||||
used posix_memalign.'
|
||||
|
||||
Signed-off-by: Rosen Penev <rosenp@gmail.com>
|
||||
---
|
||||
db/malloc.c | 3 +--
|
||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||
|
||||
diff --git a/db/malloc.c b/db/malloc.c
|
||||
index 77b3e022..38fe0b05 100644
|
||||
--- a/db/malloc.c
|
||||
+++ b/db/malloc.c
|
||||
@@ -56,8 +56,7 @@ xmalloc(
|
||||
{
|
||||
void *ptr;
|
||||
|
||||
- ptr = valloc(size);
|
||||
- if (ptr)
|
||||
+ if(!posix_memalign(&ptr, sysconf(_SC_PAGESIZE), size))
|
||||
return ptr;
|
||||
badmalloc();
|
||||
/* NOTREACHED */
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -17,7 +17,7 @@ for pkg in `find $pkg_dir -name '*.ipk' | sort`; do
|
||||
[[ "$name" = "kernel" ]] && continue
|
||||
[[ "$name" = "libc" ]] && continue
|
||||
echo "Generating index for package $pkg" >&2
|
||||
file_size=$(ls -l $pkg | awk '{print $5}')
|
||||
file_size=$(stat -L -c%s $pkg)
|
||||
sha256sum=$(mkhash sha256 $pkg)
|
||||
# Take pains to make variable value sed-safe
|
||||
sed_safe_pkg=`echo $pkg | sed -e 's/^\.\///g' -e 's/\\//\\\\\\//g'`
|
||||
|
||||
@@ -9,7 +9,7 @@ outfile=""
|
||||
err=""
|
||||
|
||||
get_magic_word() {
|
||||
dd if=$1 bs=2 count=1 2>/dev/null | hexdump -v -n 2 -e '1/1 "%02x"'
|
||||
dd if=$1 bs=2 count=1 2>/dev/null | od -A n -N 2 -t x1 | tr -d ' '
|
||||
}
|
||||
|
||||
is_ubifs() {
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
};
|
||||
|
||||
cpu_alert6: cpu-alert6 {
|
||||
temperature = <850000>; /* millicelsius */
|
||||
temperature = <85000>; /* millicelsius */
|
||||
hysteresis = <2000>; /* millicelsius */
|
||||
type = "active";
|
||||
};
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#define AR7_IRQ_UART0 15
|
||||
--- a/arch/mips/Kconfig
|
||||
+++ b/arch/mips/Kconfig
|
||||
@@ -161,7 +161,7 @@ config AR7
|
||||
@@ -162,7 +162,7 @@ config AR7
|
||||
select HAVE_CLK
|
||||
help
|
||||
Support for the Texas Instruments AR7 System-on-a-Chip
|
||||
@@ -46,7 +46,7 @@
|
||||
|
||||
config ATH25
|
||||
bool "Atheros AR231x/AR531x SoC support"
|
||||
@@ -1008,6 +1008,7 @@ config MIPS_PARAVIRT
|
||||
@@ -1006,6 +1006,7 @@ config MIPS_PARAVIRT
|
||||
endchoice
|
||||
|
||||
source "arch/mips/alchemy/Kconfig"
|
||||
|
||||
@@ -111,7 +111,7 @@ static void __init hiveap_121_setup(void)
|
||||
ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
|
||||
ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
|
||||
ath79_eth0_data.phy_mask = BIT(HIVEAP_121_LAN_PHYADDR);
|
||||
ath79_eth0_pll_data.pll_1000 = 0x0e000000;
|
||||
ath79_eth0_pll_data.pll_1000 = 0x06000000;
|
||||
ath79_eth0_pll_data.pll_100 = 0x00000101;
|
||||
ath79_eth0_pll_data.pll_10 = 0x00001313;
|
||||
ath79_register_eth(0);
|
||||
|
||||
@@ -222,6 +222,7 @@ static void __init wnr2200_setup(void)
|
||||
|
||||
wnr2200_get_wmac(wlan_mac_addr, WNR2200_MAC0_OFFSET,
|
||||
WNR2200_MAC1_OFFSET, WNR2200_WMAC_OFFSET);
|
||||
ap9x_pci_setup_wmac_led_pin(0, 0);
|
||||
ap91_pci_init(art + WNR2200_PCIE_CALDATA_OFFSET, wlan_mac_addr);
|
||||
|
||||
ath79_register_leds_gpio(-1, ARRAY_SIZE(wnr2200_leds_gpio),
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user