summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/rpm
diff options
context:
space:
mode:
authorZhixiong Chi <zhixiong.chi@windriver.com>2015-08-13 11:16:29 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-08-19 18:05:42 +0100
commita21b0473ad3f6e4d1de1284113f8dd02ef3a735f (patch)
treeedc3e92bf78988508be76ad29a56e464d12a8eba /meta/recipes-devtools/rpm
parent7ed4a91863252c60e5c6c8997d6dac99b85854bc (diff)
downloadpoky-a21b0473ad3f6e4d1de1284113f8dd02ef3a735f.tar.gz
rpm: opendb before rpmverifyscript to avoid null point input
If the command is "rpm -V" and the return value of (headerIsEntry(h, RPMTAG_VERIFYSCRIPT) || headerIsEntry(h, RPMTAG_SANITYCHECK)) located in /lib/verify.c is true, it will call rpmpsmStage function(rpmVerifyScript->rpmpsmScriptStage->rpmpsmStage) and occur segment fault because of null point(rpmtsGetRdb(ts) == NULL and rpmtsGetRdb(ts)->db_txn). So we open rpmdb to avoid bad input when find headerIsEntry true. workflow: main()->rpmcliVerify()->rpmcliArgIter()->rpmQueryVerify()->rpmgiShowMatches()->showVerifyPackage()-> rpmqv.c verify.c query.c query.c verify.c(headerIsEntry) rpmVerifyScript()->rpmpsmScriptStage()->rpmpsmStage()-> rpmtxnCommit(rpmtsGetRdb(ts)->db_txn); verify.c psm.c psm.c psm.c (From OE-Core rev: 91945b7fcb0c83ca72543e5327e965eca9c269c4) Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/rpm')
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-opendb-before-verifyscript-to-avoid-null-point.patch24
-rw-r--r--meta/recipes-devtools/rpm/rpm_5.4.14.bb1
2 files changed, 25 insertions, 0 deletions
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-opendb-before-verifyscript-to-avoid-null-point.patch b/meta/recipes-devtools/rpm/rpm/rpm-opendb-before-verifyscript-to-avoid-null-point.patch
new file mode 100644
index 0000000000..07d586a3ab
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-opendb-before-verifyscript-to-avoid-null-point.patch
@@ -0,0 +1,24 @@
1rpm: opendb before rpmverifyscript to avoid null point input
2
3If the command is "rpm -V" and the return value of (headerIsEntry(h, RPMTAG_VERIFYSCRIPT)
4|| headerIsEntry(h, RPMTAG_SANITYCHECK)) located in /lib/verify.c is true, it will call
5rpmpsmStage function(rpmVerifyScript->rpmpsmScriptStage->rpmpsmStage) and occur segment
6fault because of null point(rpmtsGetRdb(ts) == NULL and rpmtsGetRdb(ts)->db_txn).
7So we open rpmdb to avoid bad input when find headerIsEntry true.
8
9Upstream-Status: Pending
10
11Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com>
12Index: rpm-5.4.14/lib/verify.c
13===================================================================
14--- rpm-5.4.14.orig/lib/verify.c 2015-07-22 22:09:59.992895355 +0800
15+++ rpm-5.4.14/lib/verify.c 2015-08-13 10:20:33.752177906 +0800
16@@ -613,6 +613,8 @@
17 {
18 FD_t fdo = fdDup(STDOUT_FILENO);
19
20+ rpmtsOpenDB(ts, O_RDONLY); /*Open the DB to avoid null point input in function rpmpsmStage()*/
21+
22 rc = rpmfiSetHeader(fi, h);
23 if ((rc = rpmVerifyScript(qva, ts, fi, fdo)) != 0)
24 ec += rc;
diff --git a/meta/recipes-devtools/rpm/rpm_5.4.14.bb b/meta/recipes-devtools/rpm/rpm_5.4.14.bb
index ddbdcb94ee..1f4d9d2e0c 100644
--- a/meta/recipes-devtools/rpm/rpm_5.4.14.bb
+++ b/meta/recipes-devtools/rpm/rpm_5.4.14.bb
@@ -95,6 +95,7 @@ SRC_URI = "http://www.rpm5.org/files/rpm/rpm-5.4/rpm-5.4.14-0.20131024.src.rpm;e
95 file://rpm-lua-fix-print.patch \ 95 file://rpm-lua-fix-print.patch \
96 file://rpm-check-rootpath-reasonableness.patch \ 96 file://rpm-check-rootpath-reasonableness.patch \
97 file://rpm-macros.in-disable-external-key-server.patch \ 97 file://rpm-macros.in-disable-external-key-server.patch \
98 file://rpm-opendb-before-verifyscript-to-avoid-null-point.patch \
98 " 99 "
99 100
100# Uncomment the following line to enable platform score debugging 101# Uncomment the following line to enable platform score debugging