u-boot/tools
Michal Simek ebe0f53f48 tools: mkimage: Use fstat instead of stat to avoid malicious hacks
The patch is fixing:
"tools: mkimage: Check if file is regular file"
(sha1: 56c7e80155)
which contains two issues reported by Coverity
Unchecked return value from stat and incorrect calling sequence where
attack can happen between calling stat and fopen.
Using pair in opposite order (fopen and fstat) is fixing this issue
because fstat is using the same file descriptor (FILE *).

Also fixing issue with:
"tools: mkimage: Add support for initialization table for Zynq and
ZynqMP" (sha1: 3b6460809c)
where file wasn't checked that it is regular file.

Reported-by: Coverity (CID: 154711, 154712)
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2016-12-09 08:40:23 -05:00
..
buildman buildman: Rename do_build to config_only 2016-12-02 20:53:18 -07:00
dtoc dtoc: Make integer division python 3.x safe 2016-10-09 09:30:32 -06:00
easylogo Various Makefiles: Add SPDX-License-Identifier tags 2015-11-10 09:19:52 -05:00
env tools/env: fix environment alignment tests for block devices 2016-11-28 15:10:36 -05:00
gdb Makefile: move BFD_ROOT_DIR to tools/gdb/Makefile 2014-02-19 11:07:50 -05:00
kermit tools: move kermit files to tools/kermit directory 2014-01-24 16:59:07 -05:00
logos imx: ventana: enable splashscreen support 2016-09-06 18:22:48 +02:00
omap Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
patman patman: Fix doctest StringIO import for python 3.x 2016-10-09 09:30:32 -06:00
scripts tools: fix define2mk.sed to not add quotes around negative integers 2016-06-13 07:46:29 +09:00
tbot test, tools: update tbot documentation 2016-05-13 11:25:59 -04:00
.gitignore tools: Add entry for generated tools/bin2header to tools/.gitignore 2016-05-27 15:47:56 -04:00
aisimage.c imagetool: replace image registration function by linker_lists feature 2015-01-29 13:38:41 -05:00
aisimage.h Coding Style cleanup: remove trailing white space 2013-10-14 16:06:53 -04:00
atmel_pmecc_params.c Change my mailaddress 2016-05-02 18:37:09 -04:00
atmelimage.c Change my mailaddress 2016-05-02 18:37:09 -04:00
bin2header.c cmd: Fix license command 2016-03-22 12:16:13 -04:00
bmp_logo.c tools, bmp_logo: fix index from uint16_t to int to allow bigger logos 2013-08-10 10:48:00 +02:00
default_image.c Respect SOURCE_DATE_EPOCH when building FIT images. 2016-06-24 17:23:10 -04:00
dumpimage.c dumpimage: replace the term "datafile" by "subimage" 2015-01-29 13:38:41 -05:00
dumpimage.h includes: move openssl headers to include/u-boot 2014-06-19 11:19:04 -04:00
envcrc.c tools/env: Correct include kconfig 2016-11-23 23:41:23 -08:00
fdt_host.h tools, fit_check_sign: verify a signed fit image 2014-03-21 16:40:38 -04:00
fdtgrep.c Various, accumulated typos collected from around the tree. 2016-10-06 20:57:40 -04:00
fit_check_sign.c Fix bad return value checks (detected with Coccinelle) 2015-10-24 13:50:30 -04:00
fit_common.c mkimage: Automatically make space in FDT when full 2014-06-11 16:25:46 -04:00
fit_common.h mkimage: Automatically make space in FDT when full 2014-06-11 16:25:46 -04:00
fit_image.c mkimage: Allow including a ramdisk in FIT auto mode 2016-11-06 07:33:42 -05:00
fit_info.c tools, fit_info: increase buffer for command name 2014-08-14 11:20:24 +02:00
gen_eth_addr.c tools: gen_eth_addr: add getpid() to time(0) to avoid duplicated seed 2015-09-28 10:48:25 -04:00
genboardscfg.py tools/genboardscfg.py: remove bogus import subprocess 2016-05-27 15:47:56 -04:00
getline.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
getline.h getline: split out for darwin systems 2010-01-26 00:07:13 +01:00
gpheader.h tools: mkimage: add support for gpimage format 2014-04-17 17:24:38 -04:00
gpimage-common.c dumpimage: add 'T' option to explicitly set the image type 2015-01-29 13:38:41 -05:00
gpimage.c imagetool: replace image registration function by linker_lists feature 2015-01-29 13:38:41 -05:00
ifdtool.c x86: ifdtool: Support checking region overlap before U-Boot 2015-09-09 07:48:03 -06:00
ifdtool.h tools/ifdtool: Support writing multiple files (-w) simultaneously 2014-12-13 22:32:04 -07:00
image-host.c image: Combine image_sig_algo with image_sign_info 2016-11-21 14:07:31 -05:00
imagetool.c Respect SOURCE_DATE_EPOCH when building FIT images. 2016-06-24 17:23:10 -04:00
imagetool.h mkimage: Allow including a ramdisk in FIT auto mode 2016-11-06 07:33:42 -05:00
img2brec.sh Coding Style cleanup: replace leading SPACEs by TABs 2013-10-14 16:06:54 -04:00
img2srec.c img2srec: use standard types 2009-11-24 23:43:18 +01:00
imximage.c tools: imximage: display DCD block offset, length 2016-11-29 16:37:37 +01:00
imximage.h tools: imximage: add plugin support 2016-10-24 10:57:16 +02:00
jtagconsole Blackfin: jtagconsole: disable output processing 2010-07-25 15:17:23 -04:00
kwbimage.c tools/kwbimage: add DEBUG option 2016-12-01 09:10:49 +01:00
kwbimage.h tools/kwbimage: add DEBUG option 2016-12-01 09:10:49 +01:00
kwboot.c tools: kwboot: patch destaddr only for SoCs with header version 1 2016-08-26 08:42:50 +02:00
lpc32xximage.c lpc32xx: add lpc32xx-spl.bin boot image target 2015-04-10 14:23:26 +02:00
Makefile tools/Makefile: suppress "which swig" error output 2016-11-28 15:10:35 -05:00
microcode-tool x86: Add a script to process Intel microcode files 2014-12-18 17:26:08 -07:00
microcode-tool.py tools: microcode-tool: Support parsing header file with a license block 2016-01-13 12:20:14 +08:00
mingw_support.c Add LGPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:45:01 -04:00
mingw_support.h Add LGPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:45:01 -04:00
mkenvimage.c Patch to mkenvimage to handle text files with length that exceed env size 2015-03-28 12:07:47 -04:00
mkexynosspl.c Fix bad return value checks (detected with Coccinelle) 2015-10-24 13:50:30 -04:00
mkimage.c mkimage: Allow including a ramdisk in FIT auto mode 2016-11-06 07:33:42 -05:00
mkimage.h includes: move openssl headers to include/u-boot 2014-06-19 11:19:04 -04:00
mksunxiboot.c tools: add mksunxiboot to tools-all target 2016-10-30 11:38:04 +01:00
moveconfig.py tools: moveconfig: support wildcards in --defconfigs file 2016-10-24 08:04:42 -04:00
mxsboot.c mxsboot: remove unused include 2016-02-21 11:09:19 +01:00
mxsimage.c imagetool: replace image registration function by linker_lists feature 2015-01-29 13:38:41 -05:00
mxsimage.h ARM: mxs: tools: Add support for boot progress display flag 2014-11-20 10:13:45 +01:00
ncb.c ncb: Check return value of write() 2009-04-28 01:16:46 +02:00
netconsole net: Make netconsole src and dest ports configurable 2012-09-24 13:17:24 -05:00
omapimage.c imagetool: replace image registration function by linker_lists feature 2015-01-29 13:38:41 -05:00
omapimage.h tools: mkimage: add support for gpimage format 2014-04-17 17:24:38 -04:00
os_support.c Add LGPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:45:01 -04:00
os_support.h Add LGPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:45:01 -04:00
pbl_crc32.c mkimage : Split out and clean pbl_crc32 for use by other image types 2014-06-05 14:38:38 -04:00
pbl_crc32.h mkimage : Split out and clean pbl_crc32 for use by other image types 2014-06-05 14:38:38 -04:00
pblimage.c pbl: use "wait" command instead of "flush" command 2016-10-14 10:21:30 -07:00
pblimage.h Coding Style cleanup: remove trailing white space 2013-10-14 16:06:53 -04:00
proftool.c tools/proftool: fix use-after-free 2015-11-16 17:22:18 -05:00
relocate-rela.c relocate-rela: replace a magic number with sizeof(Elf64_Rela) 2014-02-13 15:16:47 +01:00
rkcommon.c mkimage: rockchip: add suport for rk33 serial 2016-07-25 20:46:45 -06:00
rkcommon.h rockchip: mkimage: use imagename to select spl hdr & spl size 2015-12-13 17:07:29 -07:00
rkimage.c rockchip: Check image name for the rksd image 2016-05-27 10:23:07 -06:00
rkmux.py rockchip: Add a script to parse datasheets 2016-01-21 20:42:37 -07:00
rksd.c rockchip: mkimage: use imagename to select spl hdr & spl size 2015-12-13 17:07:29 -07:00
rkspi.c rockchip: Drop a debug message when outputing SPI images 2016-01-08 07:59:06 -07:00
socfpgaimage.c tools: do not print error messages in verify_header() functions 2015-01-29 13:38:41 -05:00
ublimage.c imagetool: replace image registration function by linker_lists feature 2015-01-29 13:38:41 -05:00
ublimage.h Coding Style cleanup: remove trailing white space 2013-10-14 16:06:53 -04:00
ubsha1.c includes: move openssl headers to include/u-boot 2014-06-19 11:19:04 -04:00
vybridimage.c tools: mkimage: add support for Vybrid image format 2016-10-06 09:06:16 +02:00
xway-swap-bytes.c MIPS: INCA-IP: rename inca-swap-bytes host tool 2011-07-31 23:25:41 +09:00
zynqimage.c tools: mkimage: Use fstat instead of stat to avoid malicious hacks 2016-12-09 08:40:23 -05:00
zynqmpimage.c tools: mkimage: Use fstat instead of stat to avoid malicious hacks 2016-12-09 08:40:23 -05:00