Skip to content

Commit

Permalink
[bot] AutoMerging: merge all upstream's changes:
Browse files Browse the repository at this point in the history
* https://github.com/coolsnowwolf/lede:
  ipq60xx: Add upstream patch for USB Support
  autocore: improve x86 index display
  x86: add support for iKoolCore R1 (eth1/2/3 for LAN, eth0 for WAN)
  x86: improve sysinfo handling of special values
  tools/cmake: update to 3.25.1
  build: add gzip to prereq-build.mk
  build: images: squashfs: add help, fix description
  kernel: ca8210: Fix crash by zero initializing data
  e2fsprogs: Fix CVE-2022-1304
  mediatek: mt7623: build mt6577_auxadc driver into kernel
  trusted-firmware-a.mk: fix build with binutils 2.39
  build: make sure that $(STAGING_DIR_IMAGE) exists
  • Loading branch information
github-actions[bot] committed Dec 7, 2022
2 parents c8e126c + 13d0aa7 commit e793e02
Show file tree
Hide file tree
Showing 20 changed files with 301 additions and 10 deletions.
5 changes: 4 additions & 1 deletion config/Config-images.in
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,17 @@ menu "Target Images"
bool "squashfs"
default y if USES_SQUASHFS
help
Build a squashfs-lzma root filesystem.
Build a squashfs root filesystem.

config TARGET_SQUASHFS_BLOCK_SIZE
int "Block size (in KiB)"
depends on TARGET_ROOTFS_SQUASHFS
default 64 if LOW_MEMORY_FOOTPRINT
default 1024 if (SMALL_FLASH && !LOW_MEMORY_FOOTPRINT)
default 1024
help
Select squashfs block size, must be one of:
4, 8, 16, 32, 64, 128, 256, 512, 1024

menuconfig TARGET_ROOTFS_UBIFS
bool "ubifs"
Expand Down
1 change: 1 addition & 0 deletions include/image-commands.mk
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ define Build/append-image-stage
cp "$(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(1)" "$@.stripmeta"
fwtool -s /dev/null -t "$@.stripmeta" || :
fwtool -i /dev/null -t "$@.stripmeta" || :
mkdir -p "$(STAGING_DIR_IMAGE)"
dd if="$@.stripmeta" of="$(STAGING_DIR_IMAGE)/$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET))-$(DEVICE_NAME)-$(1)"
dd if="$@.stripmeta" >> "$@"
rm "$@.stripmeta"
Expand Down
3 changes: 3 additions & 0 deletions include/prereq-build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ $(eval $(call SetupHostCommand,stat,Cannot find a file stat utility, \
gstat -c%s $(TOPDIR)/Makefile, \
stat -c%s $(TOPDIR)/Makefile))

$(eval $(call SetupHostCommand,gzip,Please install 'gzip', \
gzip --version </dev/null))

$(eval $(call SetupHostCommand,unzip,Please install 'unzip', \
unzip 2>&1 | grep zipfile, \
unzip))
Expand Down
1 change: 1 addition & 0 deletions include/trusted-firmware-a.mk
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ define Build/Compile/Trusted-Firmware-A
$(if $(DTC),DTC="$(DTC)") \
PLAT=$(PLAT) \
BUILD_STRING="OpenWrt v$(PKG_VERSION)-$(PKG_RELEASE) ($(VARIANT))" \
$(if $(CONFIG_BINUTILS_VERSION_2_39),LDFLAGS="-no-warn-rwx-segments") \
$(TFA_MAKE_FLAGS)
endef

Expand Down
2 changes: 1 addition & 1 deletion package/lean/autocore/files/x86/autocore
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ start()
d=$(echo -n ' Core ')
e=$(cat /proc/cpuinfo | grep 'processor' | wc -l)
f=$(echo -n ' Thread ')
g=$(dmesg | grep 'DMI:' | awk -F ',' '{print $1 }' | awk -F ':' '{print $2 }')
g=$(cat /tmp/sysinfo/model)
h=${g}' - '${a}${b}${c}${d}${e}${f}

