142 Commits

Author SHA1 Message Date
Huawei Technologies Co., Ltd
1249fe43dc ati: check x y display parameter values
fix CVE-2020-24352

The source and destination x,y display parameters in ati_2d_blt()
may run off the vga limits if either of s->regs.[src|dst]_[xy] is
zero. Check the parameter values to avoid potential crash.

Reported-by: Gaoning Pan <pgn@zju.edu.cn>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Message-id: 20201021103818.1704030-1-ppandit@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

cherry-pick from commit ca1f9cbfdce4d63b10d57de80fef89a89d92a540
Signed-off-by: Jiajie Li <lijiajie11@huawei.com>
2020-11-23 16:27:15 +08:00
openeuler-ci-bot
ecfd21bd36 !142 Automatically generate code patches with openeuler
From: @zhendongchen
Reviewed-by: @yorifang
Signed-off-by: @yorifang
2020-11-23 14:32:56 +08:00
Euler Robot
21531c8c02 spec: Update release version with !30
increase release verison by one

Signed-off-by: Euler Robot <euler.robot@huawei.com>
2020-11-20 16:28:05 +08:00
Euler Robot
c32dae5a38 spec: Update patch and changelog with !30
elf2dmp: Fix memory leak on main() error paths
io: Don't use '#' flag of printf format
hw/display/omap_lcdc: Fix potential NULL pointer dereference
hw/display/exynos4210_fimd: Fix potential NULL pointer dereference
block/vvfat: Fix bad printf format specifiers
block: Remove unused include
ssi: Fix bad printf format specifiers
net/l2tpv3: Remove redundant check in net_init_l2tpv3()

Signed-off-by: Alex Chen <alex.chen@huawei.com>
2020-11-20 16:28:04 +08:00
Huawei Technologies Co., Ltd
28615f5ab2 net/l2tpv3: Remove redundant check in net_init_l2tpv3()
The result has been checked to be NULL before, it cannot be NULL here,
so the check is redundant. Remove it.

Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: AlexChen <alex.chen@huawei.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
(cherry-picked from commit d949fe64b0)
2020-11-20 16:28:04 +08:00
Huawei Technologies Co., Ltd
2b74e42641 ssi: Fix bad printf format specifiers
We should use printf format specifier "%u" instead of "%d" for
argument of type "unsigned int".

Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Alex Chen <alex.chen@huawei.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-id: 5FA280F5.8060902@huawei.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
(cherry-picked from commit 9df0a97298)
2020-11-20 16:28:04 +08:00
Huawei Technologies Co., Ltd
42d6b4a6de block: Remove unused include
The "qemu-common.h" include is not used, remove it.

Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: AlexChen <alex.chen@huawei.com>
Message-Id: <5F8FFB94.3030209@huawei.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
(cherry-picked from commit 3d86af858e)
2020-11-20 16:28:04 +08:00
Huawei Technologies Co., Ltd
ac70245e9a block/vvfat: Fix bad printf format specifiers
We should use printf format specifier "%u" instead of "%d" for
argument of type "unsigned int".
In addition, fix two error format problems found by checkpatch.pl:
ERROR: space required after that ',' (ctx:VxV)
+        fprintf(stderr,"%s attributes=0x%02x begin=%u size=%d\n",
                       ^
ERROR: line over 90 characters
+        fprintf(stderr, "%d, %s (%u, %d)\n", i, commit->path ? commit->path : "(null)", commit->param.rename.cluster, commit->action);

Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Alex Chen <alex.chen@huawei.com>
Message-Id: <5FA12620.6030705@huawei.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry-picked from commit c9eb2f3e38)
2020-11-20 16:28:04 +08:00
Huawei Technologies Co., Ltd
cbb8d83bb9 hw/display/exynos4210_fimd: Fix potential NULL pointer dereference
In exynos4210_fimd_update(), the pointer s is dereferinced before
being check if it is valid, which may lead to NULL pointer dereference.
So move the assignment to global_width after checking that the s is valid.

Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Alex Chen <alex.chen@huawei.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 5F9F8D88.9030102@huawei.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
(cherry-picked from commit 18520fa465)
2020-11-20 16:28:04 +08:00
Huawei Technologies Co., Ltd
c108e11514 hw/display/omap_lcdc: Fix potential NULL pointer dereference
In omap_lcd_interrupts(), the pointer omap_lcd is dereferinced before
being check if it is valid, which may lead to NULL pointer dereference.
So move the assignment to surface after checking that the omap_lcd is valid
and move surface_bits_per_pixel(surface) to after the surface assignment.

Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: AlexChen <alex.chen@huawei.com>
Message-id: 5F9CDB8A.9000001@huawei.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
(cherry-picked from commit 0080edc45e)
2020-11-20 16:28:04 +08:00
Huawei Technologies Co., Ltd
f30e5c656f io: Don't use '#' flag of printf format
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: AlexChen <alex.chen@huawei.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry-picked from commit 77b7829e75)
2020-11-20 16:28:04 +08:00
Huawei Technologies Co., Ltd
b0cbdcfbff elf2dmp: Fix memory leak on main() error paths
The 'kdgb' is allocating memory in get_kdbg(), but it is not freed
in both fill_header() and fill_context() failed branches, fix it.

