From 76886a07bf26b14d315371efe20ff17a33376bcf51e64609335df09ddbd7f254 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Fri, 22 Aug 2014 10:38:44 +0000 Subject: [PATCH] fix parted in qemu-linux-user OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=227 --- ...-linux-user-binfmt-support-host-bina.patch | 15 +-- ...-target-arm-linux-user-no-tb_flush-o.patch | 2 +- ...-linux-user-Ignore-broken-loop-ioctl.patch | 2 +- 0017-linux-user-lock-tcg.patch | 2 +- ...-linux-user-Run-multi-threaded-code-.patch | 2 +- 0019-linux-user-lock-tb-flushing-too.patch | 2 +- 0020-linux-user-Fake-proc-cpuinfo.patch | 2 +- ...-linux-user-implement-FS_IOC_GETFLAG.patch | 2 +- ...-linux-user-implement-FS_IOC_SETFLAG.patch | 2 +- 0023-linux-user-XXX-disable-fiemap.patch | 2 +- 0024-slirp-nooutgoing.patch | 2 +- ...-vnc-password-file-and-incoming-conn.patch | 2 +- 0026-linux-user-add-more-blk-ioctls.patch | 2 +- 0027-linux-user-use-target_ulong.patch | 2 +- ...-block-Add-support-for-DictZip-enabl.patch | 2 +- 0029-block-Add-tar-container-format.patch | 2 +- ...-Legacy-Patch-kvm-qemu-preXX-dictzip.patch | 2 +- ...-Legacy-Patch-kvm-qemu-preXX-report-.patch | 2 +- ...-console-add-question-mark-escape-op.patch | 2 +- ...-Make-char-muxer-more-robust-wrt-sma.patch | 2 +- ...-linux-user-lseek-explicitly-cast-no.patch | 2 +- ...-virtfs-proxy-helper-Provide-__u64-f.patch | 2 +- ...-configure-Enable-PIE-for-ppc-and-pp.patch | 2 +- 0037-tests-Don-t-run-qom-test-twice.patch | 2 +- 0038-qtest-Increase-socket-timeout.patch | 2 +- ...-linux-user-Cast-validity-checks-on-.patch | 58 ++++++++++ ...-linux-user-Convert-blkpg-to-use-a-s.patch | 109 ++++++++++++++++++ libcacard.changes | 8 ++ libcacard.spec | 4 + qemu-linux-user.changes | 9 ++ qemu-linux-user.spec | 4 + qemu.changes | 8 ++ qemu.spec | 4 + 33 files changed, 236 insertions(+), 31 deletions(-) create mode 100644 0039-linux-user-Cast-validity-checks-on-.patch create mode 100644 0040-linux-user-Convert-blkpg-to-use-a-s.patch diff --git a/0014-linux-user-binfmt-support-host-bina.patch b/0014-linux-user-binfmt-support-host-bina.patch index d0571f00..6dfbe389 100644 --- a/0014-linux-user-binfmt-support-host-bina.patch +++ b/0014-linux-user-binfmt-support-host-bina.patch @@ -1,4 +1,4 @@ -From 70ad0bad051af3ffb284077b6e517d71d21fd12b Mon Sep 17 00:00:00 2001 +From 5d5c84486c1a16916376b8d0b757eab4a2c45ddd Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Thu, 2 Feb 2012 18:02:33 +0100 Subject: [PATCH] linux-user: binfmt: support host binaries @@ -8,11 +8,11 @@ trying to run, let's just use that instead as it will be a lot faster. Signed-off-by: Alexander Graf --- - linux-user/binfmt.c | 25 +++++++++++++++++++++++++ - 1 file changed, 25 insertions(+) + linux-user/binfmt.c | 26 ++++++++++++++++++++++++++ + 1 file changed, 26 insertions(+) diff --git a/linux-user/binfmt.c b/linux-user/binfmt.c -index cd1f513..87dc4c6 100644 +index cd1f513..c755edc 100644 --- a/linux-user/binfmt.c +++ b/linux-user/binfmt.c @@ -5,6 +5,9 @@ @@ -25,7 +25,7 @@ index cd1f513..87dc4c6 100644 int main(int argc, char **argv, char **envp) { -@@ -28,6 +31,28 @@ int main(int argc, char **argv, char **envp) +@@ -28,6 +31,29 @@ int main(int argc, char **argv, char **envp) binfmt[0] = '\0'; /* Now argv[0] is the real qemu binary name */ @@ -33,14 +33,15 @@ index cd1f513..87dc4c6 100644 + { + char *hostbin; + char *guestarch; ++ int r; + + guestarch = strrchr(argv[0], '-') ; + if (!guestarch) { + goto skip; + } + guestarch++; -+ asprintf(&hostbin, "/emul/" ARCH_NAME "-for-%s/%s", guestarch, argv[1]); -+ if (!access(hostbin, X_OK)) { ++ r = asprintf(&hostbin, "/emul/" ARCH_NAME "-for-%s/%s", guestarch, argv[1]); ++ if (!access(hostbin, X_OK) && (r > 0)) { + /* + * We found a host binary replacement for the non-host binary. Let's + * use that instead! diff --git a/0015-target-arm-linux-user-no-tb_flush-o.patch b/0015-target-arm-linux-user-no-tb_flush-o.patch index a00b4550..e1dd45f3 100644 --- a/0015-target-arm-linux-user-no-tb_flush-o.patch +++ b/0015-target-arm-linux-user-no-tb_flush-o.patch @@ -1,4 +1,4 @@ -From b78c0ae32e6300e54acca09212d7d1be07d59567 Mon Sep 17 00:00:00 2001 +From cbdee3c89ee3a9eb92e4950331a4467ef3b631f7 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Tue, 29 May 2012 15:30:01 +0200 Subject: [PATCH] target-arm: linux-user: no tb_flush on reset diff --git a/0016-linux-user-Ignore-broken-loop-ioctl.patch b/0016-linux-user-Ignore-broken-loop-ioctl.patch index 6954bcf4..0b178f98 100644 --- a/0016-linux-user-Ignore-broken-loop-ioctl.patch +++ b/0016-linux-user-Ignore-broken-loop-ioctl.patch @@ -1,4 +1,4 @@ -From 11c173eda98507f9fd9bdafabf60799db436db73 Mon Sep 17 00:00:00 2001 +From 01b4a4a0570ebb8808233a33fb1e19b247e1bef5 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Tue, 12 Jun 2012 04:41:10 +0200 Subject: [PATCH] linux-user: Ignore broken loop ioctl diff --git a/0017-linux-user-lock-tcg.patch b/0017-linux-user-lock-tcg.patch index 8923ad5a..d1c8f83d 100644 --- a/0017-linux-user-lock-tcg.patch +++ b/0017-linux-user-lock-tcg.patch @@ -1,4 +1,4 @@ -From a0a4043fe6138dbebb794f704cae5a2ca8c12f72 Mon Sep 17 00:00:00 2001 +From 097619e159ed8c4c0209aacf93e9a3a64f853aef Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Thu, 5 Jul 2012 17:31:39 +0200 Subject: [PATCH] linux-user: lock tcg diff --git a/0018-linux-user-Run-multi-threaded-code-.patch b/0018-linux-user-Run-multi-threaded-code-.patch index 9d4f86bf..0ec7ffac 100644 --- a/0018-linux-user-Run-multi-threaded-code-.patch +++ b/0018-linux-user-Run-multi-threaded-code-.patch @@ -1,4 +1,4 @@ -From 8b667524d7227a6c5d6c5d4a5938b62ac368a694 Mon Sep 17 00:00:00 2001 +From d708c8ddc376dab7cf20421553d2f066ff0e4c67 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Tue, 10 Jul 2012 20:40:55 +0200 Subject: [PATCH] linux-user: Run multi-threaded code on a single core diff --git a/0019-linux-user-lock-tb-flushing-too.patch b/0019-linux-user-lock-tb-flushing-too.patch index 16366d70..8523fd9e 100644 --- a/0019-linux-user-lock-tb-flushing-too.patch +++ b/0019-linux-user-lock-tb-flushing-too.patch @@ -1,4 +1,4 @@ -From 58082d09b18f24359eebf35085d5b22c108a4ef9 Mon Sep 17 00:00:00 2001 +From 5c92fd785687b31d2af90d9a67dfac7763f58ed0 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Wed, 11 Jul 2012 16:47:42 +0200 Subject: [PATCH] linux-user: lock tb flushing too diff --git a/0020-linux-user-Fake-proc-cpuinfo.patch b/0020-linux-user-Fake-proc-cpuinfo.patch index c10a99de..ff92646d 100644 --- a/0020-linux-user-Fake-proc-cpuinfo.patch +++ b/0020-linux-user-Fake-proc-cpuinfo.patch @@ -1,4 +1,4 @@ -From a869e60296534bb11c1e5b586b11c4863c5ad2b8 Mon Sep 17 00:00:00 2001 +From 99d290456ff1103918e341ceac7535bc3b4b6f49 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Mon, 23 Jul 2012 10:24:14 +0200 Subject: [PATCH] linux-user: Fake /proc/cpuinfo diff --git a/0021-linux-user-implement-FS_IOC_GETFLAG.patch b/0021-linux-user-implement-FS_IOC_GETFLAG.patch index f3b1f79b..2c8fa2ec 100644 --- a/0021-linux-user-implement-FS_IOC_GETFLAG.patch +++ b/0021-linux-user-implement-FS_IOC_GETFLAG.patch @@ -1,4 +1,4 @@ -From acb4c73ef1d92846e501e7f134e57dc48b722ed9 Mon Sep 17 00:00:00 2001 +From cc0c9cec3fd3bcf86f7ddca8d6ba6a292c127cef Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Mon, 20 Aug 2012 00:02:52 +0200 Subject: [PATCH] linux-user: implement FS_IOC_GETFLAGS ioctl diff --git a/0022-linux-user-implement-FS_IOC_SETFLAG.patch b/0022-linux-user-implement-FS_IOC_SETFLAG.patch index e992d201..a8c21845 100644 --- a/0022-linux-user-implement-FS_IOC_SETFLAG.patch +++ b/0022-linux-user-implement-FS_IOC_SETFLAG.patch @@ -1,4 +1,4 @@ -From ffffe724d94f4d993f67b00eeac74fbcaf65b999 Mon Sep 17 00:00:00 2001 +From e822cfa8fea3cddc331664ce2e7df20ed630d37b Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Mon, 20 Aug 2012 00:07:13 +0200 Subject: [PATCH] linux-user: implement FS_IOC_SETFLAGS ioctl diff --git a/0023-linux-user-XXX-disable-fiemap.patch b/0023-linux-user-XXX-disable-fiemap.patch index 0ca7d71c..9efa12c0 100644 --- a/0023-linux-user-XXX-disable-fiemap.patch +++ b/0023-linux-user-XXX-disable-fiemap.patch @@ -1,4 +1,4 @@ -From 363aa8ac52c31d064763920a3eaf2c27f04f65cd Mon Sep 17 00:00:00 2001 +From 691935bb8dcfdbb9c64af96d8ba7421000b7d648 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Tue, 21 Aug 2012 14:20:40 +0200 Subject: [PATCH] linux-user: XXX disable fiemap diff --git a/0024-slirp-nooutgoing.patch b/0024-slirp-nooutgoing.patch index a72c9bf5..5af438bb 100644 --- a/0024-slirp-nooutgoing.patch +++ b/0024-slirp-nooutgoing.patch @@ -1,4 +1,4 @@ -From 55e156e2925de8dd71fb4e651a4f277903f8eeff Mon Sep 17 00:00:00 2001 +From c4a739a0fdfae2c61b78ccfc3893298dc79e4f6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Wed, 29 Aug 2012 18:42:56 +0200 Subject: [PATCH] slirp: -nooutgoing diff --git a/0025-vnc-password-file-and-incoming-conn.patch b/0025-vnc-password-file-and-incoming-conn.patch index 136a08b1..29d2c2ca 100644 --- a/0025-vnc-password-file-and-incoming-conn.patch +++ b/0025-vnc-password-file-and-incoming-conn.patch @@ -1,4 +1,4 @@ -From 69edadde5ea7988979d8103de43984175de85036 Mon Sep 17 00:00:00 2001 +From d9fd5bb9acd60d2dd7f46eecf49899ae196bb199 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Wed, 29 Aug 2012 20:06:01 +0200 Subject: [PATCH] vnc: password-file= and incoming-connections= diff --git a/0026-linux-user-add-more-blk-ioctls.patch b/0026-linux-user-add-more-blk-ioctls.patch index 603812d0..e390ed9c 100644 --- a/0026-linux-user-add-more-blk-ioctls.patch +++ b/0026-linux-user-add-more-blk-ioctls.patch @@ -1,4 +1,4 @@ -From ece5c142ad3a6bd137177cab9d0561b8705cbf49 Mon Sep 17 00:00:00 2001 +From 45ebd4980cc8f842caa9d4e68ced2b4f134caaac Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Wed, 10 Oct 2012 10:21:20 +0200 Subject: [PATCH] linux-user: add more blk ioctls diff --git a/0027-linux-user-use-target_ulong.patch b/0027-linux-user-use-target_ulong.patch index e8470504..f0e4c0ec 100644 --- a/0027-linux-user-use-target_ulong.patch +++ b/0027-linux-user-use-target_ulong.patch @@ -1,4 +1,4 @@ -From 25ba7a723be4b235d7c4c41b6e48ffea2c0ef25d Mon Sep 17 00:00:00 2001 +From 1529d998a6e9858db8548628d16cff3ddbe2a080 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Tue, 9 Oct 2012 09:06:49 +0200 Subject: [PATCH] linux-user: use target_ulong diff --git a/0028-block-Add-support-for-DictZip-enabl.patch b/0028-block-Add-support-for-DictZip-enabl.patch index 915420c8..aba80b58 100644 --- a/0028-block-Add-support-for-DictZip-enabl.patch +++ b/0028-block-Add-support-for-DictZip-enabl.patch @@ -1,4 +1,4 @@ -From adab8f85bbe418699421998c60a401283f1a43c4 Mon Sep 17 00:00:00 2001 +From 0a3476a6138ce132a75f84c994c1b6ffdcc87354 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Wed, 5 Aug 2009 09:49:37 +0200 Subject: [PATCH] block: Add support for DictZip enabled gzip files diff --git a/0029-block-Add-tar-container-format.patch b/0029-block-Add-tar-container-format.patch index 10ad45d0..0137e212 100644 --- a/0029-block-Add-tar-container-format.patch +++ b/0029-block-Add-tar-container-format.patch @@ -1,4 +1,4 @@ -From 58fa4021b526f9f6cb9096ae7522967efd0a5c58 Mon Sep 17 00:00:00 2001 +From 0fdc9a7f05acb99c3c21f747a4d25419f03c80dd Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Wed, 5 Aug 2009 17:28:38 +0200 Subject: [PATCH] block: Add tar container format diff --git a/0030-Legacy-Patch-kvm-qemu-preXX-dictzip.patch b/0030-Legacy-Patch-kvm-qemu-preXX-dictzip.patch index a6ec36c3..f6d45ff3 100644 --- a/0030-Legacy-Patch-kvm-qemu-preXX-dictzip.patch +++ b/0030-Legacy-Patch-kvm-qemu-preXX-dictzip.patch @@ -1,4 +1,4 @@ -From 66bcadd009f3014de9680b5ee1df886360e47c62 Mon Sep 17 00:00:00 2001 +From eee446e6a362ab72bc97c90225ba6123f6d0ab3c Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Wed, 12 Dec 2012 19:11:30 +0100 Subject: [PATCH] Legacy Patch kvm-qemu-preXX-dictzip3.patch diff --git a/0031-Legacy-Patch-kvm-qemu-preXX-report-.patch b/0031-Legacy-Patch-kvm-qemu-preXX-report-.patch index 1cd3edd5..8766d4ce 100644 --- a/0031-Legacy-Patch-kvm-qemu-preXX-report-.patch +++ b/0031-Legacy-Patch-kvm-qemu-preXX-report-.patch @@ -1,4 +1,4 @@ -From 0645f99a723e9846deb7a978a1851115820ff480 Mon Sep 17 00:00:00 2001 +From c20addda112a82af598960724a0968904c1735fb Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Wed, 12 Dec 2012 19:11:31 +0100 Subject: [PATCH] Legacy Patch kvm-qemu-preXX-report-default-mac-used.patch diff --git a/0032-console-add-question-mark-escape-op.patch b/0032-console-add-question-mark-escape-op.patch index 0b8b81ad..bc9165ef 100644 --- a/0032-console-add-question-mark-escape-op.patch +++ b/0032-console-add-question-mark-escape-op.patch @@ -1,4 +1,4 @@ -From a4eee8efce8b672542930a014130c10167f7d6f3 Mon Sep 17 00:00:00 2001 +From e54695d614849c8760f8ccb0ed467a74fca7f741 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Mon, 6 Jun 2011 06:53:52 +0200 Subject: [PATCH] console: add question-mark escape operator diff --git a/0033-Make-char-muxer-more-robust-wrt-sma.patch b/0033-Make-char-muxer-more-robust-wrt-sma.patch index ef1773a6..0d590828 100644 --- a/0033-Make-char-muxer-more-robust-wrt-sma.patch +++ b/0033-Make-char-muxer-more-robust-wrt-sma.patch @@ -1,4 +1,4 @@ -From 96011c6d5236e738c7e6db5e15484f8c1001e479 Mon Sep 17 00:00:00 2001 +From fae838b94d08af3b2230d2cafcacbc3d2ac780e5 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Thu, 1 Apr 2010 17:36:23 +0200 Subject: [PATCH] Make char muxer more robust wrt small FIFOs diff --git a/0034-linux-user-lseek-explicitly-cast-no.patch b/0034-linux-user-lseek-explicitly-cast-no.patch index 825db81a..0a5bbde4 100644 --- a/0034-linux-user-lseek-explicitly-cast-no.patch +++ b/0034-linux-user-lseek-explicitly-cast-no.patch @@ -1,4 +1,4 @@ -From 19bca1521857daa9a02fb3e37de6060dce679584 Mon Sep 17 00:00:00 2001 +From cc47aef37004096cfe5788ce51d930543f614bbf Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Thu, 13 Dec 2012 14:29:22 +0100 Subject: [PATCH] linux-user: lseek: explicitly cast non-set offsets to signed diff --git a/0035-virtfs-proxy-helper-Provide-__u64-f.patch b/0035-virtfs-proxy-helper-Provide-__u64-f.patch index 5ac19e8a..c6f6ed68 100644 --- a/0035-virtfs-proxy-helper-Provide-__u64-f.patch +++ b/0035-virtfs-proxy-helper-Provide-__u64-f.patch @@ -1,4 +1,4 @@ -From 67a01021fc068d9c760cfde49d1188745f8e1916 Mon Sep 17 00:00:00 2001 +From ce5ea9682c42819ea21be30172208718ad890969 Mon Sep 17 00:00:00 2001 From: Bruce Rogers Date: Thu, 16 May 2013 12:39:10 +0200 Subject: [PATCH] virtfs-proxy-helper: Provide __u64 for broken diff --git a/0036-configure-Enable-PIE-for-ppc-and-pp.patch b/0036-configure-Enable-PIE-for-ppc-and-pp.patch index a3f3c660..6a1e60e8 100644 --- a/0036-configure-Enable-PIE-for-ppc-and-pp.patch +++ b/0036-configure-Enable-PIE-for-ppc-and-pp.patch @@ -1,4 +1,4 @@ -From 96a2686365ff1c4bbc93677c5e8a4a50fdabd2ee Mon Sep 17 00:00:00 2001 +From 2ad523fe3a4a65ef306e1f4ebbcd8d23bab9f75e Mon Sep 17 00:00:00 2001 From: Dinar Valeev Date: Wed, 2 Oct 2013 17:56:03 +0200 Subject: [PATCH] configure: Enable PIE for ppc and ppc64 hosts diff --git a/0037-tests-Don-t-run-qom-test-twice.patch b/0037-tests-Don-t-run-qom-test-twice.patch index 419a7f0f..cdc0efc5 100644 --- a/0037-tests-Don-t-run-qom-test-twice.patch +++ b/0037-tests-Don-t-run-qom-test-twice.patch @@ -1,4 +1,4 @@ -From 25a2deec354d3c42cbbddeba52473627ae509a8e Mon Sep 17 00:00:00 2001 +From 3d053835529bbdbdc9e05f9f4d6d6de87238f4e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Mon, 7 Apr 2014 16:03:08 +0200 Subject: [PATCH] tests: Don't run qom-test twice diff --git a/0038-qtest-Increase-socket-timeout.patch b/0038-qtest-Increase-socket-timeout.patch index ad7fa398..df596191 100644 --- a/0038-qtest-Increase-socket-timeout.patch +++ b/0038-qtest-Increase-socket-timeout.patch @@ -1,4 +1,4 @@ -From c2b7e9b2ae4903d633c23be9f76ed8cff7fec645 Mon Sep 17 00:00:00 2001 +From d3c34d8f618b8914920e0f7d3979912c335f5fff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Thu, 17 Apr 2014 18:39:10 +0200 Subject: [PATCH] qtest: Increase socket timeout diff --git a/0039-linux-user-Cast-validity-checks-on-.patch b/0039-linux-user-Cast-validity-checks-on-.patch new file mode 100644 index 00000000..a76f4122 --- /dev/null +++ b/0039-linux-user-Cast-validity-checks-on-.patch @@ -0,0 +1,58 @@ +From d9fc1799803a3783e0f764b0c9b7a336c8d3b893 Mon Sep 17 00:00:00 2001 +From: Alexander Graf +Date: Fri, 22 Aug 2014 11:28:52 +0200 +Subject: [PATCH] linux-user: Cast validity checks on g_posix_timers range + +We check whether the passed in counter value is negative on all calls +that involve g_posix_timers. However, we also check check for negativity +of that value after casting it - at which point it couldn't possibly be +negative anymore. + +Cast the check to int16_t. Maybe this is correct. Maybe the check should +get removed completely. + +Signed-off-by: Alexander Graf +--- + linux-user/syscall.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/linux-user/syscall.c b/linux-user/syscall.c +index 0b4668d..660095b 100644 +--- a/linux-user/syscall.c ++++ b/linux-user/syscall.c +@@ -9602,7 +9602,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_ulong arg1, + /* args: timer_t timerid, int flags, const struct itimerspec *new_value, + * struct itimerspec * old_value */ + arg1 &= 0xffff; +- if (arg3 == 0 || arg1 < 0 || arg1 >= ARRAY_SIZE(g_posix_timers)) { ++ if (arg3 == 0 || (int16_t)arg1 < 0 || arg1 >= ARRAY_SIZE(g_posix_timers)) { + ret = -TARGET_EINVAL; + } else { + timer_t htimer = g_posix_timers[arg1]; +@@ -9624,7 +9624,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_ulong arg1, + arg1 &= 0xffff; + if (!arg2) { + return -TARGET_EFAULT; +- } else if (arg1 < 0 || arg1 >= ARRAY_SIZE(g_posix_timers)) { ++ } else if ((int16_t)arg1 < 0 || arg1 >= ARRAY_SIZE(g_posix_timers)) { + ret = -TARGET_EINVAL; + } else { + timer_t htimer = g_posix_timers[arg1]; +@@ -9644,7 +9644,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_ulong arg1, + { + /* args: timer_t timerid */ + arg1 &= 0xffff; +- if (arg1 < 0 || arg1 >= ARRAY_SIZE(g_posix_timers)) { ++ if ((int16_t)arg1 < 0 || arg1 >= ARRAY_SIZE(g_posix_timers)) { + ret = -TARGET_EINVAL; + } else { + timer_t htimer = g_posix_timers[arg1]; +@@ -9659,7 +9659,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_ulong arg1, + { + /* args: timer_t timerid */ + arg1 &= 0xffff; +- if (arg1 < 0 || arg1 >= ARRAY_SIZE(g_posix_timers)) { ++ if ((int16_t)arg1 < 0 || arg1 >= ARRAY_SIZE(g_posix_timers)) { + ret = -TARGET_EINVAL; + } else { + timer_t htimer = g_posix_timers[arg1]; diff --git a/0040-linux-user-Convert-blkpg-to-use-a-s.patch b/0040-linux-user-Convert-blkpg-to-use-a-s.patch new file mode 100644 index 00000000..fccbe75c --- /dev/null +++ b/0040-linux-user-Convert-blkpg-to-use-a-s.patch @@ -0,0 +1,109 @@ +From 4b0131e7b071bb06802a99fcf9a3717215b2362b Mon Sep 17 00:00:00 2001 +From: Alexander Graf +Date: Fri, 22 Aug 2014 12:22:28 +0200 +Subject: [PATCH] linux-user: Convert blkpg to use a special subop handler + +The blkpg ioctl can take different payloads depending on the opcode in +its payload structure. Create a new special ioctl handler that can only +deal with partition style ones for now. + +Signed-off-by: Alexander Graf + +--- + +Andreas, if you like feel free to squash this into your patch and submit +it upstream. +--- + linux-user/ioctls.h | 3 ++- + linux-user/syscall.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++ + linux-user/syscall_types.h | 2 +- + 3 files changed, 56 insertions(+), 2 deletions(-) + +diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h +index 9b6cacb..8eb4446 100644 +--- a/linux-user/ioctls.h ++++ b/linux-user/ioctls.h +@@ -96,7 +96,8 @@ + IOCTL(BLKRAGET, IOC_R, MK_PTR(TYPE_LONG)) + IOCTL(BLKSSZGET, IOC_R, MK_PTR(TYPE_LONG)) + IOCTL(BLKBSZGET, IOC_R, MK_PTR(TYPE_INT)) +- IOCTL(BLKPG, IOC_W, MK_PTR(MK_STRUCT(STRUCT_blkpg_ioctl_arg))) ++ IOCTL_SPECIAL(BLKPG, IOC_W, do_ioctl_blkpg, ++ MK_PTR(MK_STRUCT(STRUCT_blkpg_ioctl_arg))) + #ifdef FIBMAP + IOCTL(FIBMAP, IOC_W | IOC_R, MK_PTR(TYPE_LONG)) + #endif +diff --git a/linux-user/syscall.c b/linux-user/syscall.c +index 660095b..04b5119 100644 +--- a/linux-user/syscall.c ++++ b/linux-user/syscall.c +@@ -3657,6 +3657,59 @@ out: + return ret; + } + ++static abi_long do_ioctl_blkpg(const IOCTLEntry *ie, uint8_t *buf_temp, int fd, ++ abi_long cmd, abi_long arg) ++{ ++ void *argptr; ++ int target_size; ++ const argtype *arg_type = ie->arg_type; ++ const argtype part_arg_type[] = { MK_STRUCT(STRUCT_blkpg_partition) }; ++ abi_long ret; ++ ++ struct blkpg_ioctl_arg *host_blkpg = (void*)buf_temp; ++ struct blkpg_partition host_part; ++ ++ /* Read and convert blkpg */ ++ arg_type++; ++ target_size = thunk_type_size(arg_type, 0); ++ argptr = lock_user(VERIFY_READ, arg, target_size, 1); ++ if (!argptr) { ++ ret = -TARGET_EFAULT; ++ goto out; ++ } ++ thunk_convert(buf_temp, argptr, arg_type, THUNK_HOST); ++ unlock_user(argptr, arg, 0); ++ ++ switch (host_blkpg->op) { ++ case BLKPG_ADD_PARTITION: ++ case BLKPG_DEL_PARTITION: ++ /* payload is struct blkpg_partition */ ++ break; ++ default: ++ /* Unknown opcode */ ++ ret = -TARGET_EINVAL; ++ goto out; ++ } ++ ++ /* Read and convert blkpg->data */ ++ arg = (abi_long)(uintptr_t)host_blkpg->data; ++ target_size = thunk_type_size(part_arg_type, 0); ++ argptr = lock_user(VERIFY_READ, arg, target_size, 1); ++ if (!argptr) { ++ ret = -TARGET_EFAULT; ++ goto out; ++ } ++ thunk_convert(&host_part, argptr, part_arg_type, THUNK_HOST); ++ unlock_user(argptr, arg, 0); ++ ++ /* Swizzle the data pointer to our local copy and call! */ ++ host_blkpg->data = &host_part; ++ ret = get_errno(ioctl(fd, ie->host_cmd, host_blkpg)); ++ ++out: ++ return ret; ++} ++ + static abi_long do_ioctl_rt(const IOCTLEntry *ie, uint8_t *buf_temp, + int fd, abi_long cmd, abi_long arg) + { +diff --git a/linux-user/syscall_types.h b/linux-user/syscall_types.h +index 56e344c..a730c87 100644 +--- a/linux-user/syscall_types.h ++++ b/linux-user/syscall_types.h +@@ -260,4 +260,4 @@ STRUCT(blkpg_ioctl_arg, + TYPE_INT, /* op */ + TYPE_INT, /* flags */ + TYPE_INT, /* datalen */ +- MK_PTR(MK_STRUCT(STRUCT_blkpg_partition))) /* data */ ++ TYPE_PTRVOID) /* data */ diff --git a/libcacard.changes b/libcacard.changes index d286838c..eb19615c 100644 --- a/libcacard.changes +++ b/libcacard.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Fri Aug 22 10:37:23 UTC 2014 - agraf@suse.com + +- Patch queue updated from git://github.com/openSUSE/qemu.git opensuse-2.1 +* Patches added: + 0039-linux-user-Cast-validity-checks-on-.patch + 0040-linux-user-Convert-blkpg-to-use-a-s.patch + ------------------------------------------------------------------- Thu Aug 21 16:14:37 UTC 2014 - afaerber@suse.de diff --git a/libcacard.spec b/libcacard.spec index e0966e87..6d2702cf 100644 --- a/libcacard.spec +++ b/libcacard.spec @@ -63,6 +63,8 @@ Patch0035: 0035-virtfs-proxy-helper-Provide-__u64-f.patch Patch0036: 0036-configure-Enable-PIE-for-ppc-and-pp.patch Patch0037: 0037-tests-Don-t-run-qom-test-twice.patch Patch0038: 0038-qtest-Increase-socket-timeout.patch +Patch0039: 0039-linux-user-Cast-validity-checks-on-.patch +Patch0040: 0040-linux-user-Convert-blkpg-to-use-a-s.patch # Please do not add patches manually here, run update_git.sh. # this is to make lint happy Source300: qemu-rpmlintrc @@ -160,6 +162,8 @@ This sub-package contains development files for the Smartcard library. %patch0036 -p1 %patch0037 -p1 %patch0038 -p1 +%patch0039 -p1 +%patch0040 -p1 %build ./configure --prefix=%_prefix --sysconfdir=%_sysconfdir \ diff --git a/qemu-linux-user.changes b/qemu-linux-user.changes index 4507acbb..07534243 100644 --- a/qemu-linux-user.changes +++ b/qemu-linux-user.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Fri Aug 22 10:37:03 UTC 2014 - agraf@suse.com + +- Patch queue updated from git://github.com/openSUSE/qemu.git opensuse-2.1 +* Patches added: + 0039-linux-user-Cast-validity-checks-on-.patch + 0040-linux-user-Convert-blkpg-to-use-a-s.patch +- Implement missing ioctl to fix parted properly + ------------------------------------------------------------------- Thu Aug 21 16:14:37 UTC 2014 - afaerber@suse.de diff --git a/qemu-linux-user.spec b/qemu-linux-user.spec index 5a10204b..aa9c4f82 100644 --- a/qemu-linux-user.spec +++ b/qemu-linux-user.spec @@ -63,6 +63,8 @@ Patch0035: 0035-virtfs-proxy-helper-Provide-__u64-f.patch Patch0036: 0036-configure-Enable-PIE-for-ppc-and-pp.patch Patch0037: 0037-tests-Don-t-run-qom-test-twice.patch Patch0038: 0038-qtest-Increase-socket-timeout.patch +Patch0039: 0039-linux-user-Cast-validity-checks-on-.patch +Patch0040: 0040-linux-user-Convert-blkpg-to-use-a-s.patch # Please do not add patches manually here, run update_git.sh. # this is to make lint happy Source300: qemu-rpmlintrc @@ -154,6 +156,8 @@ run cross-architecture builds. %patch0036 -p1 %patch0037 -p1 %patch0038 -p1 +%patch0039 -p1 +%patch0040 -p1 %build ./configure --prefix=%_prefix --sysconfdir=%_sysconfdir \ diff --git a/qemu.changes b/qemu.changes index 416536c3..e19c66fb 100644 --- a/qemu.changes +++ b/qemu.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Fri Aug 22 10:37:00 UTC 2014 - agraf@suse.com + +- Patch queue updated from git://github.com/openSUSE/qemu.git opensuse-2.1 +* Patches added: + 0039-linux-user-Cast-validity-checks-on-.patch + 0040-linux-user-Convert-blkpg-to-use-a-s.patch + ------------------------------------------------------------------- Thu Aug 21 16:14:37 UTC 2014 - afaerber@suse.de diff --git a/qemu.spec b/qemu.spec index bf1606df..bcdf3dec 100644 --- a/qemu.spec +++ b/qemu.spec @@ -93,6 +93,8 @@ Patch0035: 0035-virtfs-proxy-helper-Provide-__u64-f.patch Patch0036: 0036-configure-Enable-PIE-for-ppc-and-pp.patch Patch0037: 0037-tests-Don-t-run-qom-test-twice.patch Patch0038: 0038-qtest-Increase-socket-timeout.patch +Patch0039: 0039-linux-user-Cast-validity-checks-on-.patch +Patch0040: 0040-linux-user-Convert-blkpg-to-use-a-s.patch # Please do not add patches manually here, run update_git.sh. # this is to make lint happy @@ -495,6 +497,8 @@ This package provides a service file for starting and stopping KSM. %patch0036 -p1 %patch0037 -p1 %patch0038 -p1 +%patch0039 -p1 +%patch0040 -p1 %if %{build_x86_fw_from_source} # as a safeguard, delete the firmware files that we intend to build