diff options
64 files changed, 287 insertions, 95 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index eb48eea55c5..e41ff7700df 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1063,7 +1063,7 @@ F: tools/file2include.c F: tools/mkeficapsule.c ENVIRONMENT -S: Orphaned +S: Orphan F: env/ F: include/env/ F: include/env* @@ -1442,7 +1442,7 @@ F: drivers/net/phy/nxp-c45-tja11xx.c ONENAND #M: Lukasz Majewski <[email protected]> -S: Orphaned (Since 2017-01) +S: Orphan (Since 2017-01) T: git https://git.u-boot-project.org/u-boot/custodians/u-boot-onenand.git F: drivers/mtd/onenand/ @@ -1480,7 +1480,7 @@ F: drivers/pci/pcie_dw_imx.c F: drivers/phy/phy-imx8m-pcie.c PCI Endpoint -S: Orphaned +S: Orphan F: drivers/pci_endpoint/ F: include/pci_ep.h @@ -1651,7 +1651,7 @@ F: test/cmd/seama.c SEMIHOSTING R: Sean Anderson <[email protected]> -S: Orphaned +S: Orphan N: semihosting SETEXPR @@ -1703,7 +1703,7 @@ S: Maintained F: drivers/rng/smccc_trng.c SPI -S: Orphaned +S: Orphan T: git https://git.u-boot-project.org/u-boot/custodians/u-boot-spi.git F: drivers/spi/ F: include/spi* diff --git a/arch/m68k/cpu/mcf530x/Makefile b/arch/m68k/cpu/mcf530x/Makefile index 6bd7cd3591d..d0956d9d1ba 100644 --- a/arch/m68k/cpu/mcf530x/Makefile +++ b/arch/m68k/cpu/mcf530x/Makefile @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0+ # -# (C) Copyright 2014 Angelo Dureghello <[email protected]> +# (C) Copyright 2014 Angelo Dureghello <[email protected]> extra-y = start.o obj-y = interrupts.o cpu.o speed.o cpu_init.o diff --git a/arch/m68k/cpu/mcf530x/cpu.c b/arch/m68k/cpu/mcf530x/cpu.c index 92a0ef76895..bff2b485958 100644 --- a/arch/m68k/cpu/mcf530x/cpu.c +++ b/arch/m68k/cpu/mcf530x/cpu.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * (C) Copyright 2014 Angelo Dureghello <[email protected]> + * (C) Copyright 2014 Angelo Dureghello <[email protected]> * */ diff --git a/arch/m68k/cpu/mcf530x/cpu_init.c b/arch/m68k/cpu/mcf530x/cpu_init.c index 8f6e668d103..f06e47f564a 100644 --- a/arch/m68k/cpu/mcf530x/cpu_init.c +++ b/arch/m68k/cpu/mcf530x/cpu_init.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * (C) Copyright 2014 Angelo Dureghello <[email protected]> + * (C) Copyright 2014 Angelo Dureghello <[email protected]> * */ diff --git a/arch/m68k/cpu/mcf530x/interrupts.c b/arch/m68k/cpu/mcf530x/interrupts.c index 99cf8638503..005fce35c93 100644 --- a/arch/m68k/cpu/mcf530x/interrupts.c +++ b/arch/m68k/cpu/mcf530x/interrupts.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * (C) Copyright 2014 Angelo Dureghello <[email protected]> + * (C) Copyright 2014 Angelo Dureghello <[email protected]> * */ diff --git a/arch/m68k/cpu/mcf530x/speed.c b/arch/m68k/cpu/mcf530x/speed.c index 6542fc43ab1..4e9f4a09274 100644 --- a/arch/m68k/cpu/mcf530x/speed.c +++ b/arch/m68k/cpu/mcf530x/speed.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * (C) Copyright 2014 Angelo Dureghello <[email protected]> + * (C) Copyright 2014 Angelo Dureghello <[email protected]> * */ diff --git a/arch/m68k/cpu/mcf530x/start.S b/arch/m68k/cpu/mcf530x/start.S index 552e0204b77..76f7065758b 100644 --- a/arch/m68k/cpu/mcf530x/start.S +++ b/arch/m68k/cpu/mcf530x/start.S @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0+ */ /* - * (C) Copyright 2015 Angelo Dureghello <[email protected]> + * (C) Copyright 2015 Angelo Dureghello <[email protected]> * Based on code from Bernhard Kuhn <[email protected]> */ diff --git a/arch/m68k/cpu/mcf5445x/dspi.c b/arch/m68k/cpu/mcf5445x/dspi.c index 13eb6ecee10..b0f844de5b2 100644 --- a/arch/m68k/cpu/mcf5445x/dspi.c +++ b/arch/m68k/cpu/mcf5445x/dspi.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0+ /* * (C) Copyright 2019 - * Angelo Dureghello <[email protected]> + * Angelo Dureghello <[email protected]> * * CPU specific dspi routines */ diff --git a/arch/m68k/cpu/u-boot.lds b/arch/m68k/cpu/u-boot.lds index 452003ff43c..770c9e990d6 100644 --- a/arch/m68k/cpu/u-boot.lds +++ b/arch/m68k/cpu/u-boot.lds @@ -3,7 +3,7 @@ * (C) Copyright 2000 * Wolfgang Denk, DENX Software Engineering, [email protected]. * (C) Copyright 2015 - * Angelo Dureghello, Sysam Firmware, [email protected] + * Angelo Dureghello, Sysam Firmware, [email protected] */ #include <config.h> diff --git a/arch/m68k/dts/M5208EVBE.dts b/arch/m68k/dts/M5208EVBE.dts index ec203e8b698..cf5bc718cee 100644 --- a/arch/m68k/dts/M5208EVBE.dts +++ b/arch/m68k/dts/M5208EVBE.dts @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright (C) 2018 Angelo Dureghello <[email protected]> + * Copyright (C) 2018 Angelo Dureghello <[email protected]> */ /dts-v1/; diff --git a/arch/m68k/dts/M5235EVB.dts b/arch/m68k/dts/M5235EVB.dts index e8b22c92166..084197bc3fe 100644 --- a/arch/m68k/dts/M5235EVB.dts +++ b/arch/m68k/dts/M5235EVB.dts @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright (C) 2018 Angelo Dureghello <[email protected]> + * Copyright (C) 2018 Angelo Dureghello <[email protected]> */ /dts-v1/; diff --git a/arch/m68k/dts/M5235EVB_Flash32.dts b/arch/m68k/dts/M5235EVB_Flash32.dts index 60b28c07f76..fa463e87ed1 100644 --- a/arch/m68k/dts/M5235EVB_Flash32.dts +++ b/arch/m68k/dts/M5235EVB_Flash32.dts @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright (C) 2018 Angelo Dureghello <[email protected]> + * Copyright (C) 2018 Angelo Dureghello <[email protected]> */ /dts-v1/; diff --git a/arch/m68k/dts/M5249EVB.dts b/arch/m68k/dts/M5249EVB.dts index 84ba4f188b4..32f4431d5fd 100644 --- a/arch/m68k/dts/M5249EVB.dts +++ b/arch/m68k/dts/M5249EVB.dts @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright (C) 2018 Angelo Dureghello <[email protected]> + * Copyright (C) 2018 Angelo Dureghello <[email protected]> */ /dts-v1/; diff --git a/arch/m68k/dts/M5253DEMO.dts b/arch/m68k/dts/M5253DEMO.dts index a3f070661ea..25faf1ba73c 100644 --- a/arch/m68k/dts/M5253DEMO.dts +++ b/arch/m68k/dts/M5253DEMO.dts @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright (C) 2018 Angelo Dureghello <[email protected]> + * Copyright (C) 2018 Angelo Dureghello <[email protected]> */ /dts-v1/; diff --git a/arch/m68k/dts/M5272C3.dts b/arch/m68k/dts/M5272C3.dts index a2289379072..1e77b882a94 100644 --- a/arch/m68k/dts/M5272C3.dts +++ b/arch/m68k/dts/M5272C3.dts @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright (C) 2018 Angelo Dureghello <[email protected]> + * Copyright (C) 2018 Angelo Dureghello <[email protected]> */ /dts-v1/; diff --git a/arch/m68k/dts/M5275EVB.dts b/arch/m68k/dts/M5275EVB.dts index d79f8a78857..2e6a6e45d03 100644 --- a/arch/m68k/dts/M5275EVB.dts +++ b/arch/m68k/dts/M5275EVB.dts @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright (C) 2018 Angelo Dureghello <[email protected]> + * Copyright (C) 2018 Angelo Dureghello <[email protected]> */ /dts-v1/; diff --git a/arch/m68k/dts/M5282EVB.dts b/arch/m68k/dts/M5282EVB.dts index 51788f9654a..f75a9c30aed 100644 --- a/arch/m68k/dts/M5282EVB.dts +++ b/arch/m68k/dts/M5282EVB.dts @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright (C) 2018 Angelo Dureghello <[email protected]> + * Copyright (C) 2018 Angelo Dureghello <[email protected]> */ /dts-v1/; diff --git a/arch/m68k/dts/M53017EVB.dts b/arch/m68k/dts/M53017EVB.dts index 90851dd0af4..d1b2534d4b0 100644 --- a/arch/m68k/dts/M53017EVB.dts +++ b/arch/m68k/dts/M53017EVB.dts @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright (C) 2018 Angelo Dureghello <[email protected]> + * Copyright (C) 2018 Angelo Dureghello <[email protected]> */ /dts-v1/; diff --git a/arch/m68k/dts/M5329AFEE.dts b/arch/m68k/dts/M5329AFEE.dts index c1cd2845a38..a661b091354 100644 --- a/arch/m68k/dts/M5329AFEE.dts +++ b/arch/m68k/dts/M5329AFEE.dts @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright (C) 2018 Angelo Dureghello <[email protected]> + * Copyright (C) 2018 Angelo Dureghello <[email protected]> */ /dts-v1/; diff --git a/arch/m68k/dts/M5329BFEE.dts b/arch/m68k/dts/M5329BFEE.dts index 51ec4b5d1aa..1fe0f6e5515 100644 --- a/arch/m68k/dts/M5329BFEE.dts +++ b/arch/m68k/dts/M5329BFEE.dts @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright (C) 2018 Angelo Dureghello <[email protected]> + * Copyright (C) 2018 Angelo Dureghello <[email protected]> */ /dts-v1/; diff --git a/arch/m68k/dts/M5373EVB.dts b/arch/m68k/dts/M5373EVB.dts index 27ce800caeb..1ab63eae703 100644 --- a/arch/m68k/dts/M5373EVB.dts +++ b/arch/m68k/dts/M5373EVB.dts @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright (C) 2018 Angelo Dureghello <[email protected]> + * Copyright (C) 2018 Angelo Dureghello <[email protected]> */ /dts-v1/; diff --git a/arch/m68k/dts/amcore.dts b/arch/m68k/dts/amcore.dts index d43202a3ab4..e9b01c9bb39 100644 --- a/arch/m68k/dts/amcore.dts +++ b/arch/m68k/dts/amcore.dts @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright (C) 2018 Angelo Dureghello <[email protected]> + * Copyright (C) 2018 Angelo Dureghello <[email protected]> */ /dts-v1/; diff --git a/arch/m68k/dts/cobra5272.dts b/arch/m68k/dts/cobra5272.dts index 2b5767d96d1..9166d5726b9 100644 --- a/arch/m68k/dts/cobra5272.dts +++ b/arch/m68k/dts/cobra5272.dts @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright (C) 2018 Angelo Dureghello <[email protected]> + * Copyright (C) 2018 Angelo Dureghello <[email protected]> */ /dts-v1/; diff --git a/arch/m68k/dts/eb_cpu5282.dts b/arch/m68k/dts/eb_cpu5282.dts index 27f33b9f900..6317e00c84e 100644 --- a/arch/m68k/dts/eb_cpu5282.dts +++ b/arch/m68k/dts/eb_cpu5282.dts @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright (C) 2018 Angelo Dureghello <[email protected]> + * Copyright (C) 2018 Angelo Dureghello <[email protected]> */ /dts-v1/; diff --git a/arch/m68k/dts/eb_cpu5282_internal.dts b/arch/m68k/dts/eb_cpu5282_internal.dts index 53a94ea7f75..39fe86da496 100644 --- a/arch/m68k/dts/eb_cpu5282_internal.dts +++ b/arch/m68k/dts/eb_cpu5282_internal.dts @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright (C) 2018 Angelo Dureghello <[email protected]> + * Copyright (C) 2018 Angelo Dureghello <[email protected]> */ /dts-v1/; diff --git a/arch/m68k/dts/mcf5208.dtsi b/arch/m68k/dts/mcf5208.dtsi index c61dbf35570..df7f4b377cd 100644 --- a/arch/m68k/dts/mcf5208.dtsi +++ b/arch/m68k/dts/mcf5208.dtsi @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright (C) 2018 Angelo Dureghello <[email protected]> + * Copyright (C) 2018 Angelo Dureghello <[email protected]> */ / { diff --git a/arch/m68k/dts/mcf523x.dtsi b/arch/m68k/dts/mcf523x.dtsi index cae7b4f8616..5f1708fb0a3 100644 --- a/arch/m68k/dts/mcf523x.dtsi +++ b/arch/m68k/dts/mcf523x.dtsi @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright (C) 2018 Angelo Dureghello <[email protected]> + * Copyright (C) 2018 Angelo Dureghello <[email protected]> */ / { diff --git a/arch/m68k/dts/mcf5249.dtsi b/arch/m68k/dts/mcf5249.dtsi index d45d5532caf..6174f2babe0 100644 --- a/arch/m68k/dts/mcf5249.dtsi +++ b/arch/m68k/dts/mcf5249.dtsi @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright (C) 2018 Angelo Dureghello <[email protected]> + * Copyright (C) 2018 Angelo Dureghello <[email protected]> */ / { diff --git a/arch/m68k/dts/mcf5253.dtsi b/arch/m68k/dts/mcf5253.dtsi index b9816f4754b..45e463059d9 100644 --- a/arch/m68k/dts/mcf5253.dtsi +++ b/arch/m68k/dts/mcf5253.dtsi @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright (C) 2018 Angelo Dureghello <[email protected]> + * Copyright (C) 2018 Angelo Dureghello <[email protected]> */ / { diff --git a/arch/m68k/dts/mcf5271.dtsi b/arch/m68k/dts/mcf5271.dtsi index 5acf6994af3..4ab23e9921d 100644 --- a/arch/m68k/dts/mcf5271.dtsi +++ b/arch/m68k/dts/mcf5271.dtsi @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright (C) 2018 Angelo Dureghello <[email protected]> + * Copyright (C) 2018 Angelo Dureghello <[email protected]> */ / { diff --git a/arch/m68k/dts/mcf5272.dtsi b/arch/m68k/dts/mcf5272.dtsi index 173baaba3f2..1243ba9c482 100644 --- a/arch/m68k/dts/mcf5272.dtsi +++ b/arch/m68k/dts/mcf5272.dtsi @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright (C) 2018 Angelo Dureghello <[email protected]> + * Copyright (C) 2018 Angelo Dureghello <[email protected]> */ / { diff --git a/arch/m68k/dts/mcf5275.dtsi b/arch/m68k/dts/mcf5275.dtsi index 3df17b445c4..f3043992446 100644 --- a/arch/m68k/dts/mcf5275.dtsi +++ b/arch/m68k/dts/mcf5275.dtsi @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright (C) 2019 Angelo Dureghello <[email protected]> + * Copyright (C) 2019 Angelo Dureghello <[email protected]> */ / { diff --git a/arch/m68k/dts/mcf5282.dtsi b/arch/m68k/dts/mcf5282.dtsi index 640c1a32e41..8f27756e183 100644 --- a/arch/m68k/dts/mcf5282.dtsi +++ b/arch/m68k/dts/mcf5282.dtsi @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright (C) 2018 Angelo Dureghello <[email protected]> + * Copyright (C) 2018 Angelo Dureghello <[email protected]> */ / { diff --git a/arch/m68k/dts/mcf5301x.dtsi b/arch/m68k/dts/mcf5301x.dtsi index a13afad093a..d9a89cbde5a 100644 --- a/arch/m68k/dts/mcf5301x.dtsi +++ b/arch/m68k/dts/mcf5301x.dtsi @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright (C) 2018 Angelo Dureghello <[email protected]> + * Copyright (C) 2018 Angelo Dureghello <[email protected]> */ / { diff --git a/arch/m68k/dts/mcf5307.dtsi b/arch/m68k/dts/mcf5307.dtsi index d6d386b22e1..a622afc916a 100644 --- a/arch/m68k/dts/mcf5307.dtsi +++ b/arch/m68k/dts/mcf5307.dtsi @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright (C) 2018 Angelo Dureghello <[email protected]> + * Copyright (C) 2018 Angelo Dureghello <[email protected]> */ / { diff --git a/arch/m68k/dts/mcf5329.dtsi b/arch/m68k/dts/mcf5329.dtsi index 991985e48cf..58d6aaadf4e 100644 --- a/arch/m68k/dts/mcf5329.dtsi +++ b/arch/m68k/dts/mcf5329.dtsi @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright (C) 2018 Angelo Dureghello <[email protected]> + * Copyright (C) 2018 Angelo Dureghello <[email protected]> */ / { diff --git a/arch/m68k/dts/mcf537x.dtsi b/arch/m68k/dts/mcf537x.dtsi index 4fa0f4bc3da..82d88944f3f 100644 --- a/arch/m68k/dts/mcf537x.dtsi +++ b/arch/m68k/dts/mcf537x.dtsi @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright (C) 2018 Angelo Dureghello <[email protected]> + * Copyright (C) 2018 Angelo Dureghello <[email protected]> */ / { diff --git a/arch/m68k/dts/mcf5441x.dtsi b/arch/m68k/dts/mcf5441x.dtsi index 7cd6072d4a5..5c30d9f52cc 100644 --- a/arch/m68k/dts/mcf5441x.dtsi +++ b/arch/m68k/dts/mcf5441x.dtsi @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright (C) 2018 Angelo Dureghello <[email protected]> + * Copyright (C) 2018 Angelo Dureghello <[email protected]> */ / { diff --git a/arch/m68k/dts/mcf54xx.dtsi b/arch/m68k/dts/mcf54xx.dtsi index e9cebb9f742..c3ade7cc87c 100644 --- a/arch/m68k/dts/mcf54xx.dtsi +++ b/arch/m68k/dts/mcf54xx.dtsi @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright (C) 2018 Angelo Dureghello <[email protected]> + * Copyright (C) 2018 Angelo Dureghello <[email protected]> */ / { diff --git a/arch/m68k/dts/stmark2.dts b/arch/m68k/dts/stmark2.dts index 8e196fa65ff..9e1ae8214dd 100644 --- a/arch/m68k/dts/stmark2.dts +++ b/arch/m68k/dts/stmark2.dts @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Copyright (C) 2018 Angelo Dureghello <[email protected]> + * Copyright (C) 2018 Angelo Dureghello <[email protected]> */ /dts-v1/; diff --git a/arch/m68k/include/asm/immap_5307.h b/arch/m68k/include/asm/immap_5307.h index d96dd146efb..e41a1a9b08e 100644 --- a/arch/m68k/include/asm/immap_5307.h +++ b/arch/m68k/include/asm/immap_5307.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0+ */ /* - * (C) Copyright 2014 Angelo Dureghello <[email protected]> + * (C) Copyright 2014 Angelo Dureghello <[email protected]> * */ diff --git a/arch/m68k/include/asm/m5307.h b/arch/m68k/include/asm/m5307.h index 67547d2dd9d..223e8e5f27e 100644 --- a/arch/m68k/include/asm/m5307.h +++ b/arch/m68k/include/asm/m5307.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0+ */ /* - * (C) Copyright 2014 Angelo Dureghello <[email protected]> + * (C) Copyright 2014 Angelo Dureghello <[email protected]> * */ diff --git a/board/sysam/amcore/MAINTAINERS b/board/sysam/amcore/MAINTAINERS index fe5dd9bf39c..01086ef11bb 100644 --- a/board/sysam/amcore/MAINTAINERS +++ b/board/sysam/amcore/MAINTAINERS @@ -1,5 +1,5 @@ AMCORE BOARD -M: Angelo Dureghello <[email protected]> +M: Angelo Dureghello <[email protected]> S: Maintained F: board/sysam/amcore/ F: include/configs/amcore.h diff --git a/board/sysam/amcore/Makefile b/board/sysam/amcore/Makefile index 051186f0d5c..22a71f91170 100644 --- a/board/sysam/amcore/Makefile +++ b/board/sysam/amcore/Makefile @@ -1,5 +1,5 @@ # -# (C) Copyright 2014 Angelo Dureghello <[email protected]> +# (C) Copyright 2014 Angelo Dureghello <[email protected]> # # SPDX-License-Identifier: GPL-2.0+ # diff --git a/board/sysam/amcore/amcore.c b/board/sysam/amcore/amcore.c index d5aa1f0776f..0ab9d97e865 100644 --- a/board/sysam/amcore/amcore.c +++ b/board/sysam/amcore/amcore.c @@ -2,7 +2,7 @@ /* * Board functions for Sysam AMCORE (MCF5307 based) board * - * (C) Copyright 2016 Angelo Dureghello <[email protected]> + * (C) Copyright 2016 Angelo Dureghello <[email protected]> * * This file copies memory testdram() from sandburst/common/sb_common.c */ diff --git a/board/sysam/stmark2/MAINTAINERS b/board/sysam/stmark2/MAINTAINERS index b87f432bb3f..f7b6e6d216f 100644 --- a/board/sysam/stmark2/MAINTAINERS +++ b/board/sysam/stmark2/MAINTAINERS @@ -1,5 +1,5 @@ STMARK2 BOARD -M: Angelo Dureghello <[email protected]> +M: Angelo Dureghello <[email protected]> S: Maintained F: board/sysam/stmark2/ F: include/configs/stmark2.h diff --git a/board/sysam/stmark2/Makefile b/board/sysam/stmark2/Makefile index 064a57ea05e..3c007567754 100644 --- a/board/sysam/stmark2/Makefile +++ b/board/sysam/stmark2/Makefile @@ -1,5 +1,5 @@ # -# (C) Copyright 2014 Angelo Dureghello <[email protected]> +# (C) Copyright 2014 Angelo Dureghello <[email protected]> # # SPDX-License-Identifier: GPL-2.0+ # diff --git a/board/sysam/stmark2/sbf_dram_init.S b/board/sysam/stmark2/sbf_dram_init.S index b6f38731f11..bc1a6cd20d4 100644 --- a/board/sysam/stmark2/sbf_dram_init.S +++ b/board/sysam/stmark2/sbf_dram_init.S @@ -2,7 +2,7 @@ /* * Board-specific early ddr/sdram init. * - * (C) Copyright 2017 Angelo Dureghello <[email protected]> + * (C) Copyright 2017 Angelo Dureghello <[email protected]> */ .equ PPMCR0, 0xfc04002d diff --git a/board/sysam/stmark2/stmark2.c b/board/sysam/stmark2/stmark2.c index 7818f2671d5..f0bf67c4fc4 100644 --- a/board/sysam/stmark2/stmark2.c +++ b/board/sysam/stmark2/stmark2.c @@ -2,7 +2,7 @@ /* * Board-specific init. * - * (C) Copyright 2017 Angelo Dureghello <[email protected]> + * (C) Copyright 2017 Angelo Dureghello <[email protected]> */ #include <config.h> diff --git a/doc/git-mailrc b/doc/git-mailrc index f0ba30a5c74..5a78376aa77 100644 --- a/doc/git-mailrc +++ b/doc/git-mailrc @@ -17,7 +17,7 @@ alias ag Anatolij Gustschin <[email protected]> alias agraf Alexander Graf <[email protected]> alias alexnemirovsky Alex Nemirovsky <[email protected]> alias alisonwang Alison Wang <[email protected]> -alias angelo_ts Angelo Dureghello <[email protected]> +alias angelo_ts Angelo Dureghello <[email protected]> alias apritzel Andre Przywara <[email protected]> alias bmeng Bin Meng <[email protected]> alias danielschwierzeck Daniel Schwierzeck <[email protected]> diff --git a/drivers/Makefile b/drivers/Makefile index 4c7ba741acb..269c3db12e8 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -32,6 +32,7 @@ obj-$(CONFIG_$(PHASE_)PHY) += phy/ obj-$(CONFIG_$(PHASE_)PINCTRL) += pinctrl/ obj-$(CONFIG_$(PHASE_)POWER) += power/ obj-$(CONFIG_$(PHASE_)RAM) += ram/ +obj-$(CONFIG_$(PHASE_)DM_RNG) += rng/ obj-$(CONFIG_$(PHASE_)RTC) += rtc/ obj-$(CONFIG_$(PHASE_)SERIAL) += serial/ obj-$(CONFIG_$(PHASE_)SPI) += spi/ @@ -132,7 +133,6 @@ obj-$(CONFIG_W1_EEPROM) += w1-eeprom/ obj-$(CONFIG_MACH_PIC32) += ddr/microchip/ obj-$(CONFIG_FUZZ) += fuzz/ obj-$(CONFIG_DM_HWSPINLOCK) += hwspinlock/ -obj-$(CONFIG_$(PHASE_)DM_RNG) += rng/ endif obj-y += soc/ diff --git a/drivers/serial/serial_mcf.c b/drivers/serial/serial_mcf.c index 76143575fa9..9a70b7d3d86 100644 --- a/drivers/serial/serial_mcf.c +++ b/drivers/serial/serial_mcf.c @@ -4,10 +4,10 @@ * TsiChung Liew, [email protected]. * * Modified to add device model (DM) support - * (C) Copyright 2015 Angelo Dureghello <[email protected]> + * (C) Copyright 2015 Angelo Dureghello <[email protected]> * * Modified to add DM and fdt support, removed non DM code - * (C) Copyright 2018 Angelo Dureghello <[email protected]> + * (C) Copyright 2018 Angelo Dureghello <[email protected]> */ /* diff --git a/drivers/spi/cf_spi.c b/drivers/spi/cf_spi.c index 84077c01d83..51f7f420202 100644 --- a/drivers/spi/cf_spi.c +++ b/drivers/spi/cf_spi.c @@ -8,7 +8,7 @@ * TsiChung Liew ([email protected]) * * Support for DM and DT, non-DM code removed. - * Copyright (C) 2018 Angelo Dureghello <[email protected]> + * Copyright (C) 2018 Angelo Dureghello <[email protected]> * * TODO: fsl_dspi.c should work as a driver for the DSPI module. */ diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c index cd88923521e..0ea6dcaba1a 100644 --- a/fs/squashfs/sqfs.c +++ b/fs/squashfs/sqfs.c @@ -532,7 +532,8 @@ static int sqfs_search_dir(struct squashfs_dir_stream *dirs, char **token_list, dirsp = (struct fs_dir_stream *)dirs; /* Start by root inode */ - table = sqfs_find_inode(dirs->inode_table, le32_to_cpu(sblk->inodes), + table = sqfs_find_inode(dirs->inode_table, dirs->inode_table_size, + le32_to_cpu(sblk->inodes), sblk->inodes, sblk->block_size); if (!table) return -EINVAL; @@ -591,7 +592,8 @@ static int sqfs_search_dir(struct squashfs_dir_stream *dirs, char **token_list, dirs->dir_header->inode_number; /* Get reference to inode in the inode table */ - table = sqfs_find_inode(dirs->inode_table, new_inode_number, + table = sqfs_find_inode(dirs->inode_table, + dirs->inode_table_size, new_inode_number, sblk->inodes, sblk->block_size); if (!table) { ret = -EINVAL; @@ -777,7 +779,7 @@ static int sqfs_get_metablk_pos(u32 *pos_list, void *table, u32 offset, return ret; } -static int sqfs_read_inode_table(unsigned char **inode_table) +static int sqfs_read_inode_table(unsigned char **inode_table, size_t *out_size) { struct squashfs_super_block *sblk = ctxt.sblk; u64 start, n_blks, table_offset, table_size; @@ -831,6 +833,8 @@ static int sqfs_read_inode_table(unsigned char **inode_table) goto free_itb; } + *out_size = (size_t)metablks_count * SQFS_METADATA_BLOCK_SIZE; + src_table = itb + table_offset + SQFS_HEADER_SIZE; /* Extract compressed Inode table */ @@ -910,13 +914,24 @@ static int sqfs_read_directory_table(unsigned char **dir_table, u32 **pos_list) if (metablks_count < 1) goto out; - *dir_table = malloc(metablks_count * SQFS_METADATA_BLOCK_SIZE); + if (__builtin_mul_overflow(metablks_count, SQFS_METADATA_BLOCK_SIZE, + &buf_size)) { + metablks_count = -1; + goto out; + } + + *dir_table = malloc(buf_size); if (!*dir_table) { metablks_count = -1; goto out; } - *pos_list = malloc(metablks_count * sizeof(u32)); + if (__builtin_mul_overflow(metablks_count, sizeof(u32), &buf_size)) { + metablks_count = -1; + goto out; + } + + *pos_list = malloc(buf_size); if (!*pos_list) { metablks_count = -1; goto out; @@ -982,6 +997,7 @@ static int sqfs_opendir_nest(const char *filename, struct fs_dir_stream **dirsp) int j, token_count = 0, ret = 0, metablks_count; struct squashfs_dir_stream *dirs; char **token_list = NULL, *path = NULL; + size_t inode_table_size = 0; u32 *pos_list = NULL; dirs = calloc(1, sizeof(*dirs)); @@ -995,7 +1011,7 @@ static int sqfs_opendir_nest(const char *filename, struct fs_dir_stream **dirsp) dirs->inode_table = NULL; dirs->dir_table = NULL; - ret = sqfs_read_inode_table(&inode_table); + ret = sqfs_read_inode_table(&inode_table, &inode_table_size); if (ret) { ret = -EINVAL; goto out; @@ -1035,6 +1051,7 @@ static int sqfs_opendir_nest(const char *filename, struct fs_dir_stream **dirsp) * a general solution for the malloc size, since 'i' is a union. */ dirs->inode_table = inode_table; + dirs->inode_table_size = inode_table_size; dirs->dir_table = dir_table; ret = sqfs_search_dir(dirs, token_list, token_count, pos_list, metablks_count); @@ -1133,8 +1150,8 @@ static int sqfs_readdir_nest(struct fs_dir_stream *fs_dirs, struct fs_dirent **d } i_number = dirs->dir_header->inode_number + dirs->entry->inode_offset; - ipos = sqfs_find_inode(dirs->inode_table, i_number, sblk->inodes, - sblk->block_size); + ipos = sqfs_find_inode(dirs->inode_table, dirs->inode_table_size, + i_number, sblk->inodes, sblk->block_size); if (!ipos) return -SQFS_STOP_READDIR; @@ -1492,8 +1509,8 @@ static int sqfs_read_nest(const char *filename, void *buf, loff_t offset, } i_number = dirs->dir_header->inode_number + dirs->entry->inode_offset; - ipos = sqfs_find_inode(dirs->inode_table, i_number, sblk->inodes, - sblk->block_size); + ipos = sqfs_find_inode(dirs->inode_table, dirs->inode_table_size, + i_number, sblk->inodes, sblk->block_size); if (!ipos) { ret = -EINVAL; goto out; @@ -1695,6 +1712,19 @@ static int sqfs_read_nest(const char *filename, void *buf, loff_t offset, goto out; } + /* + * finfo.offset and finfo.size come from the on-disk inode and + * must not let the copy read past the decompressed fragment + * block (dest_len bytes). + */ + if (finfo.size < (size_t)*actread || + finfo.offset > dest_len || + finfo.size - *actread > dest_len - finfo.offset) { + free(fragment_block); + ret = -EINVAL; + goto out; + } + memcpy(buf + *actread, &fragment_block[finfo.offset], finfo.size - *actread); *actread = finfo.size; @@ -1703,6 +1733,17 @@ static int sqfs_read_nest(const char *filename, void *buf, loff_t offset, } else if (finfo.frag && !finfo.comp) { fragment_block = (void *)fragment + table_offset; + /* + * Same check for the uncompressed fragment: the readable data + * is table_size bytes starting at table_offset within fragment. + */ + if (finfo.size < (size_t)*actread || + finfo.offset > table_size || + finfo.size - *actread > table_size - finfo.offset) { + ret = -EINVAL; + goto out; + } + memcpy(buf + *actread, &fragment_block[finfo.offset], finfo.size - *actread); *actread = finfo.size; } @@ -1770,8 +1811,8 @@ static int sqfs_size_nest(const char *filename, loff_t *size) } i_number = dirs->dir_header->inode_number + dirs->entry->inode_offset; - ipos = sqfs_find_inode(dirs->inode_table, i_number, sblk->inodes, - sblk->block_size); + ipos = sqfs_find_inode(dirs->inode_table, dirs->inode_table_size, + i_number, sblk->inodes, sblk->block_size); if (!ipos) { *size = 0; diff --git a/fs/squashfs/sqfs_filesystem.h b/fs/squashfs/sqfs_filesystem.h index be56498a5e3..6c97b2c3a9c 100644 --- a/fs/squashfs/sqfs_filesystem.h +++ b/fs/squashfs/sqfs_filesystem.h @@ -275,6 +275,8 @@ struct squashfs_dir_stream { * sqfs_opendir() and freed in sqfs_closedir(). */ unsigned char *inode_table; + /* Size in bytes of the decompressed inode_table buffer */ + size_t inode_table_size; unsigned char *dir_table; }; @@ -293,8 +295,8 @@ struct squashfs_file_info { bool comp; }; -void *sqfs_find_inode(void *inode_table, int inode_number, __le32 inode_count, - __le32 block_size); +void *sqfs_find_inode(void *inode_table, size_t table_size, int inode_number, + __le32 inode_count, __le32 block_size); int sqfs_dir_offset(void *dir_i, u32 *m_list, int m_count); diff --git a/fs/squashfs/sqfs_inode.c b/fs/squashfs/sqfs_inode.c index ce9a8ff8e2a..20085f8912b 100644 --- a/fs/squashfs/sqfs_inode.c +++ b/fs/squashfs/sqfs_inode.c @@ -17,65 +17,122 @@ #include "sqfs_filesystem.h" #include "sqfs_utils.h" -int sqfs_inode_size(struct squashfs_base_inode *inode, u32 blk_size) +int sqfs_inode_size(struct squashfs_base_inode *inode, u32 blk_size, size_t max) { - u16 inode_type = get_unaligned_le16(&inode->inode_type); + u16 inode_type; + + /* The smallest possible inode must fit in the remaining bytes */ + if (max < sizeof(struct squashfs_base_inode)) + return -EINVAL; + + inode_type = get_unaligned_le16(&inode->inode_type); switch (inode_type) { case SQFS_DIR_TYPE: + if (max < sizeof(struct squashfs_dir_inode)) + return -EINVAL; return sizeof(struct squashfs_dir_inode); case SQFS_REG_TYPE: { struct squashfs_reg_inode *reg = (struct squashfs_reg_inode *)inode; - u32 fragment = get_unaligned_le32(®->fragment); - u32 file_size = get_unaligned_le32(®->file_size); + u32 fragment, file_size; unsigned int blk_list_size; + int size; + + if (max < sizeof(*reg)) + return -EINVAL; + + fragment = get_unaligned_le32(®->fragment); + file_size = get_unaligned_le32(®->file_size); + + if (!blk_size) + return -EINVAL; if (SQFS_IS_FRAGMENTED(fragment)) blk_list_size = file_size / blk_size; else blk_list_size = DIV_ROUND_UP(file_size, blk_size); - return sizeof(*reg) + blk_list_size * sizeof(u32); + if (__builtin_mul_overflow(blk_list_size, (unsigned int)sizeof(u32), + &blk_list_size) || + __builtin_add_overflow((int)sizeof(*reg), (int)blk_list_size, + &size)) + return -EINVAL; + + return size; } case SQFS_LDIR_TYPE: { struct squashfs_ldir_inode *ldir = (struct squashfs_ldir_inode *)inode; - u16 i_count = get_unaligned_le16(&ldir->i_count); + u16 i_count; unsigned int index_list_size = 0, l = 0; struct squashfs_directory_index *di; + size_t consumed; u32 sz; + int size; + if (max < sizeof(*ldir)) + return -EINVAL; + + i_count = get_unaligned_le16(&ldir->i_count); if (i_count == 0) return sizeof(*ldir); di = ldir->index; + consumed = sizeof(*ldir); while (l < i_count) { + /* The directory index header must stay in bounds */ + if (consumed + sizeof(*di) > max) + return -EINVAL; sz = get_unaligned_le32(&di->size) + 1; + if (__builtin_add_overflow(consumed, sizeof(*di) + sz, + &consumed) || + consumed > max) + return -EINVAL; index_list_size += sz; di = (void *)di + sizeof(*di) + sz; l++; } - return sizeof(*ldir) + index_list_size + - i_count * SQFS_DIR_INDEX_BASE_LENGTH; + if (__builtin_add_overflow((int)(sizeof(*ldir) + index_list_size), + (int)(i_count * SQFS_DIR_INDEX_BASE_LENGTH), + &size)) + return -EINVAL; + + return size; } case SQFS_LREG_TYPE: { struct squashfs_lreg_inode *lreg = (struct squashfs_lreg_inode *)inode; - u32 fragment = get_unaligned_le32(&lreg->fragment); - u64 file_size = get_unaligned_le64(&lreg->file_size); + u32 fragment; + u64 file_size; unsigned int blk_list_size; + int size; + + if (max < sizeof(*lreg)) + return -EINVAL; + + fragment = get_unaligned_le32(&lreg->fragment); + file_size = get_unaligned_le64(&lreg->file_size); + + if (!blk_size) + return -EINVAL; if (fragment == 0xFFFFFFFF) blk_list_size = DIV_ROUND_UP(file_size, blk_size); else blk_list_size = file_size / blk_size; - return sizeof(*lreg) + blk_list_size * sizeof(u32); + if (__builtin_mul_overflow(blk_list_size, (unsigned int)sizeof(u32), + &blk_list_size) || + __builtin_add_overflow((int)sizeof(*lreg), (int)blk_list_size, + &size)) + return -EINVAL; + + return size; } case SQFS_SYMLINK_TYPE: @@ -85,6 +142,9 @@ int sqfs_inode_size(struct squashfs_base_inode *inode, u32 blk_size) struct squashfs_symlink_inode *symlink = (struct squashfs_symlink_inode *)inode; + if (max < sizeof(*symlink)) + return -EINVAL; + if (__builtin_add_overflow(sizeof(*symlink), get_unaligned_le32(&symlink->symlink_size), &size)) return -EINVAL; @@ -94,15 +154,23 @@ int sqfs_inode_size(struct squashfs_base_inode *inode, u32 blk_size) case SQFS_BLKDEV_TYPE: case SQFS_CHRDEV_TYPE: + if (max < sizeof(struct squashfs_dev_inode)) + return -EINVAL; return sizeof(struct squashfs_dev_inode); case SQFS_LBLKDEV_TYPE: case SQFS_LCHRDEV_TYPE: + if (max < sizeof(struct squashfs_ldev_inode)) + return -EINVAL; return sizeof(struct squashfs_ldev_inode); case SQFS_FIFO_TYPE: case SQFS_SOCKET_TYPE: + if (max < sizeof(struct squashfs_ipc_inode)) + return -EINVAL; return sizeof(struct squashfs_ipc_inode); case SQFS_LFIFO_TYPE: case SQFS_LSOCKET_TYPE: + if (max < sizeof(struct squashfs_lipc_inode)) + return -EINVAL; return sizeof(struct squashfs_lipc_inode); default: printf("Error while searching inode: unknown type.\n"); @@ -114,11 +182,12 @@ int sqfs_inode_size(struct squashfs_base_inode *inode, u32 blk_size) * Given the uncompressed inode table, the inode to be found and the number of * inodes in the table, return inode position in case of success. */ -void *sqfs_find_inode(void *inode_table, int inode_number, __le32 inode_count, - __le32 block_size) +void *sqfs_find_inode(void *inode_table, size_t table_size, int inode_number, + __le32 inode_count, __le32 block_size) { struct squashfs_base_inode *base; - unsigned int offset = 0, k; + size_t offset = 0; + unsigned int k; int sz; if (!inode_table) { @@ -127,12 +196,17 @@ void *sqfs_find_inode(void *inode_table, int inode_number, __le32 inode_count, } for (k = 0; k < le32_to_cpu(inode_count); k++) { + /* The base inode header must lie within the inode table */ + if (offset + sizeof(struct squashfs_base_inode) > table_size) + return NULL; + base = inode_table + offset; if (get_unaligned_le32(&base->inode_number) == inode_number) return inode_table + offset; - sz = sqfs_inode_size(base, le32_to_cpu(block_size)); - if (sz < 0) + sz = sqfs_inode_size(base, le32_to_cpu(block_size), + table_size - offset); + if (sz <= 0 || (size_t)sz > table_size - offset) return NULL; offset += sz; diff --git a/include/configs/amcore.h b/include/configs/amcore.h index 4c695fb9df9..c6260969064 100644 --- a/include/configs/amcore.h +++ b/include/configs/amcore.h @@ -2,7 +2,7 @@ /* * Sysam AMCORE board configuration * - * (C) Copyright 2016 Angelo Dureghello <[email protected]> + * (C) Copyright 2016 Angelo Dureghello <[email protected]> */ #ifndef __AMCORE_CONFIG_H diff --git a/include/configs/stmark2.h b/include/configs/stmark2.h index c1096398359..a42779621fc 100644 --- a/include/configs/stmark2.h +++ b/include/configs/stmark2.h @@ -2,7 +2,7 @@ /* * Sysam stmark2 board configuration * - * (C) Copyright 2017 Angelo Dureghello <[email protected]> + * (C) Copyright 2017 Angelo Dureghello <[email protected]> */ #ifndef __STMARK2_CONFIG_H diff --git a/include/dm/platform_data/serial_coldfire.h b/include/dm/platform_data/serial_coldfire.h index 5e265e9087d..86dc57e140e 100644 --- a/include/dm/platform_data/serial_coldfire.h +++ b/include/dm/platform_data/serial_coldfire.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0+ */ /* - * Copyright (c) 2015 Angelo Dureghello <[email protected]> + * Copyright (c) 2015 Angelo Dureghello <[email protected]> */ #ifndef __serial_coldfire_h diff --git a/include/dm/platform_data/spi_coldfire.h b/include/dm/platform_data/spi_coldfire.h index 0d534b1d665..b88c51e910f 100644 --- a/include/dm/platform_data/spi_coldfire.h +++ b/include/dm/platform_data/spi_coldfire.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0+ */ /* - * Copyright (c) 2018 Angelo Dureghello <[email protected]> + * Copyright (c) 2018 Angelo Dureghello <[email protected]> */ #ifndef __spi_coldfire_h diff --git a/test/boot/measurement.c b/test/boot/measurement.c index 71f503f1567..85a01f1fec8 100644 --- a/test/boot/measurement.c +++ b/test/boot/measurement.c @@ -9,9 +9,9 @@ #include <bootm.h> #include <env.h> #include <malloc.h> +#include <mapmem.h> #include <test/test.h> #include <test/ut.h> -#include <asm/io.h> #define MEASUREMENT_TEST(_name, _flags) \ UNIT_TEST(_name, _flags, measurement) diff --git a/test/py/tests/test_fs/test_squashfs/test_sqfs_overflow.py b/test/py/tests/test_fs/test_squashfs/test_sqfs_overflow.py new file mode 100644 index 00000000000..df7f875a58f --- /dev/null +++ b/test/py/tests/test_fs/test_squashfs/test_sqfs_overflow.py @@ -0,0 +1,75 @@ +# SPDX-License-Identifier: GPL-2.0 +# Regression test for the SquashFS directory-table integer overflow. + +import os +import struct +import pytest + +# metadata block size (SQFS_METADATA_BLOCK_SIZE) and metadata header size +SQFS_METADATA_BLOCK_SIZE = 8192 +# metablks_count that makes metablks_count * SQFS_METADATA_BLOCK_SIZE wrap a +# 32-bit int back down to a tiny value: (2^19 + 1) * 8192 == 2^32 + 8192. +NR_METABLKS = (1 << 19) + 1 + +def make_overflow_image(path): + """Build a SquashFS image whose directory table inflates metablks_count so + that metablks_count * SQFS_METADATA_BLOCK_SIZE wraps a 32-bit int, then + writes one block of data one metadata block past the resulting buffer.""" + def metahdr(size): + # uncompressed metadata block header (bit 15 set) + return struct.pack('<H', 0x8000 | (size & 0x7fff)) + + # inode table: one small valid uncompressed metadata block + inode_region = metahdr(32) + b'\x00' * 32 + inode_start = 96 + dir_start = inode_start + len(inode_region) + + # directory table: NR_METABLKS metadata blocks, only block 1 carries data + dir_region = bytearray() + dir_region += metahdr(0) # block 0: empty + dir_region += metahdr(200) + b'A' * 200 # block 1: data + dir_region += metahdr(0) * (NR_METABLKS - 2) # blocks 2..N-1: empty + frag_start = dir_start + len(dir_region) + + sb = bytearray(96) + struct.pack_into('<I', sb, 0, 0x73717368) # s_magic + struct.pack_into('<I', sb, 4, 1) # inodes + struct.pack_into('<I', sb, 12, 131072) # block_size + struct.pack_into('<H', sb, 20, 1) # compression = gzip/zlib + struct.pack_into('<H', sb, 22, 17) # block_log + struct.pack_into('<H', sb, 26, 1) # no_ids + struct.pack_into('<H', sb, 28, 4) # s_major + struct.pack_into('<Q', sb, 48, frag_start) # id_table_start + struct.pack_into('<Q', sb, 56, 0xffffffffffffffff) # xattr_id_table_start + struct.pack_into('<Q', sb, 64, inode_start) # inode_table_start + struct.pack_into('<Q', sb, 72, dir_start) # directory_table_start + struct.pack_into('<Q', sb, 80, frag_start) # fragment_table_start + struct.pack_into('<Q', sb, 88, 0xffffffffffffffff) # export_table_start + + img = bytearray(sb) + inode_region + dir_region + # pad so the directory-table block read stays within the file + need = ((len(img) + 511) // 512 + 1) * 512 + img += b'\x00' * (need - len(img)) + struct.pack_into('<Q', img, 40, len(img)) # bytes_used + + with open(path, 'wb') as f: + f.write(img) + [email protected]('sandbox') [email protected]('cmd_squashfs') [email protected]('fs_squashfs') +def test_sqfs_ls_dir_table_overflow(ubman): + """Listing a crafted image whose directory table declares an oversized + metadata-block count must be rejected without corrupting the heap. + """ + ubman.restart_uboot() + image_path = os.path.join(ubman.config.build_dir, 'sqfs_dir_table_overflow') + make_overflow_image(image_path) + try: + ubman.run_command('host bind 0 {}'.format(image_path)) + ubman.run_command('sqfsls host 0') + # The crafted image must not take the board down. + assert 'alive' in ubman.run_command('echo alive') + finally: + os.remove(image_path) diff --git a/tools/buildman/board.py b/tools/buildman/board.py index 248d8bfff18..231454dc8cd 100644 --- a/tools/buildman/board.py +++ b/tools/buildman/board.py @@ -10,7 +10,7 @@ class Board: """Create a new board type. Args: - status: define whether the board is 'Active' or 'Orphaned' + status: define whether the board is 'Active' or 'Orphan' arch: Architecture name (e.g. arm) cpu: Cpu name (e.g. arm1136) soc: Name of SOC, or '' if none (e.g. mx31) diff --git a/tools/buildman/func_test.py b/tools/buildman/func_test.py index 51c6855420e..fce615ba8b8 100644 --- a/tools/buildman/func_test.py +++ b/tools/buildman/func_test.py @@ -951,7 +951,7 @@ Active aarch64 armv8 - armltd total_compute board2 self.assertEqual(["WARNING: no maintainers for 'board0'"], warnings) # Mark a board as orphaned - this should give a warning - lines = ['S: Orphaned' if line.startswith('S') else line + lines = ['S: Orphan' if line.startswith('S') else line for line in orig_data.splitlines(keepends=True)] tools.write_file(main, ''.join(lines), binary=False) params_list, warnings = self._boards.build_board_list(config_dir, src) |