Signed-off-by: AlexChen <alex.chen@huawei.com>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Reviewed-by: Viktor Prutyanov <viktor.prutyanov@phystech.edu>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <5F463659.8080101@huawei.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
(cherry-picked from commit 885538fdc9)
2020-11-20 16:28:04 +08:00
openeuler-ci-bot
af3cd7197f !138 Automatically generate code patches with openeuler
From: @zhendongchen
Reviewed-by: @yorifang
Signed-off-by: @yorifang
2020-10-22 16:33:22 +08:00
Euler Robot
bb6ba0d2ee spec: Update release version with !24
increase release verison by one

Signed-off-by: Euler Robot <euler.robot@huawei.com>
2020-10-22 16:29:48 +08:00
Euler Robot
7dafe6b03d spec: Update patch and changelog with !24
pci: check bus pointer before dereference
hw/ide: check null block before _cancel_dma_sync

Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
2020-10-22 16:29:39 +08:00
Prasad J Pandit
304d5426c4 hw/ide: check null block before _cancel_dma_sync
fix CVE-2020-25743

patch link: https://lists.nongnu.org/archive/html/qemu-devel/2020-09/msg05967.html

When canceling an i/o operation via ide_cancel_dam_sync(),
a block pointer may be null. Add check to avoid null pointer
dereference.

 -> https://ruhr-uni-bochum.sciebo.de/s/NNWP2GfwzYKeKwE?path=%2Fide_nullptr1
 ==1803100==Hint: address points to the zero page.
 #0 blk_bs ../block/block-backend.c:714
 #1 blk_drain ../block/block-backend.c:1715
 #2 ide_cancel_dma_sync ../hw/ide/core.c:723
 #3 bmdma_cmd_writeb ../hw/ide/core.c:723
 #4 bmdma_write ../hw/ide/pci.c:298
 #5 memory_region_write_accessor ../softmmu/memory.c:483
 #6 access_with_adjusted_size ../softmmu/memory.c:544
 #7 memory_region_dispatch_write ../softmmu/memory.c:1465
 #8 flatview_write_continue ../exe.c:3176
 ...

Reported-by: Ruhr-University <bugs-syssec@rub.de>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
2020-10-22 16:29:39 +08:00
Prasad J Pandit
9daa72fa9d pci: check bus pointer before dereference
fix CVE-2020-25742

patch link: https://lists.nongnu.org/archive/html/qemu-devel/2020-09/msg05294.html

While mapping IRQ level in pci_change_irq_level() routine,
it does not check if pci_get_bus() returned a valid pointer.
It may lead to a NULL pointer dereference issue. Add check to
avoid it.

  -> https://ruhr-uni-bochum.sciebo.de/s/NNWP2GfwzYKeKwE?path=%2Flsi_nullptr1
     ==1183858==Hint: address points to the zero page.
     #0 pci_change_irq_level hw/pci/pci.c:259
     #1 pci_irq_handler hw/pci/pci.c:1445
     #2 pci_set_irq hw/pci/pci.c:1463
     #3 lsi_set_irq hw/scsi/lsi53c895a.c:488
     #4 lsi_update_irq hw/scsi/lsi53c895a.c:523
     #5 lsi_script_scsi_interrupt hw/scsi/lsi53c895a.c:554
     #6 lsi_execute_script hw/scsi/lsi53c895a.c:1149
     #7 lsi_reg_writeb hw/scsi/lsi53c895a.c:1984
     #8 lsi_io_write hw/scsi/lsi53c895a.c:2146
     ...

Reported-by: Ruhr-University <bugs-syssec@rub.de>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
2020-10-22 16:29:39 +08:00
openeuler-ci-bot
d6857d428f !133 fix CVE-2020-12829 CVE-2020-15863 and CVE-2020-16092
From: @yorifang
Reviewed-by: @zhanghailiang_lucky
Signed-off-by: @zhanghailiang_lucky
2020-09-28 21:08:39 +08:00
Ying Fang
46ca686596 spec: Update release version
increase release version by one.

