linux-stable/scripts
Yusong Gao 1a455a1ddb sign-file: Fix incorrect return values check
[ Upstream commit 829649443e ]

There are some wrong return values check in sign-file when call OpenSSL
API. The ERR() check cond is wrong because of the program only check the
return value is < 0 which ignored the return val is 0. For example:
1. CMS_final() return 1 for success or 0 for failure.
2. i2d_CMS_bio_stream() returns 1 for success or 0 for failure.
3. i2d_TYPEbio() return 1 for success and 0 for failure.
4. BIO_free() return 1 for success and 0 for failure.

Link: https://www.openssl.org/docs/manmaster/man3/
Fixes: e5a2e3c847 ("scripts/sign-file.c: Add support for signing with a raw signature")
Signed-off-by: Yusong Gao <a869920004@gmail.com>
Reviewed-by: Juerg Haefliger <juerg.haefliger@canonical.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Link: https://lore.kernel.org/r/20231213024405.624692-1-a869920004@gmail.com/ # v5
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-12-20 15:32:34 +01:00
..
basic fixdep: trivial: typo fix and correction 2017-08-10 01:01:03 +09:00
coccinelle fs: stream_open - opener for stream-like files so that read and write can run simultaneously without deadlock 2019-06-11 12:21:51 +02:00
dtc scripts/dtc: dtx_diff: remove broken example from help text 2022-01-27 09:01:01 +01:00
gcc-plugins randstruct: Fix gcc-plugin performance mode to stay in group 2023-11-28 16:45:44 +00:00
gdb scripts/gdb: fix debugging modules compiled with hot/cold partitioning 2019-12-05 15:37:04 +01:00
genksyms License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
kconfig kconfig: display recursive dependency resolution hint just once 2022-12-08 11:16:30 +01:00
ksymoops Fix dead URLs to ftp.kernel.org 2017-03-28 16:16:52 +02:00
mod modpost: add missing else to the "of" check 2023-10-10 21:43:41 +02:00
package builddeb: Fix header package regarding dtc source links 2018-05-30 07:52:21 +02:00
selinux selinux: use "grep -E" instead of "egrep" 2022-10-26 13:16:58 +02:00
tracing scripts/tracing: fix the bug that can't parse raw_trace_func 2021-08-15 13:03:31 +02:00
.gitignore Docs: clean up some DocBook loose ends 2017-06-23 14:17:38 -06:00
Kbuild.include kbuild: improve cc-option to clean up all temporary files 2020-06-30 15:38:06 -04:00
Lindent License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Makefile scripts: set proper OpenSSL include dir also for sign-file 2021-03-07 11:27:41 +01:00
Makefile.asm-generic License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Makefile.build tracing: Avoid calling cc-option -mrecord-mcount for every Makefile 2021-02-23 14:00:33 +01:00
Makefile.clean License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Makefile.dtbinst License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Makefile.extrawarn Makefile.extrawarn: Move -Wcast-function-type-strict to W=1 2022-10-26 13:16:51 +02:00
Makefile.gcc-plugins License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Makefile.headersinst License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Makefile.help
Makefile.host License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Makefile.kasan kasan: rework Kconfig settings 2018-02-16 20:23:04 +01:00
Makefile.lib kbuild: Handle builtin dtb file names containing hyphens 2018-03-15 10:54:33 +01:00
Makefile.modbuiltin License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Makefile.modinst License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Makefile.modpost kbuild: Fix include path in scripts/Makefile.modpost 2022-09-05 10:25:06 +02:00
Makefile.modsign License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Makefile.ubsan lib/ubsan: remove returns-nonnull-attribute checks 2023-09-23 10:46:52 +02:00
adjust_autoksyms.sh kbuild: make scripts/adjust_autoksyms.sh robust against timestamp races 2018-05-30 07:52:17 +02:00
asn1_compiler.c ASN.1: Fix check for strdup() success 2023-04-26 11:18:58 +02:00
bloat-o-meter scripts: switch explicitly to Python 3 2021-06-03 08:36:11 +02:00
bootgraph.pl scripts: Switch to more portable Perl shebang 2017-05-14 11:20:44 +09:00
check_00index.sh License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
check_extable.sh License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
checkincludes.pl License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
checkkconfigsymbols.py checkkconfigsymbols.py: support Kconfig's 'imply' statement 2017-02-03 11:49:06 +01:00
checkpatch.pl checkpatch: fix unescaped left brace 2020-12-29 13:47:02 +01:00
checkstack.pl scripts/checkstack.pl: Fix arm64 wrong or unknown architecture 2019-06-25 11:36:53 +08:00
checksyscalls.sh License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
checkversion.pl License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cleanfile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cleanpatch License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
coccicheck coccinelle: fix parallel build with CHECK=scripts/coccicheck 2017-12-14 09:53:06 +01:00
config tweewide: Fix most Shebang lines 2021-06-03 08:36:11 +02:00
conmakehash.c
const_structs.checkpatch const_structs.checkpatch: add frequently used from Julia Lawall's list 2016-10-11 15:06:30 -07:00
decode_stacktrace.sh scripts/decode_stacktrace: strip basepath from all paths 2020-07-29 07:42:54 +02:00
decodecode scripts/decodecode: fix trapping instruction formatting 2020-05-20 08:17:01 +02:00
depmod.sh depmod: handle the case of /sbin/depmod without /sbin in PATH 2021-01-12 20:09:06 +01:00
diffconfig scripts: switch explicitly to Python 3 2021-06-03 08:36:11 +02:00
export_report.pl scripts: Switch to more portable Perl shebang 2017-05-14 11:20:44 +09:00
extract-cert.c cert host tools: Stop complaining about deprecated OpenSSL functions 2022-11-25 17:36:47 +01:00
extract-ikconfig
extract-module-sig.pl License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
extract-sys-certs.pl License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
extract-vmlinux
extract_xc3028.pl scripts: Switch to more portable Perl shebang 2017-05-14 11:20:44 +09:00
faddr2line scripts/faddr2line: fix CROSS_COMPILE unset error 2018-02-07 11:12:17 -08:00
gcc-goto.sh License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
gcc-ld License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
gcc-plugin.sh License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
gcc-version.sh License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
gcc-x86_32-has-stack-protector.sh License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
gcc-x86_64-has-stack-protector.sh License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
gen_initramfs_list.sh Kbuild misc updates for 4.13 2017-07-07 15:09:09 -07:00
get_dvb_firmware scripts: Switch to more portable Perl shebang 2017-05-14 11:20:44 +09:00
get_maintainer.pl get_maintainer: Prepare for separate MAINTAINERS files 2017-08-08 11:09:31 -07:00
gfp-translate
headerdep.pl License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
headers.sh License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
headers_check.pl License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
headers_install.sh linux/compiler.h: Split into compiler.h and compiler_types.h 2017-12-25 14:26:33 +01:00
insert-sys-cert.c KEYS: Reserve an extra certificate symbol for inserting without recompiling 2016-02-26 15:30:20 +00:00
kallsyms.c scripts/kallsyms: fix definitely-lost memory leak 2020-01-04 13:59:51 +01:00
kernel-doc scripts/kernel-doc: Don't fail with status != 0 if error encountered with -none 2018-02-25 11:07:58 +01:00
ld-version.sh License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
leaking_addresses.pl leaking_addresses: Always print a trailing newline 2021-11-26 11:40:28 +01:00
link-vmlinux.sh License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
makelst License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
markup_oops.pl scripts: Switch to more portable Perl shebang 2017-05-14 11:20:44 +09:00
mkcompile_h kbuild: mkcompile_h: consider timestamp if KBUILD_BUILD_TIMESTAMP is set 2021-07-28 11:12:15 +02:00
mkmakefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mksysmap mksysmap: Fix the mismatch of 'L0' symbols in System.map 2022-09-28 10:56:49 +02:00
mkuboot.sh License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
module-common.lds module: set .init_array alignment to 8 2017-03-13 09:40:28 -07:00
namespace.pl namespace: fix namespace.pl script to support relative paths 2019-10-29 09:16:59 +01:00
objdiff scripts: objdiff: Ignore debug info when comparing 2017-03-11 11:13:38 +09:00
parse-maintainers.pl parse-maintainers: Mark as executable 2020-04-02 16:34:15 +02:00
patch-kernel License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pnmtologo.c
profile2linkerlist.pl License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
prune-kernel License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
recordmcount.c recordmcount: Fix memory leaks in the uwrite function 2023-05-30 12:38:36 +01:00
recordmcount.h recordmcount: Fix spurious mcount entries on powerpc 2019-07-31 07:28:53 +02:00
recordmcount.pl recordmcount.pl: fix typo in s390 mcount regex 2022-01-05 12:33:48 +01:00
setlocalversion scripts/setlocalversion: make git describe output more reliable 2020-11-05 11:06:51 +01:00
show_delta tweewide: Fix most Shebang lines 2021-06-03 08:36:11 +02:00
sign-file.c sign-file: Fix incorrect return values check 2023-12-20 15:32:34 +01:00
sortextable.c powerpc: Build-time sort the exception table 2016-11-14 11:11:51 +11:00
sortextable.h
spelling.txt scripts/spelling.txt: add more spelling mistakes to spelling.txt 2017-10-03 17:54:23 -07:00
sphinx-pre-install tweewide: Fix most Shebang lines 2021-06-03 08:36:11 +02:00
stackdelta License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
stackusage License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
tags.sh scripts/tags.sh: Resolve gtags empty index generation 2023-08-11 11:33:32 +02:00
unifdef.c unifdef: use memcpy instead of strncpy 2018-12-08 13:03:35 +01:00
ver_linux License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
xen-hypercalls.sh License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
xz_wrap.sh