mkdir -p /tmp/sysinfo
Expand Down
2 changes: 1 addition & 1 deletion package/utils/e2fsprogs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk

PKG_NAME:=e2fsprogs
PKG_VERSION:=1.46.5
PKG_RELEASE:=1
PKG_RELEASE:=2

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@KERNEL/linux/kernel/people/tytso/e2fsprogs/v$(PKG_VERSION)/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
From ab51d587bb9b229b1fade1afd02e1574c1ba5c76 Mon Sep 17 00:00:00 2001
From: Lukas Czerner <lczerner@redhat.com>
Date: Thu, 21 Apr 2022 19:31:48 +0200
Subject: libext2fs: add sanity check to extent manipulation

It is possible to have a corrupted extent tree in such a way that a leaf
node contains zero extents in it. Currently if that happens and we try
to traverse the tree we can end up accessing wrong data, or possibly
even uninitialized memory. Make sure we don't do that.

Additionally make sure that we have a sane number of bytes passed to
memmove() in ext2fs_extent_delete().

Note that e2fsck is currently unable to spot and fix such corruption in
pass1.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Reported-by: Nils Bars <nils_bars@t-online.de>
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2068113
Addresses: CVE-2022-1304
Addresses-Debian-Bug: #1010263
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
lib/ext2fs/extent.c | 8 ++++++++
1 file changed, 8 insertions(+)

--- a/lib/ext2fs/extent.c
+++ b/lib/ext2fs/extent.c
@@ -495,6 +495,10 @@ retry:
ext2fs_le16_to_cpu(eh->eh_entries);
newpath->max_entries = ext2fs_le16_to_cpu(eh->eh_max);

