293 Commits

Author SHA1 Message Date
openeuler-ci-bot
e65ee6ced4 !288 arm/cpu: Fixed function undefined error at compile time under arm
From: @zhouli57
Reviewed-by: @imxcc
Signed-off-by: @imxcc
2021-05-20 11:36:13 +08:00
zhouli57
69f71b8b94 arm/cpu: Fixed function undefined error at compile time under arm 2021-05-20 11:10:10 +08:00
openeuler-ci-bot
1369fa9a7f !285 为block-rbd, block-iscsi和block-ssh添加strip
From: @yangming73
Reviewed-by: @imxcc
Signed-off-by: @imxcc
2021-05-20 10:53:13 +08:00
Ming Yang
454f2844f7 Merge branch 'master' of gitee.com:src-openeuler/qemu into master 2021-05-20 10:08:04 +08:00
openeuler-ci-bot
68306567c3 !287 util/cacheinfo: fix crash when compiling with uClibc
From: @zhouli57
Reviewed-by: @imxcc
Signed-off-by: @imxcc
2021-05-20 09:08:00 +08:00
zhouli57
eefa614339 util/cacheinfo: fix crash when compiling with uClibc 2021-05-19 17:21:24 +08:00
Ming Yang
de95cacd5f add strip for block-iscsi.so, block-rbd.so and block-ssh.so.
Signed-off-by: Ming Yang <yangming73@huawei.com>
2021-05-19 09:11:35 +00:00
openeuler-ci-bot
289abf1b2b !242 Automatically generate code patches with openeuler !88
From: @kuhnchen18
Reviewed-by: @zhanghailiang_lucky,@zhanghailiang_lucky
Signed-off-by: @zhanghailiang_lucky,@zhanghailiang_lucky
2021-04-25 15:12:15 +08:00
Chen Qun
6f1aa31d5f spec: Update release version with !88
increase release verison by one

Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
2021-03-26 11:14:37 +08:00
Chen Qun
2562f7d6dc spec: Update patch and changelog with !88 fix CVE-2020-15469 #I1NJI5 !88
hw/pci-host: add pci-intack write method
pci-host: add pcie-msi read method
vfio: add quirk device write method
prep: add ppc-parity write method
nvram: add nrf51_soc flash read method
spapr_pci: add spapr msi read method
tz-ppc: add dummy read/write methods
imx7-ccm: add digprog mmio write method

Signed-off-by: Chen Qun<kuhn.chenqun@huawei.com>
2021-03-26 11:14:36 +08:00
Chen Qun
4820dec00a imx7-ccm: add digprog mmio write method
fix CVE-2020-15469

Add digprog mmio write method to avoid assert failure during
initialisation.

Reviewed-by: Li Qiang <liq3ea@gmail.com>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>

Signed-off-by: Jiajie Li <lijiajie11@huawei.com>
2021-03-26 11:14:36 +08:00
Chen Qun
c38364c2b7 tz-ppc: add dummy read/write methods
fix CVE-2020-15469

Add tz-ppc-dummy mmio read/write methods to avoid assert failure
during initialisation.

Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>

Signed-off-by: Jiajie Li <lijiajie11@huawei.com>
2021-03-26 11:14:36 +08:00
Chen Qun
15d7b2a4ea spapr_pci: add spapr msi read method
fix CVE-2020-15469

Add spapr msi mmio read method to avoid NULL pointer dereference
issue.

Reported-by: Lei Sun <slei.casper@gmail.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>

Signed-off-by: Jiajie Li <lijiajie11@huawei.com>
2021-03-26 11:14:36 +08:00
Chen Qun
47423175b7 nvram: add nrf51_soc flash read method
fix CVE-2020-15469

Add nrf51_soc mmio read method to avoid NULL pointer dereference
issue.

Reported-by: Lei Sun <slei.casper@gmail.com>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>

Signed-off-by: Jiajie Li <lijiajie11@huawei.com>
2021-03-26 11:14:36 +08:00
Chen Qun
1b0c5d2eeb prep: add ppc-parity write method
fix CVE-2020-15469

Add ppc-parity mmio write method to avoid NULL pointer dereference
issue.

Reported-by: Lei Sun <slei.casper@gmail.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>

Signed-off-by: Jiajie Li <lijiajie11@huawei.com>
2021-03-26 11:14:35 +08:00
Chen Qun
5b10ef9531 vfio: add quirk device write method 2021-03-26 11:14:35 +08:00
Chen Qun
bbb418cfa3 pci-host: add pcie-msi read method
fix CVE-2020-15469

Add pcie-msi mmio read method to avoid NULL pointer dereference
issue.