Signed-off-by: Ying Fang <fangying1@huawei.com>
2020-09-28 15:29:50 +08:00
Ying Fang
28a1ac608d CVE: fix CVE-2020-12829 CVE-2020-15863 and CVE-2020-16092
sm501: Replace hand written implementation with pixman where possible
sm501: Clean up local variables in sm501_2d_operation
sm501: Use BIT(x) macro to shorten constant
sm501: Shorten long variable names in sm501_2d_operation
sm501: Convert printf + abort to qemu_log_mask
hw/net/net_tx_pkt: fix assertion failure in net_tx_pkt_add_raw_fragment()
hw/net/xgmac: Fix buffer overflow in xgmac_enet_send()

Signed-off-by: Ying Fang <fangying1@huawei.com>
2020-09-28 11:54:21 +08:00
openeuler-ci-bot
eaae1c8ecf !124 fix CVE-2020-25085 CVE-2020-25084
From: @lijiajie128
Reviewed-by: @yorifang
Signed-off-by: @yorifang
2020-09-21 16:16:30 +08:00
Jiajie Li
372c6f4847 fix CVE-2020-25085 & CVE-2020-25084
Signed-off-by: Jiajie Li <lijiajie11@huawei.com>
2020-09-18 14:43:13 +08:00
openeuler-ci-bot
cd7a9e26d3 !114 fix slirp/src/ip6_input.c:networking out-of-bounds read information disclosure vulnerability
From: @lijiajie128
Reviewed-by: @yorifang
Signed-off-by: @yorifang
2020-09-11 14:12:05 +08:00
Jiajie Li
a765ea466d Drop bogus IPv6 messages
Drop IPv6 message shorter than what's mentioned in the payload
  length header (+ the size of the IPv6 header). They're invalid and could
  lead to data leakage in icmp6_send_echoreply().
2020-09-11 11:38:56 +08:00
openeuler-ci-bot
486f9ba588 !93 target/arm: ignore evtstrm and cpuid CPU features
Merge pull request !93 from PengLiang/master
2020-09-09 11:37:40 +08:00
Peng Liang
6cc24b9880 target/arm: ignore evtstrm and cpuid CPU features
evtstrm and cpuid cann't be controlled by VMM:
1. evtstrm: The generic timer is configured to generate events at a
   frequency of approximately 100KHz.  It's controlled by the linux
   kernel config CONFIG_ARM_ARCH_TIMER_EVTSTREAM.