+ /* Make sure there is at least one extent present */
+ if (newpath->left <= 0)
+ return EXT2_ET_EXTENT_NO_DOWN;
+
if (path->left > 0) {
ix++;
newpath->end_blk = ext2fs_le32_to_cpu(ix->ei_block);
@@ -1630,6 +1634,10 @@ errcode_t ext2fs_extent_delete(ext2_exte

cp = path->curr;

+ /* Sanity check before memmove() */
+ if (path->left < 0)
+ return EXT2_ET_EXTENT_LEAF_BAD;
+
if (path->left) {
memmove(cp, cp + sizeof(struct ext3_extent_idx),
path->left * sizeof(struct ext3_extent_idx));
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
From 1e24c54da257ab93cff5826be8a793b014a5dc9c Mon Sep 17 00:00:00 2001
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Mon, 21 Nov 2022 01:22:01 +0100
Subject: ca8210: Fix crash by zero initializing data

The struct cas_control embeds multiple generic SPI structures and we
have to make sure these structures are initialized to default values.
This driver does not set all attributes. When using kmalloc before some
attributes were not initialized and contained random data which caused
random crashes at bootup.

Fixes: ded845a781a5 ("ieee802154: Add CA8210 IEEE 802.15.4 device driver")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Link: https://lore.kernel.org/r/20221121002201.1339636-1-hauke@hauke-m.de
Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
---
drivers/net/ieee802154/ca8210.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/ieee802154/ca8210.c
+++ b/drivers/net/ieee802154/ca8210.c
@@ -926,7 +926,7 @@ static int ca8210_spi_transfer(

dev_dbg(&spi->dev, "%s called\n", __func__);

- cas_ctl = kmalloc(sizeof(*cas_ctl), GFP_ATOMIC);
+ cas_ctl = kzalloc(sizeof(*cas_ctl), GFP_ATOMIC);
if (!cas_ctl)
return -ENOMEM;

Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
From 1e24c54da257ab93cff5826be8a793b014a5dc9c Mon Sep 17 00:00:00 2001
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Mon, 21 Nov 2022 01:22:01 +0100
Subject: ca8210: Fix crash by zero initializing data

The struct cas_control embeds multiple generic SPI structures and we
have to make sure these structures are initialized to default values.
This driver does not set all attributes. When using kmalloc before some
attributes were not initialized and contained random data which caused
random crashes at bootup.

Fixes: ded845a781a5 ("ieee802154: Add CA8210 IEEE 802.15.4 device driver")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Link: https://lore.kernel.org/r/20221121002201.1339636-1-hauke@hauke-m.de
Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
---
drivers/net/ieee802154/ca8210.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/ieee802154/ca8210.c
+++ b/drivers/net/ieee802154/ca8210.c
@@ -927,7 +927,7 @@ static int ca8210_spi_transfer(

dev_dbg(&spi->dev, "%s called\n", __func__);

- cas_ctl = kmalloc(sizeof(*cas_ctl), GFP_ATOMIC);
+ cas_ctl = kzalloc(sizeof(*cas_ctl), GFP_ATOMIC);
if (!cas_ctl)
return -ENOMEM;

Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
From d438c9afd73a482a0438e6cf86daa0580422598e Mon Sep 17 00:00:00 2001
From: Kathiravan T <kathirav@codeaurora.org>
Date: Tue, 31 Aug 2021 08:57:32 +0300
Subject: [PATCH 1013/1013] arm64: dts: qcom: ipq6018: add usb3 DT description

Based on downstream codeaurora code.

Tested (USB2 only) on IPQ6010 based hardware.

Signed-off-by: Kathiravan T <kathirav@codeaurora.org>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
[bjorn: Changed dwc3 node name to usb, per binding]
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/ebc2d340d566fa2d43127e253d5b8b134a87a78e.1630389452.git.baruch@tkos.co.il
---
arch/arm64/boot/dts/qcom/ipq6018.dtsi | 83 +++++++++++++++++++++++++++
1 file changed, 83 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/ipq6018.dtsi b/arch/arm64/boot/dts/qcom/ipq6018.dtsi
index d8da83aa8bda..b4c9bda0104c 100644
--- a/arch/arm64/boot/dts/qcom/ipq6018.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq6018.dtsi
@@ -715,6 +715,89 @@ dwc_1: usb@7000000 {
};
};

+ ssphy_0: ssphy@78000 {
+ compatible = "qcom,ipq6018-qmp-usb3-phy";
+ reg = <0x0 0x78000 0x0 0x1C4>;
+ #address-cells = <2>;
+ #size-cells = <2>;
+ #clock-cells = <1>;
+ ranges;
+
+ clocks = <&gcc GCC_USB0_AUX_CLK>,
+ <&gcc GCC_USB0_PHY_CFG_AHB_CLK>, <&xo>;
+ clock-names = "aux", "cfg_ahb", "ref";
+
+ resets = <&gcc GCC_USB0_PHY_BCR>,
+ <&gcc GCC_USB3PHY_0_PHY_BCR>;
+ reset-names = "phy","common";
+ status = "disabled";
+
+ usb0_ssphy: lane@78200 {
+ reg = <0x0 0x00078200 0x0 0x130>, /* Tx */
+ <0x0 0x00078400 0x0 0x200>, /* Rx */
+ <0x0 0x00078800 0x0 0x1F8>, /* PCS */
+ <0x0 0x00078600 0x0 0x044>; /* PCS misc */
+ #phy-cells = <0>;
+ clocks = <&gcc GCC_USB0_PIPE_CLK>;
+ clock-names = "pipe0";
+ clock-output-names = "gcc_usb0_pipe_clk_src";
+ };
+ };
+
+ qusb_phy_0: qusb@79000 {
+ compatible = "qcom,ipq6018-qusb2-phy";
+ reg = <0x0 0x079000 0x0 0x180>;
+ #phy-cells = <0>;
+
+ clocks = <&gcc GCC_USB0_PHY_CFG_AHB_CLK>,
+ <&xo>;
+ clock-names = "cfg_ahb", "ref";
+
+ resets = <&gcc GCC_QUSB2_0_PHY_BCR>;
+ status = "disabled";
+ };
+
+ usb3: usb3@8A00000 {
+ compatible = "qcom,ipq6018-dwc3", "qcom,dwc3";
+ reg = <0x0 0x8AF8800 0x0 0x400>;
+ #address-cells = <2>;
+ #size-cells = <2>;
+ ranges;
+
+ clocks = <&gcc GCC_SYS_NOC_USB0_AXI_CLK>,
+ <&gcc GCC_USB0_MASTER_CLK>,
+ <&gcc GCC_USB0_SLEEP_CLK>,
+ <&gcc GCC_USB0_MOCK_UTMI_CLK>;
+ clock-names = "sys_noc_axi",
+ "master",
+ "sleep",
+ "mock_utmi";
+
+ assigned-clocks = <&gcc GCC_SYS_NOC_USB0_AXI_CLK>,
+ <&gcc GCC_USB0_MASTER_CLK>,
+ <&gcc GCC_USB0_MOCK_UTMI_CLK>;
+ assigned-clock-rates = <133330000>,
+ <133330000>,
+ <20000000>;
+
+ resets = <&gcc GCC_USB0_BCR>;
+ status = "disabled";
+
+ dwc_0: usb@8A00000 {
+ compatible = "snps,dwc3";
+ reg = <0x0 0x8A00000 0x0 0xcd00>;
+ interrupts = <GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>;
+ phys = <&qusb_phy_0>, <&usb0_ssphy>;
+ phy-names = "usb2-phy", "usb3-phy";
+ tx-fifo-resize;
+ snps,is-utmi-l1-suspend;
+ snps,hird-threshold = /bits/ 8 <0x0>;
+ snps,dis_u2_susphy_quirk;
+ snps,dis_u3_susphy_quirk;
+ snps,ref-clock-period-ns = <0x32>;
+ dr_mode = "host";
+ };
+ };
};

wcss: wcss-smp2p {
--
2.37.1

2 changes: 1 addition & 1 deletion target/linux/mediatek/modules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ $(eval $(call KernelPackage,btmtkuart))

define KernelPackage/iio-mt6577-auxadc
TITLE:=Mediatek AUXADC driver
DEPENDS:=@(TARGET_mediatek_mt7622||TARGET_mediatek_mt7623||TARGET_mediatek_filogic)
DEPENDS:=@(TARGET_mediatek_mt7622||TARGET_mediatek_filogic)
KCONFIG:=CONFIG_MEDIATEK_MT6577_AUXADC
FILES:= \
$(LINUX_DIR)/drivers/iio/adc/mt6577_auxadc.ko
Expand Down
2 changes: 2 additions & 0 deletions target/linux/mediatek/mt7623/config-5.15
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ CONFIG_I2C_BOARDINFO=y
CONFIG_I2C_CHARDEV=y
CONFIG_I2C_MT65XX=y
CONFIG_ICPLUS_PHY=y
CONFIG_IIO=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_INPUT=y
CONFIG_INPUT_EVDEV=y
Expand Down Expand Up @@ -321,6 +322,7 @@ CONFIG_MDIO_DEVICE=y
CONFIG_MDIO_DEVRES=y
CONFIG_MDIO_GPIO=y
CONFIG_MEDIATEK_GE_PHY=y
CONFIG_MEDIATEK_MT6577_AUXADC=y
CONFIG_MEDIATEK_WATCHDOG=y
CONFIG_MEMFD_CREATE=y
CONFIG_MEMORY=y
Expand Down
3 changes: 3 additions & 0 deletions target/linux/x86/base-files/etc/board.d/02_network
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ roqos-roqos-core-rc10)
brounion-r86s)
ucidef_set_interfaces_lan_wan "eth1 eth2" "eth0"
;;
ikoolcore-r1)
ucidef_set_interfaces_lan_wan "eth1 eth2 eth3" "eth0"
;;
sophos-sg-105|sophos-xg-105)
ucidef_set_interfaces_lan_wan "eth0 eth2 eth3" "eth1"
;;
Expand Down
3 changes: 3 additions & 0 deletions target/linux/x86/base-files/lib/preinit/01_sysinfo
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ do_sysinfo_x86() {
vendor="$(cat /sys/devices/virtual/dmi/id/$file 2>/dev/null)"
case "$vendor" in
empty | \
Default\ string | \
System\ manufacturer | \
To\ [bB]e\ [fF]illed\ [bB]y\ O\.E\.M\.)
vendor=" "
continue
;;
esac
Expand All @@ -26,6 +28,7 @@ do_sysinfo_x86() {
product="$(cat /sys/devices/virtual/dmi/id/$file 2>/dev/null)"
case "$vendor:$product" in
?*:empty | \
?*:Default\ string | \
?*:System\ Product\ Name | \
?*:To\ [bB]e\ [fF]illed\ [bB]y\ O\.E\.M\.)
continue
Expand Down
4 changes: 2 additions & 2 deletions tools/cmake/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=cmake
PKG_VERSION:=3.24.3
PKG_VERSION:=3.25.1
PKG_VERSION_MAJOR:=$(word 1,$(subst ., ,$(PKG_VERSION))).$(word 2,$(subst ., ,$(PKG_VERSION)))
PKG_RELEASE:=1
PKG_CPE_ID:=cpe:/a:kitware:cmake

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/Kitware/CMake/releases/download/v$(PKG_VERSION)/ \
https://cmake.org/files/v$(PKG_VERSION_MAJOR)/
PKG_HASH:=b53aa10fa82bff84ccdb59065927b72d3bee49f4d86261249fc0984b3b367291
PKG_HASH:=1c511d09516af493694ed9baf13c55947a36389674d657a2d5e0ccedc6b291d8