Reported-by: Lei Sun <slei.casper@gmail.com>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>

Signed-off-by: Jiajie Li <lijiajie11@huawei.com>
2021-03-26 11:14:35 +08:00
Chen Qun
873bc22ef8 hw/pci-host: add pci-intack write method
fix CVE-2020-15469

Add pci-intack mmio write method to avoid NULL pointer dereference
issue.

Reported-by: Lei Sun <slei.casper@gmail.com>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>

Signed-off-by: Jiajie Li <lijiajie11@huawei.com>
2021-03-26 11:14:35 +08:00
openeuler-ci-bot
a70f4c6edc !240 Automatically generate code patches with openeuler !87
From: @kuhnchen18
Reviewed-by: @yorifang
Signed-off-by: @yorifang
2021-03-18 22:06:57 +08:00
Chen Qun
1b4396dd9a spec: Update release version with !87
increase release verison by one

Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
2021-03-18 22:02:37 +08:00
Chen Qun
578e31cf55 spec: Update patch and changelog with !87 block: Add sanity check when setting retry parameters !87
block: Add sanity check when setting retry parameters

Signed-off-by: Chen Qun<kuhn.chenqun@huawei.com>
2021-03-18 22:02:14 +08:00
Chen Qun
27ab61041a block: Add sanity check when setting retry parameters
Add sanity check when setting retry parameters to avoid invalid retry
configuration.

Signed-off-by: Jiahui Cen <cenjiahui@huawei.com>
2021-03-18 22:02:14 +08:00
openeuler-ci-bot
3eee17c097 !234 【编译安全选项】使能strip
From: @lijiajie128
Reviewed-by: @fangying712,@cellfaint,@yorifang
Signed-off-by: @fangying712,@yorifang
2021-03-17 17:29:50 +08:00
Jiajie Li
1d77f79cd3 enable strip for qemu-block-rbd.so and qemu-block-ssh.so
Signed-off-by: Jiajie Li <lijiajie11@huawei.com>
2021-03-17 14:32:32 +08:00
openeuler-ci-bot
b3e241753e !232 Automatically generate code patches with openeuler !79 !81
From: @kuhnchen18
Reviewed-by: @yorifang
Signed-off-by: @yorifang
2021-03-12 17:50:15 +08:00
Chen Qun
b3c33c5447 spec: Update release version with !79 !81
increase release verison by one

Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
2021-03-12 16:45:12 +08:00
Chen Qun
6912ff6399 spec: Update patch and changelog with !81 fix CVE-2021-20203 #I3A34O !81
net: vmxnet3: validate configuration values during activate (CVE-2021-20203)

Signed-off-by: Chen Qun<kuhn.chenqun@huawei.com>
2021-03-12 16:45:10 +08:00
Chen Qun
7ebae099e1 net: vmxnet3: validate configuration values during activate (CVE-2021-20203)
fix CVE-2021-20203 #I3A34O

While activating device in vmxnet3_acticate_device(), it does not
validate guest supplied configuration values against predefined
minimum - maximum limits. This may lead to integer overflow or
OOB access issues. Add checks to avoid it.

Fixes: CVE-2021-20203
Buglink: https://bugs.launchpad.net/qemu/+bug/1913873
Reported-by: Gaoning Pan <pgn@zju.edu.cn>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>

Signed-off-by: Jiajie Li <lijiajie11@huawei.com>
2021-03-12 16:45:10 +08:00
Chen Qun
5bde19b297 spec: Update patch and changelog with !79 migration: backport migration/tls patches from upstream !79
migration: fix memory leak in qmp_migrate_set_parameters
migration/tls: fix inverted semantics in multifd_channel_connect
migration/tls: add error handling in multifd_tls_handshake_thread

Signed-off-by: Chen Qun<kuhn.chenqun@huawei.com>
2021-03-12 16:45:08 +08:00
Chen Qun
4f9d9614f3 migration/tls: add error handling in multifd_tls_handshake_thread
If any error happens during multifd send thread creating (e.g. channel broke
because new domain is destroyed by the dst), multifd_tls_handshake_thread
may exit silently, leaving main migration thread hanging (ram_save_setup ->
multifd_send_sync_main -> qemu_sem_wait(&p->sem_sync)).
Fix that by adding error handling in multifd_tls_handshake_thread.

Signed-off-by: Hao Wang <wanghao232@huawei.com>
2021-03-12 16:45:08 +08:00
Chen Qun
b88f4ba8f2 migration/tls: fix inverted semantics in multifd_channel_connect
Function multifd_channel_connect() return "true" to indicate failure,
which is rather confusing. Fix that.

