From b8f8afb7d01e892fe0d23e4f7f6a5cf86412faaf Mon Sep 17 00:00:00 2001 From: ricksuzade-maker <58425544+ricksuzade-maker@users.noreply.github.com> Date: Sat, 18 Apr 2020 11:20:24 +0800 Subject: [PATCH 01/11] Bump wireguard to 1.0.20200413 (#4361) Bump to the newest version of wireguard --- package/network/services/wireguard/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/services/wireguard/Makefile b/package/network/services/wireguard/Makefile index 2d8a766023..cc9c35c92e 100644 --- a/package/network/services/wireguard/Makefile +++ b/package/network/services/wireguard/Makefile @@ -11,12 +11,12 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=wireguard -PKG_VERSION:=1.0.20200401 +PKG_VERSION:=1.0.20200413 PKG_RELEASE:=1 PKG_SOURCE:=wireguard-linux-compat-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://git.zx2c4.com/wireguard-linux-compat/snapshot/ -PKG_HASH:=7dfb4a8315e1d6ae406ff32d01c496175df558dd65968a19e5222d02c7cfb77a +PKG_HASH:=cf166348fbb67419528e73049ce001d29131aea367fa6aef9d3e223f7251e116 PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=COPYING From b7e9fc662c53c126cd9f62887509a9148f26fc98 Mon Sep 17 00:00:00 2001 From: Kui Wu Date: Sat, 18 Apr 2020 20:20:40 +0800 Subject: [PATCH 02/11] luci-app-frpc: add proxy_protocol_version option for proxy config (#4370) --- package/lean/luci-app-frpc/Makefile | 4 ++-- .../luci-app-frpc/luasrc/i18n/frp.zh-cn.lmo | Bin 4004 -> 5032 bytes .../luasrc/model/cbi/frp/config.lua | 9 +++++++++ .../lean/luci-app-frpc/root/etc/init.d/frp | 9 +++++++-- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/package/lean/luci-app-frpc/Makefile b/package/lean/luci-app-frpc/Makefile index 911ad624d4..ed9bb9c865 100644 --- a/package/lean/luci-app-frpc/Makefile +++ b/package/lean/luci-app-frpc/Makefile @@ -9,8 +9,8 @@ include $(TOPDIR)/rules.mk LUCI_TITLE:=LuCI for FRPC LUCI_DEPENDS:=+wget +frpc LUCI_PKGARCH:=all -PKG_VERSION:=1.1 -PKG_RELEASE:=2 +PKG_VERSION:=1.2 +PKG_RELEASE:=1 include $(TOPDIR)/feeds/luci/luci.mk diff --git a/package/lean/luci-app-frpc/luasrc/i18n/frp.zh-cn.lmo b/package/lean/luci-app-frpc/luasrc/i18n/frp.zh-cn.lmo index f3b95348f88a98819790b4e8ff91847fd3378504..9e48c9b3fad24425271ac5c91888635be699583a 100644 GIT binary patch delta 2629 zcmaKt3se->8OQIku)wnNSb1qsMumW4LM+rAbxWdvq9TGq>tbzH1WiG)fJ!2|3xYhB zl_i7naCzyXps)*x1r-n?n)+(7QKO+W;&EqZKwBD{5S3Q@AI8LAD zv?ZL;$hLJdHJZ|!tENzd#D+#w%)~Y!D}R*f>7qy(MIvHjqs^ViS=~XpNW4Tu(Kp22 zcs>>{qIFggw7<1i5Z8KuGaV+x+*5DKHW9+LoM1|e2pKM`W0-H zvz;ZpQc~JZN(hmy%H>QQmbM%StiF~p)=W-};ilo#X85H77P5ar*t!asg zJ7$K!c>?ugyA*-EN{AxxmBs(CO-tM&SWcrX`cs1SXjk@sTbDX*S1mdG>SY(b+!hdA4a6C5pM^=<_G)L z9-7S7Wn=2-Eq1~56}z8WQG_nHoA-%*gvjaDt7*u$eA);zdYN>ADl|Hd60*UxPrRy@ z#(Ji!1dU=^Dkv&2WBbm)#EgW%q_my?bL}Q>0$q zAy!XATyRx1*hw0=@VAbxe!YZPDoMux#>2>3OZQ`>uhJ6j8YbE;%lG z;l2R(1%v0gEmPllF!zhM;cp23iOl`>%n0vc$!S8Qyn)NqpSXSC_P3!L@Kdn+)Yv6A z!rIP0LxnbirCujJW=tuY5rzw{fMs5Py`=p8jv&j}W_Ju!~=q!DG@LF9ai|;Gf9-Q-=OItMl?qlx!V%#cbQDk)=^?M#z`2JOZj_ zt+dM2Ehof54VDK+Rx0l|9fwG~uw)ALuw?T)2d1FJ2C#idNYY2-R?ZRVXMi0-*GJ!d z^J4j0ILrl0LPu66F7&VRK`tu3hc#io#*tMoyKm#JOz`ILDD!3CkgwE``I5<&&R(7z zu=7C$F318)mU|XAi>Jn+I%3|TJWBU`!#67=GRXeCe$=C|%76#SBk;{v;ElLAcHMWo zy#gRdVmT>C#txn^H;ke?_F&=?-=Qk$dvY@t7hd8OUbAeF=S_-R)#L9y8b`?=gIA~Q z8Fy^h^|debw}Is;-1fMtfDOM!3(R0eDw}Y%Dr+&?BPjsO($eE?4V$Ab@Wn6)VookVX+A+5(O_dgfsM>#<;v-uM{l*l;YP5>$$YZkb5XSz1{7F&>bCZi!HewsxbQ4k)>1Q8 z=lpqc1MKa<^4Dy~2Ow|VX6_vn&%1{f@fC7@%@V!^&h0PfAInNo_2a*~eF`?3&aYlq z(%immJ>+IA_rAC%$&Pl}SK)xaVBwX|q(eTNO7FrqKLhVxdDa%W=|<&Z#O4E*UHkH$ zviL<-JX%x-cDb%S73Qm{&>(aU_vIm+Nl+y+eQ4A%Xz$_=L(%iO;Q0^#^`bvCZ%!R% zh7U+;zIe2ETf`1jKy(Ql#T}{s#l4Q{_>ei2frCf<=_jht-e5%Numu~Aqp4fpn0%`D zIZE!zUohIVuT1!G*q#Nu{Jk=~@OsGFAq*AI&fi>pbmj}+W=y>(mgjE=eLM;dgpVOW x-htE8+ROgQ?}bBO%*=H&dsaxte9%G za`!GeQ(@Gpjn(Y~@?0uxQnFg(J0mC8q}3W5+vw74NpO@KJItD0 z=Ld@F2pN!P8M3PlxySTv&Hw8+U98o&=>}?4ruqy*sJZ+Kw+Um${3?U81?Ar{3kAmV z3~GcgrnU;^QnLl~S>*gN!D<#YEL7g@KlS2qGmw-i1^XzxnKkhFDZv{IzNrG;MG`7AbgtZUMcYf3<{n7SrHP{X8INhZv zC1L)lhY%nJ3p_(A9N)X+jF=6R#AcS6Q@A?PUMmCSGZ%bHW`wc#<*h=4Cgwn3;I{qb zw?l>CDzG4UFf4wtSBX0zX64}05D)EO#9LhtAr^XY+{#(25`A_(C?-BZ%lZBxaGh!>nTV3k#uRC5qz)i5L za{JHO=UCoXF`SLy9ID61@}W$oKtoOi5}pNz1*LJp{#=Zh5yUH&D(%EG9V5^{363pE zS1q|PjUS2g3&CqobS_AkJ-Tly1Tz!-sI29?&7#pkJQ<7GpLeE6>bgW;I~{@;1NP^> zCI=@6oZ=v6m|xSA^R2A!ig6i0gC(pheOWI0A+Zt;RbZQj?fQ;Bj&Cm-41-0@Z~f1t zZ@Yz$pQQ&^w^)QH-^tp5m{kl8ySOGMSJV9A2E>dYhpx-~e)rAlKhP@_yrAoKV|emk zNjG4SG30RL_gqXTlWQnvPM#tyugg)d%vg*7_Jv}1*2=;+)D#D vF+Ac|cFiks>56_hWE2TU#$4z)tpgnLxZvoqln>$tmpconf || return 1 } - + [ -n "$proxy_protocol_version" ] && { + if [ "$proxy_protocol_version" != "disable" ]; then + echo "proxy_protocol_version=$proxy_protocol_version" >>$tmpconf + fi + } frp_write_bool use_encryption $cfg 1 frp_write_bool use_compression $cfg 1 From c33118190f0169c389e8b644c630f8f7c386613f Mon Sep 17 00:00:00 2001 From: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com> Date: Sun, 19 Apr 2020 14:31:01 +0800 Subject: [PATCH 03/11] bcm63xx: refresh patches (#4372) --- ...63xx_enet-do-not-rely-on-probe-order.patch | 4 +-- ...-managed-functions-for-clock-ioremap.patch | 16 ++++++------ ...net-drop-unneeded-NULL-phy_clk-check.patch | 4 +-- ...enet-just-use-enet-as-the-clock-name.patch | 4 +-- ...-platform-data-for-dma-channel-numbe.patch | 4 +-- ...x_enet-remove-pointless-mac_id-check.patch | 2 +- ...-platform-device-id-directly-for-mii.patch | 4 +-- ...3XX-fix-switch-core-reset-on-BCM6368.patch | 26 ------------------- ...402_bcm63xx_enet_vlan_incoming_fixed.patch | 2 +- ...-move-phy_-dis-connect-into-probe-re.patch | 22 ++++++++-------- ...enable-rgmii-clock-on-external-ports.patch | 2 +- .../423-bcm63xx_enet_add_b53_support.patch | 12 ++++----- ...4-bcm63xx_enet_no_request_mem_region.patch | 2 +- .../804-bcm63xx_enet_63268_rgmii_ports.patch | 2 +- 14 files changed, 40 insertions(+), 66 deletions(-) delete mode 100644 target/linux/brcm63xx/patches-4.14/001-4.21-01-BCM63XX-fix-switch-core-reset-on-BCM6368.patch diff --git a/target/linux/brcm63xx/patches-4.14/001-4.15-10-bcm63xx_enet-do-not-rely-on-probe-order.patch b/target/linux/brcm63xx/patches-4.14/001-4.15-10-bcm63xx_enet-do-not-rely-on-probe-order.patch index fd3ced47b0..b339580c48 100644 --- a/target/linux/brcm63xx/patches-4.14/001-4.15-10-bcm63xx_enet-do-not-rely-on-probe-order.patch +++ b/target/linux/brcm63xx/patches-4.14/001-4.15-10-bcm63xx_enet-do-not-rely-on-probe-order.patch @@ -14,7 +14,7 @@ Signed-off-by: Jonas Gorski --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c -@@ -1722,10 +1722,8 @@ static int bcm_enet_probe(struct platfor +@@ -1723,10 +1723,8 @@ static int bcm_enet_probe(struct platfor const char *clk_name; int i, ret; @@ -26,7 +26,7 @@ Signed-off-by: Jonas Gorski res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); res_irq_rx = platform_get_resource(pdev, IORESOURCE_IRQ, 1); -@@ -2700,11 +2698,8 @@ static int bcm_enetsw_probe(struct platf +@@ -2701,11 +2699,8 @@ static int bcm_enetsw_probe(struct platf struct resource *res_mem; int ret, irq_rx, irq_tx; diff --git a/target/linux/brcm63xx/patches-4.14/001-4.15-11-bcm63xx_enet-use-managed-functions-for-clock-ioremap.patch b/target/linux/brcm63xx/patches-4.14/001-4.15-11-bcm63xx_enet-use-managed-functions-for-clock-ioremap.patch index f007750b3c..cf0971c911 100644 --- a/target/linux/brcm63xx/patches-4.14/001-4.15-11-bcm63xx_enet-use-managed-functions-for-clock-ioremap.patch +++ b/target/linux/brcm63xx/patches-4.14/001-4.15-11-bcm63xx_enet-use-managed-functions-for-clock-ioremap.patch @@ -13,7 +13,7 @@ Signed-off-by: Jonas Gorski --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c -@@ -1767,14 +1767,14 @@ static int bcm_enet_probe(struct platfor +@@ -1768,14 +1768,14 @@ static int bcm_enet_probe(struct platfor clk_name = "enet1"; } @@ -30,7 +30,7 @@ Signed-off-by: Jonas Gorski /* initialize default and fetch platform data */ priv->rx_ring_size = BCMENET_DEF_RX_DESC; -@@ -1802,7 +1802,7 @@ static int bcm_enet_probe(struct platfor +@@ -1803,7 +1803,7 @@ static int bcm_enet_probe(struct platfor if (priv->mac_id == 0 && priv->has_phy && !priv->use_external_mii) { /* using internal PHY, enable clock */ @@ -39,7 +39,7 @@ Signed-off-by: Jonas Gorski if (IS_ERR(priv->phy_clk)) { ret = PTR_ERR(priv->phy_clk); priv->phy_clk = NULL; -@@ -1810,7 +1810,7 @@ static int bcm_enet_probe(struct platfor +@@ -1811,7 +1811,7 @@ static int bcm_enet_probe(struct platfor } ret = clk_prepare_enable(priv->phy_clk); if (ret) @@ -48,7 +48,7 @@ Signed-off-by: Jonas Gorski } /* do minimal hardware init to be able to probe mii bus */ -@@ -1907,14 +1907,8 @@ out_uninit_hw: +@@ -1908,14 +1908,8 @@ out_uninit_hw: if (priv->phy_clk) clk_disable_unprepare(priv->phy_clk); @@ -63,7 +63,7 @@ Signed-off-by: Jonas Gorski out: free_netdev(dev); return ret; -@@ -1950,12 +1944,10 @@ static int bcm_enet_remove(struct platfo +@@ -1951,12 +1945,10 @@ static int bcm_enet_remove(struct platfo } /* disable hw block clocks */ @@ -78,7 +78,7 @@ Signed-off-by: Jonas Gorski free_netdev(dev); return 0; -@@ -2738,26 +2730,20 @@ static int bcm_enetsw_probe(struct platf +@@ -2739,26 +2731,20 @@ static int bcm_enetsw_probe(struct platf if (ret) goto out; @@ -111,7 +111,7 @@ Signed-off-by: Jonas Gorski priv->rx_chan = 0; priv->tx_chan = 1; -@@ -2789,15 +2775,6 @@ static int bcm_enetsw_probe(struct platf +@@ -2790,15 +2776,6 @@ static int bcm_enetsw_probe(struct platf out_disable_clk: clk_disable_unprepare(priv->mac_clk); @@ -127,7 +127,7 @@ Signed-off-by: Jonas Gorski out: free_netdev(dev); return ret; -@@ -2809,20 +2786,13 @@ static int bcm_enetsw_remove(struct plat +@@ -2810,20 +2787,13 @@ static int bcm_enetsw_remove(struct plat { struct bcm_enet_priv *priv; struct net_device *dev; diff --git a/target/linux/brcm63xx/patches-4.14/001-4.15-12-bcm63xx_enet-drop-unneeded-NULL-phy_clk-check.patch b/target/linux/brcm63xx/patches-4.14/001-4.15-12-bcm63xx_enet-drop-unneeded-NULL-phy_clk-check.patch index d2784386a2..34fdd5c41e 100644 --- a/target/linux/brcm63xx/patches-4.14/001-4.15-12-bcm63xx_enet-drop-unneeded-NULL-phy_clk-check.patch +++ b/target/linux/brcm63xx/patches-4.14/001-4.15-12-bcm63xx_enet-drop-unneeded-NULL-phy_clk-check.patch @@ -13,7 +13,7 @@ Signed-off-by: Jonas Gorski --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c -@@ -1904,8 +1904,7 @@ out_free_mdio: +@@ -1905,8 +1905,7 @@ out_free_mdio: out_uninit_hw: /* turn off mdc clock */ enet_writel(priv, 0, ENET_MIISC_REG); @@ -23,7 +23,7 @@ Signed-off-by: Jonas Gorski out_disable_clk_mac: clk_disable_unprepare(priv->mac_clk); -@@ -1944,9 +1943,7 @@ static int bcm_enet_remove(struct platfo +@@ -1945,9 +1944,7 @@ static int bcm_enet_remove(struct platfo } /* disable hw block clocks */ diff --git a/target/linux/brcm63xx/patches-4.14/001-4.16-01-bcm63xx_enet-just-use-enet-as-the-clock-name.patch b/target/linux/brcm63xx/patches-4.14/001-4.16-01-bcm63xx_enet-just-use-enet-as-the-clock-name.patch index b3405e0eb2..c489001332 100644 --- a/target/linux/brcm63xx/patches-4.14/001-4.16-01-bcm63xx_enet-just-use-enet-as-the-clock-name.patch +++ b/target/linux/brcm63xx/patches-4.14/001-4.16-01-bcm63xx_enet-just-use-enet-as-the-clock-name.patch @@ -13,7 +13,7 @@ Signed-off-by: Jonas Gorski --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c -@@ -1719,7 +1719,6 @@ static int bcm_enet_probe(struct platfor +@@ -1720,7 +1720,6 @@ static int bcm_enet_probe(struct platfor struct bcm63xx_enet_platform_data *pd; struct resource *res_mem, *res_irq, *res_irq_rx, *res_irq_tx; struct mii_bus *bus; @@ -21,7 +21,7 @@ Signed-off-by: Jonas Gorski int i, ret; if (!bcm_enet_shared_base[0]) -@@ -1760,14 +1759,12 @@ static int bcm_enet_probe(struct platfor +@@ -1761,14 +1760,12 @@ static int bcm_enet_probe(struct platfor if (priv->mac_id == 0) { priv->rx_chan = 0; priv->tx_chan = 1; diff --git a/target/linux/brcm63xx/patches-4.14/001-4.16-02-bcm63xx_enet-use-platform-data-for-dma-channel-numbe.patch b/target/linux/brcm63xx/patches-4.14/001-4.16-02-bcm63xx_enet-use-platform-data-for-dma-channel-numbe.patch index 3a998e9309..f3ddd7445c 100644 --- a/target/linux/brcm63xx/patches-4.14/001-4.16-02-bcm63xx_enet-use-platform-data-for-dma-channel-numbe.patch +++ b/target/linux/brcm63xx/patches-4.14/001-4.16-02-bcm63xx_enet-use-platform-data-for-dma-channel-numbe.patch @@ -45,7 +45,7 @@ Signed-off-by: Jonas Gorski /* --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c -@@ -1755,15 +1755,6 @@ static int bcm_enet_probe(struct platfor +@@ -1756,15 +1756,6 @@ static int bcm_enet_probe(struct platfor priv->irq_tx = res_irq_tx->start; priv->mac_id = pdev->id; @@ -61,7 +61,7 @@ Signed-off-by: Jonas Gorski priv->mac_clk = devm_clk_get(&pdev->dev, "enet"); if (IS_ERR(priv->mac_clk)) { ret = PTR_ERR(priv->mac_clk); -@@ -1795,6 +1786,8 @@ static int bcm_enet_probe(struct platfor +@@ -1796,6 +1787,8 @@ static int bcm_enet_probe(struct platfor priv->dma_chan_width = pd->dma_chan_width; priv->dma_has_sram = pd->dma_has_sram; priv->dma_desc_shift = pd->dma_desc_shift; diff --git a/target/linux/brcm63xx/patches-4.14/001-4.16-03-bcm63xx_enet-remove-pointless-mac_id-check.patch b/target/linux/brcm63xx/patches-4.14/001-4.16-03-bcm63xx_enet-remove-pointless-mac_id-check.patch index cead5c2269..a656e4f0ab 100644 --- a/target/linux/brcm63xx/patches-4.14/001-4.16-03-bcm63xx_enet-remove-pointless-mac_id-check.patch +++ b/target/linux/brcm63xx/patches-4.14/001-4.16-03-bcm63xx_enet-remove-pointless-mac_id-check.patch @@ -14,7 +14,7 @@ Signed-off-by: Jonas Gorski --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c -@@ -1790,7 +1790,7 @@ static int bcm_enet_probe(struct platfor +@@ -1791,7 +1791,7 @@ static int bcm_enet_probe(struct platfor priv->tx_chan = pd->tx_chan; } diff --git a/target/linux/brcm63xx/patches-4.14/001-4.16-04-bcm63xx_enet-use-platform-device-id-directly-for-mii.patch b/target/linux/brcm63xx/patches-4.14/001-4.16-04-bcm63xx_enet-use-platform-device-id-directly-for-mii.patch index 200178b350..cab9e5a37a 100644 --- a/target/linux/brcm63xx/patches-4.14/001-4.16-04-bcm63xx_enet-use-platform-device-id-directly-for-mii.patch +++ b/target/linux/brcm63xx/patches-4.14/001-4.16-04-bcm63xx_enet-use-platform-device-id-directly-for-mii.patch @@ -15,7 +15,7 @@ Signed-off-by: Jonas Gorski --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c -@@ -1753,7 +1753,6 @@ static int bcm_enet_probe(struct platfor +@@ -1754,7 +1754,6 @@ static int bcm_enet_probe(struct platfor dev->irq = priv->irq = res_irq->start; priv->irq_rx = res_irq_rx->start; priv->irq_tx = res_irq_tx->start; @@ -23,7 +23,7 @@ Signed-off-by: Jonas Gorski priv->mac_clk = devm_clk_get(&pdev->dev, "enet"); if (IS_ERR(priv->mac_clk)) { -@@ -1821,7 +1820,7 @@ static int bcm_enet_probe(struct platfor +@@ -1822,7 +1821,7 @@ static int bcm_enet_probe(struct platfor bus->priv = priv; bus->read = bcm_enet_mdio_read_phylib; bus->write = bcm_enet_mdio_write_phylib; diff --git a/target/linux/brcm63xx/patches-4.14/001-4.21-01-BCM63XX-fix-switch-core-reset-on-BCM6368.patch b/target/linux/brcm63xx/patches-4.14/001-4.21-01-BCM63XX-fix-switch-core-reset-on-BCM6368.patch deleted file mode 100644 index 3914865c89..0000000000 --- a/target/linux/brcm63xx/patches-4.14/001-4.21-01-BCM63XX-fix-switch-core-reset-on-BCM6368.patch +++ /dev/null @@ -1,26 +0,0 @@ -From f1af8bb8e0879a3c2d9679a7274c2774335e9876 Mon Sep 17 00:00:00 2001 -From: Jonas Gorski -Date: Wed, 14 Nov 2018 12:06:41 +0100 -Subject: [PATCH] MIPS: BCM63XX: fix switch core reset on BCM6368 - -The Ethernet Switch core mask was set to 0, causing the switch core to -be not reset on BCM6368 on boot. Provide the proper mask so the switch -core gets reset to a known good state. - -Fixes: 799faa626c71 ("MIPS: BCM63XX: add core reset helper") -Signed-off-by: Jonas Gorski ---- - arch/mips/bcm63xx/reset.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/arch/mips/bcm63xx/reset.c -+++ b/arch/mips/bcm63xx/reset.c -@@ -120,7 +120,7 @@ - #define BCM6368_RESET_DSL 0 - #define BCM6368_RESET_SAR SOFTRESET_6368_SAR_MASK - #define BCM6368_RESET_EPHY SOFTRESET_6368_EPHY_MASK --#define BCM6368_RESET_ENETSW 0 -+#define BCM6368_RESET_ENETSW SOFTRESET_6368_ENETSW_MASK - #define BCM6368_RESET_PCM SOFTRESET_6368_PCM_MASK - #define BCM6368_RESET_MPI SOFTRESET_6368_MPI_MASK - #define BCM6368_RESET_PCIE 0 diff --git a/target/linux/brcm63xx/patches-4.14/402_bcm63xx_enet_vlan_incoming_fixed.patch b/target/linux/brcm63xx/patches-4.14/402_bcm63xx_enet_vlan_incoming_fixed.patch index 6275306975..3604910d39 100644 --- a/target/linux/brcm63xx/patches-4.14/402_bcm63xx_enet_vlan_incoming_fixed.patch +++ b/target/linux/brcm63xx/patches-4.14/402_bcm63xx_enet_vlan_incoming_fixed.patch @@ -1,6 +1,6 @@ --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c -@@ -1636,7 +1636,7 @@ static int bcm_enet_change_mtu(struct ne +@@ -1637,7 +1637,7 @@ static int bcm_enet_change_mtu(struct ne return -EBUSY; /* add ethernet header + vlan tag size */ diff --git a/target/linux/brcm63xx/patches-4.14/404-NET-bcm63xx_enet-move-phy_-dis-connect-into-probe-re.patch b/target/linux/brcm63xx/patches-4.14/404-NET-bcm63xx_enet-move-phy_-dis-connect-into-probe-re.patch index 13eecaf0ed..c9532e6cb4 100644 --- a/target/linux/brcm63xx/patches-4.14/404-NET-bcm63xx_enet-move-phy_-dis-connect-into-probe-re.patch +++ b/target/linux/brcm63xx/patches-4.14/404-NET-bcm63xx_enet-move-phy_-dis-connect-into-probe-re.patch @@ -15,7 +15,7 @@ Signed-off-by: Jonas Gorski --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c -@@ -869,10 +869,8 @@ static int bcm_enet_open(struct net_devi +@@ -870,10 +870,8 @@ static int bcm_enet_open(struct net_devi struct bcm_enet_priv *priv; struct sockaddr addr; struct device *kdev; @@ -26,7 +26,7 @@ Signed-off-by: Jonas Gorski void *p; u32 val; -@@ -880,40 +878,10 @@ static int bcm_enet_open(struct net_devi +@@ -881,40 +879,10 @@ static int bcm_enet_open(struct net_devi kdev = &priv->pdev->dev; if (priv->has_phy) { @@ -68,7 +68,7 @@ Signed-off-by: Jonas Gorski } /* mask all interrupts and request them */ -@@ -923,7 +891,7 @@ static int bcm_enet_open(struct net_devi +@@ -924,7 +892,7 @@ static int bcm_enet_open(struct net_devi ret = request_irq(dev->irq, bcm_enet_isr_mac, 0, dev->name, dev); if (ret) @@ -77,7 +77,7 @@ Signed-off-by: Jonas Gorski ret = request_irq(priv->irq_rx, bcm_enet_isr_dma, 0, dev->name, dev); -@@ -1085,8 +1053,8 @@ static int bcm_enet_open(struct net_devi +@@ -1086,8 +1054,8 @@ static int bcm_enet_open(struct net_devi enet_dmac_writel(priv, priv->dma_chan_int_mask, ENETDMAC_IRMASK, priv->tx_chan); @@ -88,7 +88,7 @@ Signed-off-by: Jonas Gorski else bcm_enet_adjust_link(dev); -@@ -1127,10 +1095,6 @@ out_freeirq_rx: +@@ -1128,10 +1096,6 @@ out_freeirq_rx: out_freeirq: free_irq(dev->irq, dev); @@ -99,7 +99,7 @@ Signed-off-by: Jonas Gorski return ret; } -@@ -1235,10 +1199,6 @@ static int bcm_enet_stop(struct net_devi +@@ -1236,10 +1200,6 @@ static int bcm_enet_stop(struct net_devi free_irq(priv->irq_rx, dev); free_irq(dev->irq, dev); @@ -110,7 +110,7 @@ Signed-off-by: Jonas Gorski return 0; } -@@ -1804,14 +1764,49 @@ static int bcm_enet_probe(struct platfor +@@ -1805,14 +1765,49 @@ static int bcm_enet_probe(struct platfor /* do minimal hardware init to be able to probe mii bus */ bcm_enet_hw_preinit(priv); @@ -161,7 +161,7 @@ Signed-off-by: Jonas Gorski } bus = priv->mii_bus; -@@ -1835,6 +1830,35 @@ static int bcm_enet_probe(struct platfor +@@ -1836,6 +1831,35 @@ static int bcm_enet_probe(struct platfor dev_err(&pdev->dev, "unable to register mdio bus\n"); goto out_free_mdio; } @@ -197,7 +197,7 @@ Signed-off-by: Jonas Gorski } else { /* run platform code to initialize PHY device */ -@@ -1842,47 +1866,16 @@ static int bcm_enet_probe(struct platfor +@@ -1843,47 +1867,16 @@ static int bcm_enet_probe(struct platfor pd->mii_config(dev, 1, bcm_enet_mdio_read_mii, bcm_enet_mdio_write_mii)) { dev_err(&pdev->dev, "unable to configure mdio bus\n"); @@ -249,7 +249,7 @@ Signed-off-by: Jonas Gorski if (priv->mii_bus) mdiobus_unregister(priv->mii_bus); -@@ -1890,6 +1883,9 @@ out_free_mdio: +@@ -1891,6 +1884,9 @@ out_free_mdio: if (priv->mii_bus) mdiobus_free(priv->mii_bus); @@ -259,7 +259,7 @@ Signed-off-by: Jonas Gorski out_uninit_hw: /* turn off mdc clock */ enet_writel(priv, 0, ENET_MIISC_REG); -@@ -1920,6 +1916,7 @@ static int bcm_enet_remove(struct platfo +@@ -1921,6 +1917,7 @@ static int bcm_enet_remove(struct platfo enet_writel(priv, 0, ENET_MIISC_REG); if (priv->has_phy) { diff --git a/target/linux/brcm63xx/patches-4.14/408-bcm63xx_enet-enable-rgmii-clock-on-external-ports.patch b/target/linux/brcm63xx/patches-4.14/408-bcm63xx_enet-enable-rgmii-clock-on-external-ports.patch index 7a1a56a00e..7bd1e51e7e 100644 --- a/target/linux/brcm63xx/patches-4.14/408-bcm63xx_enet-enable-rgmii-clock-on-external-ports.patch +++ b/target/linux/brcm63xx/patches-4.14/408-bcm63xx_enet-enable-rgmii-clock-on-external-ports.patch @@ -32,7 +32,7 @@ Subject: [PATCH 54/81] bcm63xx_enet: enable rgmii clock on external ports #define ENETSW_MDIOC_EXT_MASK (1 << 16) --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c -@@ -2191,6 +2191,18 @@ static int bcm_enetsw_open(struct net_de +@@ -2192,6 +2192,18 @@ static int bcm_enetsw_open(struct net_de priv->sw_port_link[i] = 0; } diff --git a/target/linux/brcm63xx/patches-4.14/423-bcm63xx_enet_add_b53_support.patch b/target/linux/brcm63xx/patches-4.14/423-bcm63xx_enet_add_b53_support.patch index ba2a8f93dd..58f1b13d38 100644 --- a/target/linux/brcm63xx/patches-4.14/423-bcm63xx_enet_add_b53_support.patch +++ b/target/linux/brcm63xx/patches-4.14/423-bcm63xx_enet_add_b53_support.patch @@ -20,7 +20,7 @@ #include #include "bcm63xx_enet.h" -@@ -1936,7 +1937,8 @@ static int bcm_enet_remove(struct platfo +@@ -1937,7 +1938,8 @@ static int bcm_enet_remove(struct platfo return 0; } @@ -30,7 +30,7 @@ .probe = bcm_enet_probe, .remove = bcm_enet_remove, .driver = { -@@ -1945,6 +1947,42 @@ struct platform_driver bcm63xx_enet_driv +@@ -1946,6 +1948,42 @@ struct platform_driver bcm63xx_enet_driv }, }; @@ -73,7 +73,7 @@ /* * switch mii access callbacks */ -@@ -2203,29 +2241,6 @@ static int bcm_enetsw_open(struct net_de +@@ -2204,29 +2242,6 @@ static int bcm_enetsw_open(struct net_de enetsw_writeb(priv, rgmii_ctrl, ENETSW_RGMII_CTRL_REG(i)); } @@ -103,7 +103,7 @@ /* initialize flow control buffer allocation */ enet_dma_writel(priv, ENETDMA_BUFALLOC_FORCE_MASK | 0, ENETDMA_BUFALLOC_REG(priv->rx_chan)); -@@ -2684,6 +2699,9 @@ static int bcm_enetsw_probe(struct platf +@@ -2685,6 +2700,9 @@ static int bcm_enetsw_probe(struct platf struct bcm63xx_enetsw_platform_data *pd; struct resource *res_mem; int ret, irq_rx, irq_tx; @@ -113,7 +113,7 @@ if (!bcm_enet_shared_base[0]) return -EPROBE_DEFER; -@@ -2766,6 +2784,43 @@ static int bcm_enetsw_probe(struct platf +@@ -2767,6 +2785,43 @@ static int bcm_enetsw_probe(struct platf priv->pdev = pdev; priv->net_dev = dev; @@ -157,7 +157,7 @@ return 0; out_disable_clk: -@@ -2787,6 +2842,9 @@ static int bcm_enetsw_remove(struct plat +@@ -2788,6 +2843,9 @@ static int bcm_enetsw_remove(struct plat priv = netdev_priv(dev); unregister_netdev(dev); diff --git a/target/linux/brcm63xx/patches-4.14/424-bcm63xx_enet_no_request_mem_region.patch b/target/linux/brcm63xx/patches-4.14/424-bcm63xx_enet_no_request_mem_region.patch index 79f6b9a1d2..6235c8cad6 100644 --- a/target/linux/brcm63xx/patches-4.14/424-bcm63xx_enet_no_request_mem_region.patch +++ b/target/linux/brcm63xx/patches-4.14/424-bcm63xx_enet_no_request_mem_region.patch @@ -1,6 +1,6 @@ --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c -@@ -2743,9 +2743,9 @@ static int bcm_enetsw_probe(struct platf +@@ -2744,9 +2744,9 @@ static int bcm_enetsw_probe(struct platf if (ret) goto out; diff --git a/target/linux/brcm63xx/patches-4.14/804-bcm63xx_enet_63268_rgmii_ports.patch b/target/linux/brcm63xx/patches-4.14/804-bcm63xx_enet_63268_rgmii_ports.patch index 743b04b438..2d990f78e8 100644 --- a/target/linux/brcm63xx/patches-4.14/804-bcm63xx_enet_63268_rgmii_ports.patch +++ b/target/linux/brcm63xx/patches-4.14/804-bcm63xx_enet_63268_rgmii_ports.patch @@ -1,6 +1,6 @@ --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c -@@ -2238,6 +2238,10 @@ static int bcm_enetsw_open(struct net_de +@@ -2239,6 +2239,10 @@ static int bcm_enetsw_open(struct net_de rgmii_ctrl = enetsw_readb(priv, ENETSW_RGMII_CTRL_REG(i)); rgmii_ctrl |= ENETSW_RGMII_CTRL_GMII_CLK_EN; From 2a92a973a910b99269986a901e8a66eb2a533b5e Mon Sep 17 00:00:00 2001 From: CN_SZTL Date: Sun, 19 Apr 2020 19:52:26 +0800 Subject: [PATCH 04/11] luci-app-unblockneteasemusic-mini: drop outdated server --- package/ctcgfw/luci-app-unblockneteasemusic-mini/Makefile | 6 +++--- .../luasrc/model/cbi/unblockneteasemusic-mini.lua | 1 - .../root/etc/init.d/unblockneteasemusic-mini | 5 ----- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/package/ctcgfw/luci-app-unblockneteasemusic-mini/Makefile b/package/ctcgfw/luci-app-unblockneteasemusic-mini/Makefile index aacf71a01c..88e9183dc7 100644 --- a/package/ctcgfw/luci-app-unblockneteasemusic-mini/Makefile +++ b/package/ctcgfw/luci-app-unblockneteasemusic-mini/Makefile @@ -9,9 +9,9 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-unblockneteasemusic-mini PKG_VERSION:=1.2 -PKG_RELEASE:=7 -LUCI_TITLE:=LuCI support for UnblockNeteaseMusic (Mini) -LUCI_DEPENDS:=+dnsmasq-full +ipset +iptables +wget +PKG_RELEASE:=8 +LUCI_TITLE:=LuCI support for UnblockNeteaseMusic(-Go) +LUCI_DEPENDS:=+busybox +dnsmasq-full +ipset +iptables +wget LUCI_PKGARCH:=all PKG_MAINTAINER:=[CTCGFW]Project-OpenWrt diff --git a/package/ctcgfw/luci-app-unblockneteasemusic-mini/luasrc/model/cbi/unblockneteasemusic-mini.lua b/package/ctcgfw/luci-app-unblockneteasemusic-mini/luasrc/model/cbi/unblockneteasemusic-mini.lua index aa534c72ed..5766603581 100644 --- a/package/ctcgfw/luci-app-unblockneteasemusic-mini/luasrc/model/cbi/unblockneteasemusic-mini.lua +++ b/package/ctcgfw/luci-app-unblockneteasemusic-mini/luasrc/model/cbi/unblockneteasemusic-mini.lua @@ -19,7 +19,6 @@ select_server = s:option(ListValue, "select_server", translate("服务器位置" select_server:value("tencent_shanghai_nodejs", translate("[CTCGFW] 腾讯云上海(高音质)")) select_server:value("aliyun_beijing_nodejs", translate("[hyird] 阿里云北京(高音质)")) select_server:value("aliyun_beijing_nodejs_2", translate("[Sunsky] 阿里云北京(高音质)")) -select_server:value("mobile_henan_nodejs",translate("[CTCGFW] 移动河南(无损音质)")) select_server.description = translate("请合理使用本插件与各个服务器,请勿滥用") select_server.default = "tencent_shanghai_nodejs" select_server.rmempty = false diff --git a/package/ctcgfw/luci-app-unblockneteasemusic-mini/root/etc/init.d/unblockneteasemusic-mini b/package/ctcgfw/luci-app-unblockneteasemusic-mini/root/etc/init.d/unblockneteasemusic-mini index 1e9915ba84..d1d19c0096 100755 --- a/package/ctcgfw/luci-app-unblockneteasemusic-mini/root/etc/init.d/unblockneteasemusic-mini +++ b/package/ctcgfw/luci-app-unblockneteasemusic-mini/root/etc/init.d/unblockneteasemusic-mini @@ -22,11 +22,6 @@ elif [ "${select_server}" = "aliyun_beijing_nodejs_2" ]; then unblock_server_ip="39.96.56.58" unblock_server_http_port="30000" unblock_server_https_port="30001" -elif [ "${select_server}" = "mobile_henan_nodejs" ]; then - unblock_server_ip="$(ping "cdn-henan.service.project-openwrt.eu.org" -c 1 | sed '1{s/[^(]*(//;s/).*//;q}')" - [ -z "${unblock_server_ip}" ] && exit 1 - unblock_server_http_port="33221" - unblock_server_https_port="33222" fi set_ipset(){ From b09f99b1df08fff4883195714f09aea6f3414580 Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Sat, 18 Apr 2020 10:34:10 +0200 Subject: [PATCH 05/11] binutils: add ALTERNATIVES for strings (FS#3001) Don't move strings anymore to /bin/strings to avoid clash with busybox /usr/bin/strings but move it to /usr/bin/binutils-strings. Use ALTERNATIVES support to install it as /usr/bin/strings Signed-off-by: Hans Dedecker --- package/devel/binutils/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package/devel/binutils/Makefile b/package/devel/binutils/Makefile index 291f45205a..e04611f5d3 100644 --- a/package/devel/binutils/Makefile +++ b/package/devel/binutils/Makefile @@ -49,6 +49,7 @@ define Package/binutils CATEGORY:=Development TITLE:=binutils DEPENDS:=+objdump +ar + ALTERNATIVES:=200:/usr/bin/strings:/usr/bin/binutils-strings endef define Package/objdump @@ -114,7 +115,7 @@ endef define Package/binutils/install $(INSTALL_DIR) $(1)/usr $(1)/bin $(CP) $(PKG_INSTALL_DIR)/usr/bin/ $(1)/usr/ - mv $(1)/usr/bin/strings $(1)/bin/strings + mv $(1)/usr/bin/strings $(1)/usr/bin/binutils-strings rm -f $(1)/usr/bin/objdump rm -f $(1)/usr/bin/ar endef From f66fb8a94dcf60ec5eaa21aa6c0e199d6300308c Mon Sep 17 00:00:00 2001 From: Magnus Kroken Date: Fri, 17 Apr 2020 17:34:42 +0200 Subject: [PATCH 06/11] openvpn: update to 2.4.9 This is primarily a maintenance release with bugfixes and improvements. This release also fixes a security issue (CVE-2020-11810) which allows disrupting service of a freshly connected client that has not yet negotiated session keys. The vulnerability cannot be used to inject or steal VPN traffic. Release announcement: https://openvpn.net/community-downloads/#heading-13812 Full list of changes: https://community.openvpn.net/openvpn/wiki/ChangesInOpenvpn24#OpenVPN2.4.9 Signed-off-by: Magnus Kroken --- package/network/services/openvpn/Makefile | 4 ++-- .../patches/100-mbedtls-disable-runtime-version-check.patch | 2 +- .../110-openssl-dont-use-deprecated-ssleay-symbols.patch | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package/network/services/openvpn/Makefile b/package/network/services/openvpn/Makefile index baa8c1d07e..5f102d967d 100644 --- a/package/network/services/openvpn/Makefile +++ b/package/network/services/openvpn/Makefile @@ -9,14 +9,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=openvpn -PKG_VERSION:=2.4.8 +PKG_VERSION:=2.4.9 PKG_RELEASE:=1 PKG_SOURCE_URL:=\ https://build.openvpn.net/downloads/releases/ \ https://swupdate.openvpn.net/community/releases/ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz -PKG_HASH:=fb8ca66bb7807fff595fbdf2a0afd085c02a6aa47715c9aa3171002f9f1a3f91 +PKG_HASH:=641f3add8694b2ccc39fd4fd92554e4f089ad16a8db6d2b473ec284839a5ebe2 PKG_MAINTAINER:=Felix Fietkau diff --git a/package/network/services/openvpn/patches/100-mbedtls-disable-runtime-version-check.patch b/package/network/services/openvpn/patches/100-mbedtls-disable-runtime-version-check.patch index 7fc0089000..cb16a906fe 100644 --- a/package/network/services/openvpn/patches/100-mbedtls-disable-runtime-version-check.patch +++ b/package/network/services/openvpn/patches/100-mbedtls-disable-runtime-version-check.patch @@ -1,6 +1,6 @@ --- a/src/openvpn/ssl_mbedtls.c +++ b/src/openvpn/ssl_mbedtls.c -@@ -1406,7 +1406,7 @@ const char * +@@ -1415,7 +1415,7 @@ const char * get_ssl_library_version(void) { static char mbedtls_version[30]; diff --git a/package/network/services/openvpn/patches/110-openssl-dont-use-deprecated-ssleay-symbols.patch b/package/network/services/openvpn/patches/110-openssl-dont-use-deprecated-ssleay-symbols.patch index 7e9931f0f3..c7faf7c0c0 100644 --- a/package/network/services/openvpn/patches/110-openssl-dont-use-deprecated-ssleay-symbols.patch +++ b/package/network/services/openvpn/patches/110-openssl-dont-use-deprecated-ssleay-symbols.patch @@ -47,7 +47,7 @@ Signed-off-by: Gert Doering #endif --- a/src/openvpn/ssl_openssl.c +++ b/src/openvpn/ssl_openssl.c -@@ -1977,7 +1977,7 @@ get_highest_preference_tls_cipher(char * +@@ -2008,7 +2008,7 @@ get_highest_preference_tls_cipher(char * const char * get_ssl_library_version(void) { From 5440f3dc0109fe2f086bf525b387286475c27c7a Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Mon, 23 Mar 2020 23:22:04 +0100 Subject: [PATCH 07/11] busybox: backport Remove stime() function calls glibc 2.31 does not provide stime() any more, backport a fix from current busybox master to avoid using this function. Signed-off-by: Hauke Mehrtens --- .../001-remove-stime-function-calls.patch | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 package/utils/busybox/patches/001-remove-stime-function-calls.patch diff --git a/package/utils/busybox/patches/001-remove-stime-function-calls.patch b/package/utils/busybox/patches/001-remove-stime-function-calls.patch new file mode 100644 index 0000000000..ccf9bef356 --- /dev/null +++ b/package/utils/busybox/patches/001-remove-stime-function-calls.patch @@ -0,0 +1,84 @@ +From d3539be8f27b8cbfdfee460fe08299158f08bcd9 Mon Sep 17 00:00:00 2001 +From: Alistair Francis +Date: Tue, 19 Nov 2019 13:06:40 +0100 +Subject: Remove stime() function calls + +stime() has been deprecated in glibc 2.31 and replaced with +clock_settime(). Let's replace the stime() function calls with +clock_settime() in preperation. + +function old new delta +rdate_main 197 224 +27 +clock_settime - 27 +27 +date_main 926 941 +15 +stime 37 - -37 +------------------------------------------------------------------------------ +(add/remove: 2/2 grow/shrink: 2/0 up/down: 69/-37) Total: 32 bytes + +Signed-off-by: Alistair Francis +Signed-off-by: Denys Vlasenko +--- + coreutils/date.c | 6 +++++- + libbb/missing_syscalls.c | 8 -------- + util-linux/rdate.c | 8 ++++++-- + 3 files changed, 11 insertions(+), 11 deletions(-) + +--- a/coreutils/date.c ++++ b/coreutils/date.c +@@ -279,6 +279,9 @@ int date_main(int argc UNUSED_PARAM, cha + time(&ts.tv_sec); + #endif + } ++#if !ENABLE_FEATURE_DATE_NANO ++ ts.tv_nsec = 0; ++#endif + localtime_r(&ts.tv_sec, &tm_time); + + /* If date string is given, update tm_time, and maybe set date */ +@@ -301,9 +304,10 @@ int date_main(int argc UNUSED_PARAM, cha + if (date_str[0] != '@') + tm_time.tm_isdst = -1; + ts.tv_sec = validate_tm_time(date_str, &tm_time); ++ ts.tv_nsec = 0; + + /* if setting time, set it */ +- if ((opt & OPT_SET) && stime(&ts.tv_sec) < 0) { ++ if ((opt & OPT_SET) && clock_settime(CLOCK_REALTIME, &ts) < 0) { + bb_perror_msg("can't set date"); + } + } +--- a/libbb/missing_syscalls.c ++++ b/libbb/missing_syscalls.c +@@ -15,14 +15,6 @@ pid_t getsid(pid_t pid) + return syscall(__NR_getsid, pid); + } + +-int stime(const time_t *t) +-{ +- struct timeval tv; +- tv.tv_sec = *t; +- tv.tv_usec = 0; +- return settimeofday(&tv, NULL); +-} +- + int sethostname(const char *name, size_t len) + { + return syscall(__NR_sethostname, name, len); +--- a/util-linux/rdate.c ++++ b/util-linux/rdate.c +@@ -95,9 +95,13 @@ int rdate_main(int argc UNUSED_PARAM, ch + if (!(flags & 2)) { /* no -p (-s may be present) */ + if (time(NULL) == remote_time) + bb_error_msg("current time matches remote time"); +- else +- if (stime(&remote_time) < 0) ++ else { ++ struct timespec ts; ++ ts.tv_sec = remote_time; ++ ts.tv_nsec = 0; ++ if (clock_settime(CLOCK_REALTIME, &ts) < 0) + bb_perror_msg_and_die("can't set time of day"); ++ } + } + + if (flags != 1) /* not lone -s */ From 8aab70081bf290a71774031a5b79e8ef4ad26cac Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sat, 18 Apr 2020 17:42:02 +0200 Subject: [PATCH 08/11] upgs: Remove extra _DEFAULT_SOURCE definition This extra _DEFAULT_SOURCE definition results in a double definition which is a compile error. This fixes the following compile error with glibc: ---------------------------------------------------------------------- ugps-2019-06-25-cd7eabcd/nmea.c:19: error: "_DEFAULT_SOURCE" redefined [-Werror] #define _DEFAULT_SOURCE : note: this is the location of the previous definition cc1: all warnings being treated as errors Signed-off-by: Hauke Mehrtens --- package/utils/ugps/Makefile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/package/utils/ugps/Makefile b/package/utils/ugps/Makefile index 6eae5afbcf..85c64533d1 100644 --- a/package/utils/ugps/Makefile +++ b/package/utils/ugps/Makefile @@ -31,10 +31,6 @@ endef TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include -ifneq ($(CONFIG_USE_GLIBC),) - TARGET_CFLAGS += -D_DEFAULT_SOURCE -endif - define Package/ugps/conffiles /etc/config/gps endef From c0204980f8a8a14f5c00462f0294f5f8b1cee4f5 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sat, 18 Apr 2020 17:50:03 +0200 Subject: [PATCH 09/11] dante: Fix compile with glibc When compiled with glibc the config_scan.c wants to use the cpupolicy2numeric() function which is only available when HAVE_SCHED_SETSCHEDULER is set. It looks like the wrong define was used here. This fixes a build problem with glibc in combination with the force ac_cv_func_sched_setscheduler=no in the OpenWrt CONFIGURE_VARS. This fixes the following compile error with glibc: ---------------------------------------------------------------------- /bin/ld: config_scan.o: in function `socks_yylex': dante-1.4.1/sockd/config_scan.l:461: undefined reference to `cpupolicy2numeric' collect2: error: ld returned 1 exit status make[5]: *** [Makefile:522: sockd] Error 1 Fixes: aaf46a8fe23e ("dante: disable sched_getscheduler() - not implemented in musl") Signed-off-by: Hauke Mehrtens --- package/network/utils/dante/Makefile | 2 +- .../210-deactivate-sched_setscheduler.patch | 53 +++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 package/network/utils/dante/patches/210-deactivate-sched_setscheduler.patch diff --git a/package/network/utils/dante/Makefile b/package/network/utils/dante/Makefile index 4f5d08724c..15bd6d2afc 100644 --- a/package/network/utils/dante/Makefile +++ b/package/network/utils/dante/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dante PKG_VERSION:=1.4.1 -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://www.inet.no/dante/files/ diff --git a/package/network/utils/dante/patches/210-deactivate-sched_setscheduler.patch b/package/network/utils/dante/patches/210-deactivate-sched_setscheduler.patch new file mode 100644 index 0000000000..e711189c59 --- /dev/null +++ b/package/network/utils/dante/patches/210-deactivate-sched_setscheduler.patch @@ -0,0 +1,53 @@ +When compiled with glibc the config_scan.c wants to use the +cpupolicy2numeric() function which is only available when +HAVE_SCHED_SETSCHEDULER is set. It looks like the wrong define was used here. + +This fixes a build problem with glibc in combination with the force +ac_cv_func_sched_setscheduler=no in the OpenWrt CONFIGURE_VARS. + +--- a/lib/config_scan.c ++++ b/lib/config_scan.c +@@ -3891,7 +3891,7 @@ YY_RULE_SETUP + SERRX(0); + + #else /* !SOCKS_CLIENT */ +-#if HAVE_SCHED_SETAFFINITY ++#if HAVE_SCHED_SETSCHEDULER + + BEGIN(0); + +@@ -3899,9 +3899,9 @@ YY_RULE_SETUP + yyerrorx("unknown scheduling policy \"%s\"", yytext); + + return SCHEDULEPOLICY; +-#else /* !HAVE_SCHED_SETAFFINITY */ ++#else /* !HAVE_SCHED_SETSCHEDULER */ + yyerrorx("setting cpu scheduling policy is not supported on this platform"); +-#endif /* !HAVE_SCHED_SETAFFINITY */ ++#endif /* !HAVE_SCHED_SETSCHEDULER */ + + #endif /* SOCKS_CLIENT */ + } +--- a/lib/config_scan.l ++++ b/lib/config_scan.l +@@ -456,7 +456,7 @@ cpu { + SERRX(0); + + #else /* !SOCKS_CLIENT */ +-#if HAVE_SCHED_SETAFFINITY ++#if HAVE_SCHED_SETSCHEDULER + + BEGIN(0); + +@@ -464,9 +464,9 @@ cpu { + yyerrorx("unknown scheduling policy \"%s\"", yytext); + + return SCHEDULEPOLICY; +-#else /* !HAVE_SCHED_SETAFFINITY */ ++#else /* !HAVE_SCHED_SETSCHEDULER */ + yyerrorx("setting cpu scheduling policy is not supported on this platform"); +-#endif /* !HAVE_SCHED_SETAFFINITY */ ++#endif /* !HAVE_SCHED_SETSCHEDULER */ + + #endif /* SOCKS_CLIENT */ + } From 8f9d78fbdaf537beddf035671dae9dfa05afc491 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Mon, 16 Mar 2020 15:28:13 +0100 Subject: [PATCH 10/11] toolchain: glibc: Update glibc to version 2.31 This updates glibc to the most recent version 2.31. 001-regex-read-overrun.patch was a backport from a more recent version and is integrated in glibc 2.31. 050-Revert-Disallow-use-of-DES-encryption-functions-in-n.patch is needed to add the DES crypto functions back again. They were removed in glibc 2.28, but we still use them in ppp. musl lib also provides these DES crypto functions. Without them we would have to link ppp against openssl or an other crypto library. Signed-off-by: Hauke Mehrtens --- toolchain/glibc/common.mk | 6 +- .../patches/001-regex-read-overrun.patch | 26 - ...use-of-DES-encryption-functions-in-n.patch | 686 ++++++++++++++++++ .../patches/200-add-dl-search-paths.patch | 2 +- 4 files changed, 690 insertions(+), 30 deletions(-) delete mode 100644 toolchain/glibc/patches/001-regex-read-overrun.patch create mode 100644 toolchain/glibc/patches/050-Revert-Disallow-use-of-DES-encryption-functions-in-n.patch diff --git a/toolchain/glibc/common.mk b/toolchain/glibc/common.mk index 41ee989b14..99be398d3f 100644 --- a/toolchain/glibc/common.mk +++ b/toolchain/glibc/common.mk @@ -7,12 +7,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=glibc -PKG_VERSION:=2.27 +PKG_VERSION:=2.31 PKG_SOURCE_PROTO:=git PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE_VERSION:=bef0b1cb31bed76a355776154af9191ed1758222 -PKG_MIRROR_HASH:=24a137758acdc0d8c5254891204ba38d759838123bab09a64ec0bdb94289aafd +PKG_SOURCE_VERSION:=54ba2541b3a76441a9cbe5dd14c963bf874fd5e9 +PKG_MIRROR_HASH:=333bff38151f333e93a239aa91e0de28a1e7d24863aafe569caf05b9bdb01461 PKG_SOURCE_URL:=https://sourceware.org/git/glibc.git PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz diff --git a/toolchain/glibc/patches/001-regex-read-overrun.patch b/toolchain/glibc/patches/001-regex-read-overrun.patch deleted file mode 100644 index c4e4307aa6..0000000000 --- a/toolchain/glibc/patches/001-regex-read-overrun.patch +++ /dev/null @@ -1,26 +0,0 @@ -commit 583dd860d5b833037175247230a328f0050dbfe9 -Author: Paul Eggert -Date: Mon Jan 21 11:08:13 2019 -0800 - - regex: fix read overrun [BZ #24114] - - Problem found by AddressSanitizer, reported by Hongxu Chen in: - https://debbugs.gnu.org/34140 - * posix/regexec.c (proceed_next_node): - Do not read past end of input buffer. - ---- a/posix/regexec.c -+++ b/posix/regexec.c -@@ -1293,8 +1293,10 @@ proceed_next_node (const re_match_context_t *mctx, Idx nregs, regmatch_t *regs, - else if (naccepted) - { - char *buf = (char *) re_string_get_buffer (&mctx->input); -- if (memcmp (buf + regs[subexp_idx].rm_so, buf + *pidx, -- naccepted) != 0) -+ if (mctx->input.valid_len - *pidx < naccepted -+ || (memcmp (buf + regs[subexp_idx].rm_so, buf + *pidx, -+ naccepted) -+ != 0)) - return -1; - } - } diff --git a/toolchain/glibc/patches/050-Revert-Disallow-use-of-DES-encryption-functions-in-n.patch b/toolchain/glibc/patches/050-Revert-Disallow-use-of-DES-encryption-functions-in-n.patch new file mode 100644 index 0000000000..4e3e2eebb2 --- /dev/null +++ b/toolchain/glibc/patches/050-Revert-Disallow-use-of-DES-encryption-functions-in-n.patch @@ -0,0 +1,686 @@ +From cfc93329e00cd23c226f34b3ffd5552a93c35bd7 Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Mon, 23 Mar 2020 22:33:46 +0100 +Subject: Revert "Disallow use of DES encryption functions in new programs." + +This reverts commit b10a0accee709a5efff2fadf0b0bbb79ff0ad759. + +ppp still uses the encrypt functions from the libc. musl libc also +provides them. +--- + conform/data/stdlib.h-data | 3 + + conform/data/unistd.h-data | 6 ++ + crypt/cert.c | 26 ----- + crypt/crypt-entry.c | 15 ++- + crypt/crypt.h | 16 +++ + crypt/crypt_util.c | 9 -- + manual/conf.texi | 2 - + manual/crypt.texi | 201 +++++++++++++++++++++++++++++++++++++ + manual/string.texi | 82 +++++++-------- + posix/unistd.h | 22 ++-- + stdlib/stdlib.h | 6 ++ + sunrpc/Makefile | 2 +- + sunrpc/des_crypt.c | 7 +- + sunrpc/des_soft.c | 2 +- + 14 files changed, 303 insertions(+), 96 deletions(-) + +--- a/conform/data/stdlib.h-data ++++ b/conform/data/stdlib.h-data +@@ -149,6 +149,9 @@ function {unsigned short int*} seed48 (u + #if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98 + function int setenv (const char*, const char*, int) + #endif ++#if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX && !defined POSIX2008 ++function void setkey (const char*) ++#endif + #if !defined ISO && !defined ISO99 && !defined ISO11 && !defined XPG4 && !defined POSIX && !defined POSIX2008 + function {char*} setstate (char*) + #endif +--- a/conform/data/unistd.h-data ++++ b/conform/data/unistd.h-data +@@ -437,6 +437,9 @@ function int chroot (const char*) + function int chown (const char*, uid_t, gid_t) + function int close (int) + function size_t confstr (int, char*, size_t) ++#if !defined POSIX && !defined POSIX2008 ++function {char*} crypt (const char*, const char*) ++#endif + #if defined XPG4 || defined XPG42 || defined UNIX98 + function {char*} ctermid (char*) + function {char*} cuserid (char*) +@@ -446,6 +449,9 @@ allow cuserid + #endif + function int dup (int) + function int dup2 (int, int) ++#if !defined POSIX && !defined POSIX2008 ++function void encrypt (char[64], int) ++#endif + function int execl (const char*, const char*, ...) + function int execle (const char*, const char*, ...) + function int execlp (const char*, const char*, ...) +--- a/crypt/cert.c ++++ b/crypt/cert.c +@@ -10,22 +10,6 @@ + #include + #include "crypt.h" + +-/* This file tests the deprecated setkey/encrypt interface. */ +-#include +-#if TEST_COMPAT (libcrypt, GLIBC_2_0, GLIBC_2_28) +- +-#define libcrypt_version_reference(symbol, version) \ +- _libcrypt_version_reference (symbol, VERSION_libcrypt_##version) +-#define _libcrypt_version_reference(symbol, version) \ +- __libcrypt_version_reference (symbol, version) +-#define __libcrypt_version_reference(symbol, version) \ +- __asm__ (".symver " #symbol ", " #symbol "@" #version) +- +-extern void setkey (const char *); +-extern void encrypt (const char *, int); +-libcrypt_version_reference (setkey, GLIBC_2_0); +-libcrypt_version_reference (encrypt, GLIBC_2_0); +- + int totfails = 0; + + int main (int argc, char *argv[]); +@@ -120,13 +104,3 @@ put8 (char *cp) + printf("%02x", t); + } + } +- +-#else /* encrypt and setkey are not available. */ +- +-int +-main (void) +-{ +- return 77; /* UNSUPPORTED */ +-} +- +-#endif +--- a/crypt/crypt-entry.c ++++ b/crypt/crypt-entry.c +@@ -35,7 +35,6 @@ + #endif + + #include "crypt-private.h" +-#include + + /* Prototypes for local functions. */ + #ifndef __GNU_LIBRARY__ +@@ -177,7 +176,17 @@ crypt (const char *key, const char *salt + return __crypt_r (key, salt, &_ufc_foobar); + } + +-#if SHLIB_COMPAT (libcrypt, GLIBC_2_0, GLIBC_2_28) ++ ++/* ++ * To make fcrypt users happy. ++ * They don't need to call init_des. ++ */ ++#ifdef _LIBC + weak_alias (crypt, fcrypt) +-compat_symbol (libcrypt, fcrypt, fcrypt, GLIBC_2_0); ++#else ++char * ++__fcrypt (const char *key, const char *salt) ++{ ++ return crypt (key, salt); ++} + #endif +--- a/crypt/crypt.h ++++ b/crypt/crypt.h +@@ -36,6 +36,14 @@ __BEGIN_DECLS + extern char *crypt (const char *__phrase, const char *__salt) + __THROW __nonnull ((1, 2)); + ++/* Setup DES tables according KEY. */ ++extern void setkey (const char *__key) __THROW __nonnull ((1)); ++ ++/* Encrypt data in BLOCK in place if EDFLAG is zero; otherwise decrypt ++ block in place. */ ++extern void encrypt (char *__glibc_block, int __edflag) ++ __THROW __nonnull ((1)); ++ + #ifdef __USE_GNU + + /* This structure provides scratch and output buffers for 'crypt_r'. +@@ -63,6 +71,14 @@ struct crypt_data + extern char *crypt_r (const char *__phrase, const char *__salt, + struct crypt_data * __restrict __data) + __THROW __nonnull ((1, 2, 3)); ++ ++extern void setkey_r (const char *__key, ++ struct crypt_data * __restrict __data) ++ __THROW __nonnull ((1, 2)); ++ ++extern void encrypt_r (char *__glibc_block, int __edflag, ++ struct crypt_data * __restrict __data) ++ __THROW __nonnull ((1, 3)); + #endif + + __END_DECLS +--- a/crypt/crypt_util.c ++++ b/crypt/crypt_util.c +@@ -34,7 +34,6 @@ + #endif + + #include "crypt-private.h" +-#include + + /* Prototypes for local functions. */ + #ifndef __GNU_LIBRARY__ +@@ -151,7 +150,6 @@ static const int sbox[8][4][16]= { + } + }; + +-#if SHLIB_COMPAT (libcrypt, GLIBC_2_0, GLIBC_2_28) + /* + * This is the initial + * permutation matrix +@@ -162,7 +160,6 @@ static const int initial_perm[64] = { + 57, 49, 41, 33, 25, 17, 9, 1, 59, 51, 43, 35, 27, 19, 11, 3, + 61, 53, 45, 37, 29, 21, 13, 5, 63, 55, 47, 39, 31, 23, 15, 7 + }; +-#endif + + /* + * This is the final +@@ -788,7 +785,6 @@ _ufc_output_conversion_r (ufc_long v1, u + __data->crypt_3_buf[13] = 0; + } + +-#if SHLIB_COMPAT (libcrypt, GLIBC_2_0, GLIBC_2_28) + + /* + * UNIX encrypt function. Takes a bitvector +@@ -889,14 +885,12 @@ __encrypt_r (char *__block, int __edflag + } + } + weak_alias (__encrypt_r, encrypt_r) +-compat_symbol (libcrypt, encrypt_r, encrypt_r, GLIBC_2_0); + + void + encrypt (char *__block, int __edflag) + { + __encrypt_r(__block, __edflag, &_ufc_foobar); + } +-compat_symbol (libcrypt, encrypt, encrypt, GLIBC_2_0); + + + /* +@@ -921,15 +915,12 @@ __setkey_r (const char *__key, struct cr + _ufc_mk_keytab_r((char *) ktab, __data); + } + weak_alias (__setkey_r, setkey_r) +-compat_symbol (libcrypt, setkey_r, setkey_r, GLIBC_2_0); + + void + setkey (const char *__key) + { + __setkey_r(__key, &_ufc_foobar); + } +-compat_symbol (libcrypt, setkey, setkey, GLIBC_2_0); +-#endif /* SHLIB_COMPAT (libcrypt, GLIBC_2_0, GLIBC_2_28) */ + + void + __b64_from_24bit (char **cp, int *buflen, +--- a/manual/conf.texi ++++ b/manual/conf.texi +@@ -780,8 +780,6 @@ Inquire about the parameter correspondin + @item _SC_XOPEN_CRYPT + @standards{X/Open, unistd.h} + Inquire about the parameter corresponding to @code{_XOPEN_CRYPT}. +-@Theglibc no longer implements the @code{_XOPEN_CRYPT} extensions, +-so @samp{sysconf (_SC_XOPEN_CRYPT)} always returns @code{-1}. + + @item _SC_XOPEN_ENH_I18N + @standards{X/Open, unistd.h} +--- a/manual/crypt.texi ++++ b/manual/crypt.texi +@@ -16,8 +16,19 @@ subject to them, even if you do not use + yourself. The restrictions vary from place to place and are changed + often, so we cannot give any more specific advice than this warning. + ++@vindex AUTH_DES ++@cindex FIPS 140-2 ++It also provides support for Secure RPC, and some library functions that ++can be used to perform normal DES encryption. The @code{AUTH_DES} ++authentication flavor in Secure RPC, as provided by @theglibc{}, ++uses DES and does not comply with FIPS 140-2 nor does any other use of DES ++within @theglibc{}. It is recommended that Secure RPC should not be used ++for systems that need to comply with FIPS 140-2 since all flavors of ++encrypted authentication use normal DES. ++ + @menu + * Passphrase Storage:: One-way hashing for passphrases. ++* DES Encryption:: Routines for DES encryption. + * Unpredictable Bytes:: Randomness for cryptographic purposes. + @end menu + +@@ -200,6 +211,196 @@ hashes for the same passphrase. + @include testpass.c.texi + @end smallexample + ++@node DES Encryption ++@section DES Encryption ++ ++@cindex FIPS 46-3 ++The Data Encryption Standard is described in the US Government Federal ++Information Processing Standards (FIPS) 46-3 published by the National ++Institute of Standards and Technology. The DES has been very thoroughly ++analyzed since it was developed in the late 1970s, and no new ++significant flaws have been found. ++ ++However, the DES uses only a 56-bit key (plus 8 parity bits), and a ++machine has been built in 1998 which can search through all possible ++keys in about 6 days, which cost about US$200000; faster searches would ++be possible with more money. This makes simple DES insecure for most ++purposes, and NIST no longer permits new US government systems ++to use simple DES. ++ ++For serious encryption functionality, it is recommended that one of the ++many free encryption libraries be used instead of these routines. ++ ++The DES is a reversible operation which takes a 64-bit block and a ++64-bit key, and produces another 64-bit block. Usually the bits are ++numbered so that the most-significant bit, the first bit, of each block ++is numbered 1. ++ ++Under that numbering, every 8th bit of the key (the 8th, 16th, and so ++on) is not used by the encryption algorithm itself. But the key must ++have odd parity; that is, out of bits 1 through 8, and 9 through 16, and ++so on, there must be an odd number of `1' bits, and this completely ++specifies the unused bits. ++ ++@deftypefun void setkey (const char *@var{key}) ++@standards{BSD, crypt.h} ++@standards{SVID, crypt.h} ++@safety{@prelim{}@mtunsafe{@mtasurace{:crypt}}@asunsafe{@asucorrupt{} @asulock{}}@acunsafe{@aculock{}}} ++@c The static buffer stores the key, making it fundamentally ++@c thread-unsafe. The locking issues are only in the initialization ++@c path; cancelling the initialization will leave the lock held, it ++@c would otherwise repeat the initialization on the next call. ++ ++The @code{setkey} function sets an internal data structure to be an ++expanded form of @var{key}. @var{key} is specified as an array of 64 ++bits each stored in a @code{char}, the first bit is @code{key[0]} and ++the 64th bit is @code{key[63]}. The @var{key} should have the correct ++parity. ++@end deftypefun ++ ++@deftypefun void encrypt (char *@var{block}, int @var{edflag}) ++@standards{BSD, crypt.h} ++@standards{SVID, crypt.h} ++@safety{@prelim{}@mtunsafe{@mtasurace{:crypt}}@asunsafe{@asucorrupt{} @asulock{}}@acunsafe{@aculock{}}} ++@c Same issues as setkey. ++ ++The @code{encrypt} function encrypts @var{block} if ++@var{edflag} is 0, otherwise it decrypts @var{block}, using a key ++previously set by @code{setkey}. The result is ++placed in @var{block}. ++ ++Like @code{setkey}, @var{block} is specified as an array of 64 bits each ++stored in a @code{char}, but there are no parity bits in @var{block}. ++@end deftypefun ++ ++@deftypefun void setkey_r (const char *@var{key}, {struct crypt_data *} @var{data}) ++@deftypefunx void encrypt_r (char *@var{block}, int @var{edflag}, {struct crypt_data *} @var{data}) ++@standards{GNU, crypt.h} ++@c setkey_r: @safety{@prelim{}@mtsafe{}@asunsafe{@asucorrupt{} @asulock{}}@acunsafe{@aculock{}}} ++@safety{@prelim{}@mtsafe{}@asunsafe{@asucorrupt{} @asulock{}}@acunsafe{@aculock{}}} ++ ++These are reentrant versions of @code{setkey} and @code{encrypt}. The ++only difference is the extra parameter, which stores the expanded ++version of @var{key}. Before calling @code{setkey_r} the first time, ++@code{data->initialized} must be cleared to zero. ++@end deftypefun ++ ++The @code{setkey_r} and @code{encrypt_r} functions are GNU extensions. ++@code{setkey}, @code{encrypt}, @code{setkey_r}, and @code{encrypt_r} are ++defined in @file{crypt.h}. ++ ++@deftypefun int ecb_crypt (char *@var{key}, char *@var{blocks}, unsigned int @var{len}, unsigned int @var{mode}) ++@standards{SUNRPC, rpc/des_crypt.h} ++@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} ++ ++The function @code{ecb_crypt} encrypts or decrypts one or more blocks ++using DES. Each block is encrypted independently. ++ ++The @var{blocks} and the @var{key} are stored packed in 8-bit bytes, so ++that the first bit of the key is the most-significant bit of ++@code{key[0]} and the 63rd bit of the key is stored as the ++least-significant bit of @code{key[7]}. The @var{key} should have the ++correct parity. ++ ++@var{len} is the number of bytes in @var{blocks}. It should be a ++multiple of 8 (so that there are a whole number of blocks to encrypt). ++@var{len} is limited to a maximum of @code{DES_MAXDATA} bytes. ++ ++The result of the encryption replaces the input in @var{blocks}. ++ ++The @var{mode} parameter is the bitwise OR of two of the following: ++ ++@vtable @code ++@item DES_ENCRYPT ++@standards{SUNRPC, rpc/des_crypt.h} ++This constant, used in the @var{mode} parameter, specifies that ++@var{blocks} is to be encrypted. ++ ++@item DES_DECRYPT ++@standards{SUNRPC, rpc/des_crypt.h} ++This constant, used in the @var{mode} parameter, specifies that ++@var{blocks} is to be decrypted. ++ ++@item DES_HW ++@standards{SUNRPC, rpc/des_crypt.h} ++This constant, used in the @var{mode} parameter, asks to use a hardware ++device. If no hardware device is available, encryption happens anyway, ++but in software. ++ ++@item DES_SW ++@standards{SUNRPC, rpc/des_crypt.h} ++This constant, used in the @var{mode} parameter, specifies that no ++hardware device is to be used. ++@end vtable ++ ++The result of the function will be one of these values: ++ ++@vtable @code ++@item DESERR_NONE ++@standards{SUNRPC, rpc/des_crypt.h} ++The encryption succeeded. ++ ++@item DESERR_NOHWDEVICE ++@standards{SUNRPC, rpc/des_crypt.h} ++The encryption succeeded, but there was no hardware device available. ++ ++@item DESERR_HWERROR ++@standards{SUNRPC, rpc/des_crypt.h} ++The encryption failed because of a hardware problem. ++ ++@item DESERR_BADPARAM ++@standards{SUNRPC, rpc/des_crypt.h} ++The encryption failed because of a bad parameter, for instance @var{len} ++is not a multiple of 8 or @var{len} is larger than @code{DES_MAXDATA}. ++@end vtable ++@end deftypefun ++ ++@deftypefun int DES_FAILED (int @var{err}) ++@standards{SUNRPC, rpc/des_crypt.h} ++@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} ++This macro returns 1 if @var{err} is a `success' result code from ++@code{ecb_crypt} or @code{cbc_crypt}, and 0 otherwise. ++@end deftypefun ++ ++@deftypefun int cbc_crypt (char *@var{key}, char *@var{blocks}, unsigned int @var{len}, unsigned int @var{mode}, char *@var{ivec}) ++@standards{SUNRPC, rpc/des_crypt.h} ++@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} ++ ++The function @code{cbc_crypt} encrypts or decrypts one or more blocks ++using DES in Cipher Block Chaining mode. ++ ++For encryption in CBC mode, each block is exclusive-ored with @var{ivec} ++before being encrypted, then @var{ivec} is replaced with the result of ++the encryption, then the next block is processed. Decryption is the ++reverse of this process. ++ ++This has the advantage that blocks which are the same before being ++encrypted are very unlikely to be the same after being encrypted, making ++it much harder to detect patterns in the data. ++ ++Usually, @var{ivec} is set to 8 random bytes before encryption starts. ++Then the 8 random bytes are transmitted along with the encrypted data ++(without themselves being encrypted), and passed back in as @var{ivec} ++for decryption. Another possibility is to set @var{ivec} to 8 zeroes ++initially, and have the first block encrypted consist of 8 random ++bytes. ++ ++Otherwise, all the parameters are similar to those for @code{ecb_crypt}. ++@end deftypefun ++ ++@deftypefun void des_setparity (char *@var{key}) ++@standards{SUNRPC, rpc/des_crypt.h} ++@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} ++ ++The function @code{des_setparity} changes the 64-bit @var{key}, stored ++packed in 8-bit bytes, to have odd parity by altering the low bits of ++each byte. ++@end deftypefun ++ ++The @code{ecb_crypt}, @code{cbc_crypt}, and @code{des_setparity} ++functions and their accompanying macros are all defined in the header ++@file{rpc/des_crypt.h}. ++ + @node Unpredictable Bytes + @section Generating Unpredictable Bytes + @cindex randomness source +--- a/manual/string.texi ++++ b/manual/string.texi +@@ -36,8 +36,8 @@ too. + for delimiters. + * Erasing Sensitive Data:: Clearing memory which contains sensitive + data, after it's no longer needed. +-* Shuffling Bytes:: Or how to flash-cook a string. +-* Obfuscating Data:: Reversibly obscuring data from casual view. ++* strfry:: Function for flash-cooking a string. ++* Trivial Encryption:: Obscuring data. + * Encode Binary Data:: Encoding and Decoding of Binary Data. + * Argz and Envz Vectors:: Null-separated string vectors. + @end menu +@@ -2426,73 +2426,73 @@ functionality under a different name, su + systems it may be in @file{strings.h} instead. + @end deftypefun + +- +-@node Shuffling Bytes +-@section Shuffling Bytes ++@node strfry ++@section strfry + + The function below addresses the perennial programming quandary: ``How do + I take good data in string form and painlessly turn it into garbage?'' +-This is not a difficult thing to code for oneself, but the authors of +-@theglibc{} wish to make it as convenient as possible. ++This is actually a fairly simple task for C programmers who do not use ++@theglibc{} string functions, but for programs based on @theglibc{}, ++the @code{strfry} function is the preferred method for ++destroying string data. + +-To @emph{erase} data, use @code{explicit_bzero} (@pxref{Erasing +-Sensitive Data}); to obfuscate it reversibly, use @code{memfrob} +-(@pxref{Obfuscating Data}). ++The prototype for this function is in @file{string.h}. + + @deftypefun {char *} strfry (char *@var{string}) + @standards{GNU, string.h} + @safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} + @c Calls initstate_r, time, getpid, strlen, and random_r. + +-@code{strfry} performs an in-place shuffle on @var{string}. Each +-character is swapped to a position selected at random, within the +-portion of the string starting with the character's original position. +-(This is the Fisher-Yates algorithm for unbiased shuffling.) +- +-Calling @code{strfry} will not disturb any of the random number +-generators that have global state (@pxref{Pseudo-Random Numbers}). ++@code{strfry} creates a pseudorandom anagram of a string, replacing the ++input with the anagram in place. For each position in the string, ++@code{strfry} swaps it with a position in the string selected at random ++(from a uniform distribution). The two positions may be the same. + + The return value of @code{strfry} is always @var{string}. + + @strong{Portability Note:} This function is unique to @theglibc{}. +-It is declared in @file{string.h}. ++ + @end deftypefun + + +-@node Obfuscating Data +-@section Obfuscating Data ++@node Trivial Encryption ++@section Trivial Encryption ++@cindex encryption ++ ++ ++The @code{memfrob} function converts an array of data to something ++unrecognizable and back again. It is not encryption in its usual sense ++since it is easy for someone to convert the encrypted data back to clear ++text. The transformation is analogous to Usenet's ``Rot13'' encryption ++method for obscuring offensive jokes from sensitive eyes and such. ++Unlike Rot13, @code{memfrob} works on arbitrary binary data, not just ++text. + @cindex Rot13 + +-The @code{memfrob} function reversibly obfuscates an array of binary +-data. This is not true encryption; the obfuscated data still bears a +-clear relationship to the original, and no secret key is required to +-undo the obfuscation. It is analogous to the ``Rot13'' cipher used on +-Usenet for obscuring offensive jokes, spoilers for works of fiction, +-and so on, but it can be applied to arbitrary binary data. +- +-Programs that need true encryption---a transformation that completely +-obscures the original and cannot be reversed without knowledge of a +-secret key---should use a dedicated cryptography library, such as +-@uref{https://www.gnu.org/software/libgcrypt/,,libgcrypt}. +- +-Programs that need to @emph{destroy} data should use +-@code{explicit_bzero} (@pxref{Erasing Sensitive Data}), or possibly +-@code{strfry} (@pxref{Shuffling Bytes}). ++For true encryption, @xref{Cryptographic Functions}. ++ ++This function is declared in @file{string.h}. ++@pindex string.h + + @deftypefun {void *} memfrob (void *@var{mem}, size_t @var{length}) + @standards{GNU, string.h} + @safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} + +-The function @code{memfrob} obfuscates @var{length} bytes of data +-beginning at @var{mem}, in place. Each byte is bitwise xor-ed with +-the binary pattern 00101010 (hexadecimal 0x2A). The return value is +-always @var{mem}. +- +-@code{memfrob} a second time on the same data returns it to +-its original state. ++@code{memfrob} transforms (frobnicates) each byte of the data structure ++at @var{mem}, which is @var{length} bytes long, by bitwise exclusive ++oring it with binary 00101010. It does the transformation in place and ++its return value is always @var{mem}. ++ ++Note that @code{memfrob} a second time on the same data structure ++returns it to its original state. ++ ++This is a good function for hiding information from someone who doesn't ++want to see it or doesn't want to see it very much. To really prevent ++people from retrieving the information, use stronger encryption such as ++that described in @xref{Cryptographic Functions}. + + @strong{Portability Note:} This function is unique to @theglibc{}. +-It is declared in @file{string.h}. ++ + @end deftypefun + + @node Encode Binary Data +--- a/posix/unistd.h ++++ b/posix/unistd.h +@@ -107,6 +107,9 @@ __BEGIN_DECLS + /* The X/Open Unix extensions are available. */ + #define _XOPEN_UNIX 1 + ++/* Encryption is present. */ ++#define _XOPEN_CRYPT 1 ++ + /* The enhanced internationalization capabilities according to XPG4.2 + are present. */ + #define _XOPEN_ENH_I18N 1 +@@ -1115,17 +1118,20 @@ ssize_t copy_file_range (int __infd, __o + extern int fdatasync (int __fildes); + #endif /* Use POSIX199309 */ + +-#ifdef __USE_MISC +-/* One-way hash PHRASE, returning a string suitable for storage in the +- user database. SALT selects the one-way function to use, and +- ensures that no two users' hashes are the same, even if they use +- the same passphrase. The return value points to static storage +- which will be overwritten by the next call to crypt. */ ++ ++/* XPG4.2 specifies that prototypes for the encryption functions must ++ be defined here. */ ++#ifdef __USE_XOPEN ++/* Encrypt at most 8 characters from KEY using salt to perturb DES. */ + extern char *crypt (const char *__key, const char *__salt) + __THROW __nonnull ((1, 2)); +-#endif + +-#ifdef __USE_XOPEN ++/* Encrypt data in BLOCK in place if EDFLAG is zero; otherwise decrypt ++ block in place. */ ++extern void encrypt (char *__glibc_block, int __edflag) ++ __THROW __nonnull ((1)); ++ ++ + /* Swab pairs bytes in the first N bytes of the area pointed to by + FROM and copy the result to TO. The value of TO must not be in the + range [FROM - N + 1, FROM - 1]. If N is odd the first byte in FROM +--- a/stdlib/stdlib.h ++++ b/stdlib/stdlib.h +@@ -961,6 +961,12 @@ extern int getsubopt (char **__restrict + #endif + + ++#ifdef __USE_XOPEN ++/* Setup DES tables according KEY. */ ++extern void setkey (const char *__key) __THROW __nonnull ((1)); ++#endif ++ ++ + /* X/Open pseudo terminal handling. */ + + #ifdef __USE_XOPEN2KXSI +--- a/sunrpc/Makefile ++++ b/sunrpc/Makefile +@@ -51,7 +51,7 @@ rpcsvc = bootparam_prot.x nlm_prot.x rst + headers-sunrpc = $(addprefix rpc/,auth.h auth_unix.h clnt.h pmap_clnt.h \ + pmap_prot.h pmap_rmt.h rpc.h rpc_msg.h \ + svc.h svc_auth.h types.h xdr.h auth_des.h \ +- key_prot.h) \ ++ des_crypt.h key_prot.h rpc_des.h) \ + $(rpcsvc:%=rpcsvc/%) rpcsvc/bootparam.h + headers = rpc/netdb.h + install-others = $(inst_sysconfdir)/rpc +--- a/sunrpc/des_crypt.c ++++ b/sunrpc/des_crypt.c +@@ -86,9 +86,6 @@ common_crypt (char *key, char *buf, regi + return desdev == DES_SW ? DESERR_NONE : DESERR_NOHWDEVICE; + } + +-/* Note: these cannot be excluded from the build yet, because they are +- still used internally. */ +- + /* + * CBC mode encryption + */ +@@ -105,7 +102,7 @@ cbc_crypt (char *key, char *buf, unsigne + COPY8 (dp.des_ivec, ivec); + return err; + } +-hidden_nolink (cbc_crypt, libc, GLIBC_2_1) ++libc_hidden_nolink_sunrpc (cbc_crypt, GLIBC_2_1) + + /* + * ECB mode encryption +@@ -118,4 +115,4 @@ ecb_crypt (char *key, char *buf, unsigne + dp.des_mode = ECB; + return common_crypt (key, buf, len, mode, &dp); + } +-hidden_nolink (ecb_crypt, libc, GLIBC_2_1) ++libc_hidden_nolink_sunrpc (ecb_crypt, GLIBC_2_1) +--- a/sunrpc/des_soft.c ++++ b/sunrpc/des_soft.c +@@ -71,4 +71,4 @@ des_setparity (char *p) + p++; + } + } +-hidden_nolink (des_setparity, libc, GLIBC_2_1) ++libc_hidden_nolink_sunrpc (des_setparity, GLIBC_2_1) diff --git a/toolchain/glibc/patches/200-add-dl-search-paths.patch b/toolchain/glibc/patches/200-add-dl-search-paths.patch index 5585ee1f0e..18d751dd1a 100644 --- a/toolchain/glibc/patches/200-add-dl-search-paths.patch +++ b/toolchain/glibc/patches/200-add-dl-search-paths.patch @@ -2,7 +2,7 @@ add /usr/lib to default search path for the dynamic linker --- a/Makeconfig +++ b/Makeconfig -@@ -589,6 +589,9 @@ else +@@ -601,6 +601,9 @@ else default-rpath = $(libdir) endif From 9ad793f49437d806491d149fbb1548252bcaa319 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sat, 18 Apr 2020 20:00:35 +0200 Subject: [PATCH 11/11] toolchain: glibc: Define minimum support kernel version as 4.14 This will compile glibc in a way that it will only support kernel 4.14 and later. Compatibility code for older kernel versions will be removed. Signed-off-by: Hauke Mehrtens --- toolchain/glibc/common.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/toolchain/glibc/common.mk b/toolchain/glibc/common.mk index 99be398d3f..060fb2849e 100644 --- a/toolchain/glibc/common.mk +++ b/toolchain/glibc/common.mk @@ -60,7 +60,8 @@ GLIBC_CONFIGURE:= \ --without-gd \ --without-cvs \ --enable-add-ons \ - --$(if $(CONFIG_SOFT_FLOAT),without,with)-fp + --$(if $(CONFIG_SOFT_FLOAT),without,with)-fp \ + --enable-kernel=4.14.0 export libc_cv_ssp=no export libc_cv_ssp_strong=no