2. cpuid: EL0 access to certain ID registers is available.  It's always
   set by linux kernel after 77c97b4ee2129 ("arm64: cpufeature: Expose
   CPUID registers by emulation").
However, they are exposed by getauxval() and /proc/cpuinfo.  Hence,
let's report and ignore the CPU features if someone set them.

Signed-off-by: Peng Liang <liangpeng10@huawei.com>
2020-09-08 23:27:33 +08:00
openeuler-ci-bot
c30ab88d28 !85 fix hw/usb/core.c fix buffer overflow in do_token_setup() function
Merge pull request !85 from lijiajie128/fix-usb
2020-08-26 15:30:53 +08:00
lijiajie128
27947f2b8c Merge branch 'master' of gitee.com:src-openeuler/qemu into fix-usb 2020-08-26 09:30:12 +08:00
openeuler-ci-bot
265c03cadc !84 [feature] Support disable/enable CPU features for AArch64
Merge pull request !84 from PengLiang/master
2020-08-24 20:07:19 +08:00
lijiajie
6665dac3a5 update qemu.spec with Release num Increace one 2020-08-24 16:34:15 +08:00
lijiajie
b9478104d1 update qemu.spec with hw-usb-core-fixe-buffer-overflow.patch 2020-08-21 10:46:04 +08:00
Jiajie Li
0a067ff27f hw/usb: Fix buffer overflow in do_token_setup
Store calculated setup_len in a local variable, verify it, and only
write it to the struct (USBDevice->setup_len) in case it passed the
sanity checks.

This prevent other code (do_token_{in,out} functions specifically)
from working with invalid USBDevice->setup_len values and overruning
the USBDevice->setup_buf[] buffer.
Fixes: CVE-2020-14364
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-08-21 10:38:05 +08:00
Peng Liang
29b03965de Support disable/enable CPU features for AArch64
QEMU does not support disable/enable CPU features in AArch64 for now.
This patch series add support for CPU features in AArch64.

Firstly, we change the isar struct in ARMCPU to an array for
convenience.  Secondly, we add support to configure CPU feautres in
AArch64 and make sure that the ID registers can be synchronized to KVM
so that guest can read the value we configure.  Thirdly, we add a
mechanism to solve the dependency relationship of some CPU features.
Last, we add a KVM_CAP_ARM_CPU_FEATURE to check whether KVM supports to
set CPU features in AArch64.

Also export CPU features to the result of qmp query-cpu-model-expansion
so that libvirt can get the supported CPU features.

Update the ID fields to ARMv8.6 and add some CPU features according to
the new ID fields.

With related KVM patch set[1], we can disable/enable CPU features in
AArch64.

[1] https://patchwork.kernel.org/cover/11711693/

Signed-off-by: Peng Liang <liangpeng10@huawei.com>
2020-08-19 12:44:30 +08:00
Peng Liang
0c39e725b0 target/arm: backport upstream patches to support CPU feature
To support CPU feature in AArch64, we need to move some field from
ARMCPU to ARMISARegisters, add more definitions of ID fields, and add
suport query-cpu-model-expansion qmp command.  Let's backport upstream
patches to do these.

Signed-off-by: Peng Liang <liangpeng10@huawei.com>
2020-08-19 12:36:09 +08:00
openeuler-ci-bot
c112ba0442 !78 build smt processor structure to support smt topology
Merge pull request !78 from fanhenglong/master
2020-08-19 08:48:19 +08:00
Henglong Fan
b391c6d2f4 build smt processor structure to support smt topology
if vcpu support smt, create new smt hierarchy according to
Processor Properties Topology Table(PPTT) in acpi spec 6.3.
Threads sharing a core must be grouped under a unique Processor
hierarchy node structure for each group of threads

Signed-off-by: Henglong Fan <fanhenglong@huawei.com>
2020-08-18 22:00:58 +08:00
openeuler-ci-bot
d95a35c2e0 !77 Aarch64 support vtpm
Merge pull request !77 from JackJF/master
2020-08-17 18:30:49 +08:00
jiangfangjie
54e09b7986 aarch64 support vtpm
Signed-off-by: jiangfangjie <jiangfangjie@huawei.com>
2020-08-13 13:11:02 -04:00
openeuler-ci-bot
4b2cfa2a18 !73 hw/arm/acpi: enable SHPC native hot plug
Merge pull request !73 from 金泽宇/master
2020-08-13 09:35:24 +08:00
Zeyu Jin
6b320d5441 hw/arm/acpi: enable SHPC native hot plug
backport from upstream:
https://git.qemu.org/?p=qemu.git;a=commit;h=e04c13cdcf5befd9d08df38d4d34494a802cdf63

Signed-off-by: Zeyu Jin <jinzeyu@huawei.com>
2020-08-12 14:10:17 +08:00
openeuler-ci-bot
28beefab32 !64 [bugfix] pick several patches from upstream that fix CVE
Merge pull request !64 from zhanghailiang/master
2020-08-06 19:59:17 +08:00
zhanghailiang
bac79dd0c6 qemu: pick serveral patches from upstream that fix CVE
Fix CVE-2020-13361, CVE-2020-13659, CVE-2020-13800, CVE-2020-13362

Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
2020-08-06 17:17:08 +08:00
openeuler-ci-bot
213ba4bb5a !62 Enable werror for qemu and fix a building warning
Merge pull request !62 from FangYing/master
2020-08-06 14:51:01 +08:00
Ying Fang
88bcb3346d spec: Update release version
increase release version by one

Signed-off-by: Ying Fang <fangying1@huawei.com>
2020-08-06 14:23:58 +08:00
Ying Fang
a138fa6057 spec: enable Werror by default
enable Werror by default so that we can check compilation warnnings

Signed-off-by: Ying Fang <fangying1@huawei.com>
2020-08-06 14:23:22 +08:00
Ying Fang
dc93470dc0 migration: add missing ram.h for migration/socket.c
ram.h is missing for migration/socket.c, let's add it.
Later we will enable werror for qemu.spec

Signed-off-by: Ying Fang <fangying1@huawei.com>
2020-08-06 11:13:53 +08:00
Ying Fang
d5b31b6bcb tests: Disalbe filemonitor testcase
Since filemonitor testcase requires that host kernel being a LTS version,
we cannot guarantee that on OBS system. Let's disable it by default.

Signed-off-by: Ying Fang <fangying1@huawei.com>
2020-08-06 11:13:53 +08:00
openeuler-ci-bot
5580ce5ce2 !58 增加qemu.spec rbd支持
Merge pull request !58 from 金泽宇/master
2020-07-24 16:24:52 +08:00
Zeyu Jin
f725fc129f spec: increase build-requirement of rbd-devel
Rbd support is default in qemu configure, so we should also add rbd support in qemu.spec .

Signed-off-by: jinzeyu <jinzeyu@huawei.com>
2020-07-23 20:25:38 +08:00
openeuler-ci-bot
e6d072043a !55 [bugfix] fix two patches format and one CVE bug
Merge pull request !55 from zhanghailiang/master
2020-06-20 17:12:23 +08:00