Signed-off-by: Hao Wang <wanghao232@huawei.com>
2021-03-12 16:45:08 +08:00
Chen Qun
7f86d5a4c2 migration: fix memory leak in qmp_migrate_set_parameters
"tmp.tls_hostname" and "tmp.tls_creds" allocated by migrate_params_test_apply()
is forgot to free at the end of qmp_migrate_set_parameters(). Fix that.

The leak stack:
Direct leak of 2 byte(s) in 2 object(s) allocated from:
   #0 0xffffb597c20b in __interceptor_malloc (/usr/lib64/libasan.so.4+0xd320b)
   #1 0xffffb52dcb1b in g_malloc (/usr/lib64/libglib-2.0.so.0+0x58b1b)
   #2 0xffffb52f8143 in g_strdup (/usr/lib64/libglib-2.0.so.0+0x74143)
   #3 0xaaaac52447fb in migrate_params_test_apply (/usr/src/debug/qemu-4.1.0/migration/migration.c:1377)
   #4 0xaaaac52fdca7 in qmp_migrate_set_parameters (/usr/src/debug/qemu-4.1.0/qapi/qapi-commands-migration.c:192)
   #5 0xaaaac551d543 in qmp_dispatch (/usr/src/debug/qemu-4.1.0/qapi/qmp-dispatch.c:165)
   #6 0xaaaac52a0a8f in qmp_dispatch (/usr/src/debug/qemu-4.1.0/monitor/qmp.c:125)
   #7 0xaaaac52a1c7f in monitor_qmp_dispatch (/usr/src/debug/qemu-4.1.0/monitor/qmp.c:214)
   #8 0xaaaac55cb0cf in aio_bh_call (/usr/src/debug/qemu-4.1.0/util/async.c:117)
   #9 0xaaaac55d4543 in aio_bh_poll (/usr/src/debug/qemu-4.1.0/util/aio-posix.c:459)
   #10 0xaaaac55cae0f in aio_dispatch (/usr/src/debug/qemu-4.1.0/util/async.c:268)
   #11 0xffffb52d6a7b in g_main_context_dispatch (/usr/lib64/libglib-2.0.so.0+0x52a7b)
   #12 0xaaaac55d1e3b(/usr/bin/qemu-kvm-4.1.0+0x1622e3b)
   #13 0xaaaac4e314bb(/usr/bin/qemu-kvm-4.1.0+0xe824bb)
   #14 0xaaaac47f45ef(/usr/bin/qemu-kvm-4.1.0+0x8455ef)
   #15 0xffffb4bfef3f in __libc_start_main (/usr/lib64/libc.so.6+0x23f3f)
   #16 0xaaaac47ffacb(/usr/bin/qemu-kvm-4.1.0+0x850acb)

Direct leak of 2 byte(s) in 2 object(s) allocated from:
   #0 0xffffb597c20b in __interceptor_malloc (/usr/lib64/libasan.so.4+0xd320b)
   #1 0xffffb52dcb1b in g_malloc (/usr/lib64/libglib-2.0.so.0+0x58b1b)
   #2 0xffffb52f8143 in g_strdup (/usr/lib64/libglib-2.0.so.0+0x74143)
   #3 0xaaaac5244893 in migrate_params_test_apply (/usr/src/debug/qemu-4.1.0/migration/migration.c:1382)
   #4 0xaaaac52fdca7 in qmp_migrate_set_parameters (/usr/src/debug/qemu-4.1.0/qapi/qapi-commands-migration.c:192)
   #5 0xaaaac551d543 in qmp_dispatch (/usr/src/debug/qemu-4.1.0/qapi/qmp-dispatch.c)
   #6 0xaaaac52a0a8f in qmp_dispatch (/usr/src/debug/qemu-4.1.0/monitor/qmp.c:125)
   #7 0xaaaac52a1c7f in monitor_qmp_dispatch (/usr/src/debug/qemu-4.1.0/monitor/qmp.c:214)
   #8 0xaaaac55cb0cf in aio_bh_call (/usr/src/debug/qemu-4.1.0/util/async.c:117)
   #9 0xaaaac55d4543 in aio_bh_poll (/usr/src/debug/qemu-4.1.0/util/aio-posix.c:459)
   #10 0xaaaac55cae0f in in aio_dispatch (/usr/src/debug/qemu-4.1.0/util/async.c:268)
   #11 0xffffb52d6a7b in g_main_context_dispatch (/usr/lib64/libglib-2.0.so.0+0x52a7b)
   #12 0xaaaac55d1e3b(/usr/bin/qemu-kvm-4.1.0+0x1622e3b)
   #13 0xaaaac4e314bb(/usr/bin/qemu-kvm-4.1.0+0xe824bb)
   #14 0xaaaac47f45ef (/usr/bin/qemu-kvm-4.1.0+0x8455ef)
   #15 0xffffb4bfef3f in __libc_start_main (/usr/lib64/libc.so.6+0x23f3f)
   #16 0xaaaac47ffacb(/usr/bin/qemu-kvm-4.1.0+0x850acb)