HOST_BUILD_PARALLEL:=1
HOST_CONFIGURE_PARALLEL:=1
Expand Down
2 changes: 1 addition & 1 deletion tools/cmake/patches/120-curl-fix-libressl-linking.patch
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Signed-off-by: Jo-Philipp Wich <jo@mein.io>
---
--- a/Utilities/cmcurl/CMakeLists.txt
+++ b/Utilities/cmcurl/CMakeLists.txt
@@ -594,6 +594,14 @@ if(CURL_USE_OPENSSL)
@@ -611,6 +611,14 @@ if(CURL_USE_OPENSSL)
endif()
set(SSL_ENABLED ON)
set(USE_OPENSSL ON)
Expand Down
2 changes: 1 addition & 1 deletion tools/cmake/patches/130-bootstrap_parallel_make_flag.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/bootstrap
+++ b/bootstrap
@@ -1441,7 +1441,10 @@ int main(){ printf("1%c", (char)0x0a); r
@@ -1449,7 +1449,10 @@ int main(){ printf("1%c", (char)0x0a); r
' > "test.c"
cmake_original_make_flags="${cmake_make_flags}"
if test "x${cmake_parallel_make}" != "x"; then
Expand Down
2 changes: 1 addition & 1 deletion tools/cmake/patches/150-zstd-libarchive.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/Utilities/cmlibarchive/CMakeLists.txt
+++ b/Utilities/cmlibarchive/CMakeLists.txt
@@ -630,8 +630,13 @@ IF(ENABLE_ZSTD)
@@ -632,8 +632,13 @@ IF(ENABLE_ZSTD)
SET(ZSTD_FIND_QUIETLY TRUE)
ENDIF (ZSTD_INCLUDE_DIR)

Expand Down
2 changes: 1 addition & 1 deletion tools/e2fsprogs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ PKG_NAME:=e2fsprogs
PKG_CPE_ID:=cpe:/a:e2fsprogs_project:e2fsprogs
PKG_VERSION:=1.46.5
PKG_HASH:=2f16c9176704cf645dc69d5b15ff704ae722d665df38b2ed3cfc249757d8d81e
PKG_RELEASE:=1
PKG_RELEASE:=2

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@KERNEL/linux/kernel/people/tytso/e2fsprogs/v$(PKG_VERSION)/
Expand Down
Loading

0 comments on commit e793e02

Please sign in to comment.