Signed-off-by: Chuan Zheng <zhengchuan@huawei.com>
Reviewed-by: KeQian Zhu <zhukeqian1@huawei.com>
Reviewed-by: HaiLiang <zhang.zhanghailiang@huawei.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
2021-03-12 16:45:08 +08:00
openeuler-ci-bot
229c12efa6 !229 add iscsi rpm package requirement
From: @lijiajie128
Reviewed-by: @yorifang
Signed-off-by: @yorifang
2021-03-12 15:49:11 +08:00
Jiajie Li
c29fbf0083 add iscsi rpm package requirement 2021-03-11 21:10:41 +08:00
openeuler-ci-bot
30a9da64ef !220 [bugfix] iscsi: make iscsi rpm package
From: @lijiajie128
Reviewed-by: @yorifang
Signed-off-by: @yorifang
2021-03-10 16:39:06 +08:00
Jiajie Li
d82535f081 iscsi: make iscsi rpm package
Signed-off-by: Jiajie Li <lijiajie11@huawei.com>
2021-03-10 15:15:45 +08:00
openeuler-ci-bot
22d951e1e6 !214 qemu spec: configure for zstd
From: @lijiajie128
Reviewed-by: @yorifang
Signed-off-by: @yorifang
2021-03-04 09:18:37 +08:00
Jiajie Li
482b3d0cc3 qemu spec: add --enable-zstd to configure parameter
Signed-off-by: Jiajie Li <lijiajie11@huawei.com>
2021-03-03 14:47:59 +08:00
openeuler-ci-bot
5ad95274c0 !206 Automatically generate code patches with openeuler !77 !78
From: @zhendongchen
Reviewed-by: @yorifang,@yorifang
Signed-off-by: @yorifang,@yorifang
2021-02-27 14:53:20 +08:00
Euler Robot
6dd6890812 spec: Update release version with !77 !78
increase release verison by one

Signed-off-by: Euler Robot <euler.robot@huawei.com>
2021-02-26 16:28:21 +08:00
Euler Robot
f8f7dd42e8 spec: Update patch and changelog with !78
block-backend: Stop retrying when draining

Signed-off-by: Alex Chen <alex.chen@huawei.com>
2021-02-26 16:27:55 +08:00
Huawei Technologies Co., Ltd
5f96f6bac3 block-backend: Stop retrying when draining
Retrying failed requests when draining would make the draining hung. So it
is better not to trigger the retry timer when draining. And after the
virtual devices go back to work, they would retry those queued requests.

Signed-off-by: Jiahui Cen <cenjiahui@huawei.com>
Signed-off-by: Ying Fang <fangying1@huawei.com>
2021-02-26 16:27:55 +08:00
Euler Robot
f8b7dd549d spec: Update patch and changelog with !77
ide:atapi: check io_buffer_index in ide_atapi_cmd_reply_end

Signed-off-by: Alex Chen <alex.chen@huawei.com>
2021-02-26 16:27:53 +08:00
Huawei Technologies Co., Ltd
42a23f0a2f ide:atapi: check io_buffer_index in ide_atapi_cmd_reply_end
Fix CVE-2020-29443

During data transfer via packet command in 'ide_atapi_cmd_reply_end'
's->io_buffer_index' could exceed the 's->io_buffer' length, leading
to OOB access issue. Add check to avoid it.
 ...
 #9  ahci_pio_transfer ../hw/ide/ahci.c:1383
 #10 ide_transfer_start_norecurse ../hw/ide/core.c:553
 #11 ide_atapi_cmd_reply_end ../hw/ide/atapi.c:284
 #12 ide_atapi_cmd_read_pio ../hw/ide/atapi.c:329
 #13 ide_atapi_cmd_read ../hw/ide/atapi.c:442
 #14 cmd_read ../hw/ide/atapi.c:988
 #15 ide_atapi_cmd ../hw/ide/atapi.c:1352
 #16 ide_transfer_start ../hw/ide/core.c:561
 #17 cmd_packet ../hw/ide/core.c:1729
 #18 ide_exec_cmd ../hw/ide/core.c:2107
 #19 handle_reg_h2d_fis ../hw/ide/ahci.c:1267
 #20 handle_cmd ../hw/ide/ahci.c:1318
 #21 check_cmd ../hw/ide/ahci.c:592
 #22 ahci_port_write ../hw/ide/ahci.c:373
 #23 ahci_mem_write ../hw/ide/ahci.c:513

Reported-by: Wenxiang Qian <leonwxqian@gmail.com>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>

Signed-off-by: Jiajie Li <lijiajie11@huawei.com>
2021-02-26 16:27:53 +08:00
openeuler-ci-bot
84aba4188b !204 Automatically generate code patches with openeuler !71
From: @zhendongchen
Reviewed-by: @yorifang
Signed-off-by: @yorifang
2021-02-24 15:22:20 +08:00
Euler Robot
cfccf26734 spec: Update release version with !71
increase release verison by one

Signed-off-by: Euler Robot <euler.robot@huawei.com>
2021-02-19 21:28:48 +08:00
Euler Robot
e76de305cc spec: Update patch and changelog with !71
ati: use vga_read_byte in ati_cursor_define
sd: sdhci: assert data_count is within fifo_buffer
msix: add valid.accepts methods to check address

Signed-off-by: Alex Chen <alex.chen@huawei.com>
2021-02-19 21:27:56 +08:00
Huawei Technologies Co., Ltd
bd0d09f113 msix: add valid.accepts methods to check address
Fix CVE-2020-13754

While doing msi-x mmio operations, a guest may send an address
that leads to an OOB access issue. Add valid.accepts methods to
ensure that ensuing mmio r/w operation don't go beyond regions.

Reported-by: Ren Ding <rding@gatech.edu>
Reported-by: Hanqing Zhao <hanqing@gatech.edu>
Reported-by: Anatoly Trosinenko <anatoly.trosinenko@gmail.com>
Reported-by: Alexander Bulekov <alxndr@bu.edu>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>

patch link: https://lists.gnu.org/archive/html/qemu-devel/2020-06/msg00004.html
Signed-off-by: Jiajie Li <lijiajie11@huawei.com>
2021-02-19 21:27:56 +08:00
Huawei Technologies Co., Ltd
03ac057064 sd: sdhci: assert data_count is within fifo_buffer
Fix CVE-2020-17380

While doing multi block SDMA, transfer block size may exceed
the 's->fifo_buffer[s->buf_maxsz]' size. It may leave the
current element pointer 's->data_count' pointing out of bounds.
Leading the subsequent DMA r/w operation to OOB access issue.
Assert that 's->data_count' is within fifo_buffer.

 -> https://ruhr-uni-bochum.sciebo.de/s/NNWP2GfwzYKeKwE?path=%2Fsdhci_oob_write1
 ==1459837==ERROR: AddressSanitizer: heap-buffer-overflow
 WRITE of size 54722048 at 0x61500001e280 thread T3
 #0  __interceptor_memcpy (/lib64/libasan.so.6+0x3a71d)
 #1  flatview_read_continue ../exec.c:3245
 #2  flatview_read ../exec.c:3278
 #3  address_space_read_full ../exec.c:3291
 #4  address_space_rw ../exec.c:3319
 #5  dma_memory_rw_relaxed ../include/sysemu/dma.h:87
 #6  dma_memory_rw ../include/sysemu/dma.h:110
 #7  dma_memory_read ../include/sysemu/dma.h:116
 #8  sdhci_sdma_transfer_multi_blocks ../hw/sd/sdhci.c:629
 #9  sdhci_write ../hw/sd/sdhci.c:1097
 #10 memory_region_write_accessor ../softmmu/memory.c:483
 ...

Reported-by: Ruhr-University <bugs-syssec@rub.de>
Suggested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>

patch link: https://lists.nongnu.org/archive/html/qemu-devel/2020-09/msg01175.html
Signed-off-by: Jiajie Li <lijiajie11@hw.com>
2021-02-19 21:27:56 +08:00
Huawei Technologies Co., Ltd
ecc2505f20 ati: use vga_read_byte in ati_cursor_define
fix CVE-2019-20808

This makes sure reads are confined to vga video memory.

v3: use uint32_t, fix cut+paste bug.
v2: fix ati_cursor_draw_line too.

Reported-by: xu hang <flier_m@outlook.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20190917111441.27405-3-kraxel@redhat.com

cherry-pick from aab0e2a661b2b6bf7915c0aefe807fb60d6d9d13
Signed-off-by: Jiajie Li <lijiajie11@huawei.com>
2021-02-19 21:27:56 +08:00