73 Commits

Author SHA1 Message Date
yezengruan
a03e6f9210 fix CVE-2021-3975 (openeuler !78)
qemu: Add missing lock in qemuProcessHandleMonitorEOF (CVE-2021-3975)

Signed-off-by: yezengruan <yezengruan@huawei.com>
2022-08-25 17:10:49 +08:00
openeuler-ci-bot
edd98e1309
!154 fix CVE-2022-0897 (openeuler !66)
From: @yezengruan 
Reviewed-by: @kevinzhu1 
Signed-off-by: @kevinzhu1
2022-06-20 07:45:54 +00:00
yezengruan
78c20fb7ab fix CVE-2022-0897 (openeuler !66)
nwfilter: fix crash when counting number of network filters (CVE-2022-0897)

Signed-off-by: yezengruan <yezengruan@huawei.com>
2022-06-20 09:41:05 +08:00
openeuler-ci-bot
8ffe16e78d
!150 libvirt: build without dtrace (sync from master)
From: @yezengruan 
Reviewed-by: @kevinzhu1 
Signed-off-by: @kevinzhu1
2022-06-17 06:59:12 +00:00
yezengruan
c785bcb0c4 libvirt: build without dtrace 2022-06-17 14:17:24 +08:00
openeuler-ci-bot
522beebd6b
!122 [sync] PR-121: update spec with openeuler !50
From: @openeuler-sync-bot 
Reviewed-by: @imxcc 
Signed-off-by: @imxcc
2022-03-08 07:43:44 +00:00
imxcc
7e4dd94d49 update spec with openeuler !50
Signed-off-by: imxcc <xingchaochao@huawei.com>
(cherry picked from commit 19c228b40402253aca460dc3096016493aaa27d1)
2022-03-08 14:28:06 +08:00
imxcc
3c3566a8a2 virsh: Display vhostuser socket path in domblklist
The domblklist command is designed to show a brief information about the blocks
of a domain. One piece of information that is shows is "Target" and "Source".
Before the modification, the Vhost disk of SPDK is displayed as "-". After
the modification, the socket associated with it can be displayed.

Signed-off-by: dinglimin <dinglimin@cmss.chinamobile.com>
Signed-off-by: imxcc <xingchaochao@huawei.com>
(cherry picked from commit ba96974243af5faf2eb7d9ad88a0bfd35b5f7e15)
2022-03-08 14:28:06 +08:00
openeuler-ci-bot
e63d81d9c6 !106 Automatically generate code patches with openeuler !47
From: @kuhnchen18
Reviewed-by: @imxcc,@paul-huang
Signed-off-by: @imxcc,@paul-huang
2021-12-09 01:52:10 +00:00
Chen Qun
c37912df93 spec: Update release version with !47
increase release verison by one

Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
2021-12-08 21:28:29 +08:00
Chen Qun
13d4c3659e spec: Update patch and changelog with !47 回合upstream bugfix: virdevmapper: Handle kernel without device-mapper support !47
virDevMapperGetTargets: Don't ignore EBADF
virdevmapper: Don't cache device-mapper major
virdevmapper: Handle kernel without device-mapper support

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2021-12-08 21:28:24 +08:00
Euler Robot
2a0f1b2c7c virdevmapper: Handle kernel without device-mapper support
In one of my latest patch (v6.6.0~30) I was trying to remove
libdevmapper use in favor of our own implementation. However, the
code did not take into account that device mapper can be not
compiled into the kernel (e.g. be a separate module that's not
loaded) in which case /proc/devices won't have the device-mapper
major number and thus virDevMapperGetTargets() and/or
virIsDevMapperDevice() fails.

However, such failure is safe to ignore, because if device mapper
is missing then there can't be any multipath devices and thus we
don't need to allow the deps in CGroups, nor create them in the
domain private namespace, etc.

Fixes: 22494556542c676d1b9e7f1c1f2ea13ac17e1e3e
Reported-by: Andrea Bolognani <abologna@redhat.com>
Reported-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Tested-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
2021-12-08 21:28:24 +08:00
Euler Robot
dac7e7ddd1 virdevmapper: Don't cache device-mapper major
The device mapper major is needed in virIsDevMapperDevice() which
determines whether given device is managed by device-mapper. This
number is obtained by parsing /proc/devices and then stored in a
global variable so that the file doesn't have to be parsed again.
However, as it turns out this logic is flawed - the major number
is not static and can change as it can be specified as a
parameter when loading the dm-mod module.

Unfortunately, I was not able to come up with a good solution and
thus the /proc/devices file is being parsed every time we need
the device mapper major.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Tested-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
2021-12-08 21:28:24 +08:00
Euler Robot
a285493c5d virDevMapperGetTargets: Don't ignore EBADF
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2021-12-08 21:28:24 +08:00
openeuler-ci-bot
a0c68ac493 !104 Automatically generate code patches with openeuler !46
From: @kuhnchen18
Reviewed-by: @imxcc
Signed-off-by: @imxcc
2021-12-08 10:19:27 +00:00
Chen Qun
7f8a0cf075 spec: Update release version with !46
increase release verison by one

Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
2021-12-08 16:28:12 +08:00
Chen Qun
c9deff4ae0 spec: Update patch and changelog with !46 add phytium 2000plus and s2500 support on arm architecture for capability !46
add phytium 2000plus and s2500 support on arm architecture for capability

Signed-off-by: imxcc <xingchaochao@huawei.com>
2021-12-08 16:28:04 +08:00
Euler Robot
f3778a7885 add phytium 2000plus and s2500 support on arm architecture for capability
Signed-off-by: imxcc <xingchaochao@huawei.com>
2021-12-08 16:28:04 +08:00
openeuler-ci-bot
bea440c950 !93 Automatically generate code patches with openeuler !39
From: @kuhnchen18
Reviewed-by: @imxcc
Signed-off-by: @imxcc
2021-09-27 01:04:24 +00:00
Chen Qun
7f06e910a7 spec: Update release version with !39
increase release verison by one

Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
2021-09-26 21:28:39 +08:00
Chen Qun
42832d4090 spec: Update patch and changelog with !39 fix CVE-2021-3667 CVE-2021-3631 #I4BI8P #I4BI73 !39
storage_driver: Unlock object on ACL fail in storagePoolLookupByTargetPath
security: fix SELinux label generation logic

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2021-09-26 21:28:36 +08:00
Euler Robot
5359856aaa security: fix SELinux label generation logic
A process can access a file if the set of MCS categories
for the file is equal-to *or* a subset-of, the set of
MCS categories for the process.

If there are two VMs:

  a) svirt_t:s0:c117
  b) svirt_t:s0:c117,c720

Then VM (b) is able to access files labelled for VM (a).

IOW, we must discard case where the categories are equal
because that is a subset of many other valid category pairs.

Fixes: https://gitlab.com/libvirt/libvirt/-/issues/153
CVE-2021-3631
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-09-26 21:28:36 +08:00
Euler Robot
cada203f30 storage_driver: Unlock object on ACL fail in storagePoolLookupByTargetPath
'virStoragePoolObjListSearch' returns a locked and refed object, thus we
must release it on ACL permission failure.

Fixes: 7aa0e8c0cb8
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1984318
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-09-26 21:28:36 +08:00
openeuler-ci-bot
af21f1384d !88 Automatically generate code patches with openeuler !37
From: @kuhnchen18
Reviewed-by: @imxcc
Signed-off-by: @imxcc
2021-09-26 03:43:11 +00:00
Chen Qun
e7cd91f1bb spec: Update release version with !37
increase release verison by one

Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
2021-09-24 11:28:36 +08:00
Chen Qun
1f0781b1d5 spec: Update patch and changelog with !37 conf/domain_conf: pin the retry_interval and retry_timeout parameters to xml !37
conf/domain_conf: pin the retry_interval and retry_timeout parameters to xml

Signed-off-by: Mao Zhongyi <maozhongyi@cmss.chinamobile.com>
2021-09-24 11:28:32 +08:00
Euler Robot
3d370f7c9c conf/domain_conf: pin the retry_interval and retry_timeout parameters to xml
Signed-off-by: Mao Zhongyi <maozhongyi@cmss.chinamobile.com>
2021-09-24 11:28:32 +08:00
openeuler-ci-bot
b00634df9a !77 [feature]add new CPU model Cooperlake
From: @jingyi_wang
Reviewed-by: @imxcc
Signed-off-by: @imxcc
2021-07-27 07:59:03 +00:00
Jingyi Wang
76a665c23b add new CPU model Cooperlake
Signed-off-by: Jingyi Wang <wangjingyi11@huawei.com>
2021-07-27 14:20:39 +08:00
openeuler-ci-bot
e9fa45ed60 !68 Automatically generate code patches with openeuler !27
From: @kuhnchen18
Reviewed-by: @zhanghailiang_lucky
Signed-off-by: @zhanghailiang_lucky
2021-04-25 15:26:39 +08:00
Chen Qun
17078cf659 spec: Update release version with !27
increase release verison by one

Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
2021-04-23 11:28:52 +08:00
Chen Qun
15b02aa020 spec: Update patch and changelog with !27 Add retry policy for error_policy !27
libvirt: Add 'retry' support for error policy
qemu: Support 'retry' BLOCK_IO_ERROR event.
libvirt/conf: Set default values of retry fileds

Signed-off-by: Jiahui Cen <cenjiahui@huawei.com>
Signed-off-by: Ying Fang <fangying1@huawei.com>
2021-04-23 11:28:50 +08:00
Chen Qun
80dd360690 libvirt/conf: Set default values of retry fileds
Currently the default values of retry_interval and retry_timeout are set
to -1, when 'driver' option exists without retry fileds. It conflicts
with the default values when the 'driver' option does not exist.

So let's set default values of retry_interval and retry_timeout to 0 when
retry policy is not enabled.

Signed-off-by: Jiahui Cen <cenjiahui@huawei.com>
2021-04-23 11:28:50 +08:00
Chen Qun
ef331a03e1 qemu: Support 'retry' BLOCK_IO_ERROR event.
Accept BLOCK_IO_ERROR event with action='retry' from qemu.

Signed-off-by: Jiahui Cen <cenjiahui@huawei.com>
Signed-off-by: Ying Fang <fangying1@huawei.com>
2021-04-23 11:28:50 +08:00
Chen Qun
a06da0d07f libvirt: Add 'retry' support for error policy
Introduce error_policy=/rerror_policy='retry' to support
werror=/rerror=retry mechanism in qemu.

Add retry_interval parameter to control the interval between retries.
Add retry_timeout parameter to control the total retry times.

Signed-off-by: Jiahui Cen <cenjiahui@huawei.com>
Signed-off-by: Ying Fang <fangying1@huawei.com>
2021-04-23 11:28:50 +08:00
openeuler-ci-bot
7875093a24 !56 Automatically generate code patches with openeuler
From: @zhendongchen
Reviewed-by: @yorifang
Signed-off-by: @yorifang
2021-01-21 09:16:37 +08:00
Euler Robot
6d364f3470 spec: Update release version with !17 !23
increase release verison by one

Signed-off-by: Euler Robot <euler.robot@huawei.com>
2021-01-20 10:46:01 +08:00
Euler Robot
c78a686532 spec: Update patch and changelog with !17
util: Move virIsDevMapperDevice() to virdevmapper.c
virdevmapper: Don't use libdevmapper to obtain dependencies

Signed-off-by: Jiajie Li <lijiajie11@huawei.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2021-01-20 10:45:12 +08:00
Huawei Technologies Co., Ltd
0b136aabde virdevmapper: Don't use libdevmapper to obtain dependencies
CVE-2020-14339

When building domain's private /dev in a namespace, libdevmapper
is consulted for getting full dependency tree of domain's disks.
The reason is that for a multipath devices all dependent devices
must be created in the namespace and allowed in CGroups.

However, this approach is very fragile as building of namespace
happens in the forked off child process, after mass close of FDs
and just before dropping privileges and execing QEMU. And it so
happens that when calling libdevmapper APIs, one of them opens
/dev/mapper/control and saves the FD into a global variable. The
FD is kept open until the lib is unlinked or dm_lib_release() is
called explicitly. We are doing neither.

However, the virDevMapperGetTargets() function is called also
from libvirtd (when setting up CGroups) and thus has to be thread
safe. Unfortunately, libdevmapper APIs are not thread safe (nor
async signal safe) and thus we can't use them. Reimplement what
libdevmapper would do using plain C (ioctl()-s, /proc/devices
parsing, /dev/mapper dirwalking, and so on).

Fixes: a30078cb832646177defd256e77c632905f1e6d0
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1858260

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>

cherry-pick from commit 22494556542c676d1b9e7f1c1f2ea13ac17e1e3e
Signed-off-by: Jiajie Li <lijiajie11@huawei.com>
2021-01-20 10:44:52 +08:00
Huawei Technologies Co., Ltd
1386766ca9 util: Move virIsDevMapperDevice() to virdevmapper.c
CVE-2020-14339

When introducing virdevmapper.c (in v4.3.0-rc1~427) I didn't
realize there is a function that calls in devmapper. The function
is called virIsDevMapperDevice() and lives in virutil.c. Now that
we have a special file for handling devmapper move it there.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>

cherry-pick from commit dfa0e118f745fe3f4fe95975c6100f0fc6d788be
Signed-off-by: Jiajie Li <lijiajie11@huawei.com>
2021-01-20 10:22:58 +08:00
openeuler-ci-bot
50183dc7eb !43 spec: add --without-firewalld-zone to configure commandline for old firewalld version
From: @zhendongchen
Reviewed-by: @yorifang
Signed-off-by: @yorifang
2020-12-09 08:54:47 +08:00
Alex Chen
e5c4324d39 spec: add --without-firewalld-zone to configure commandline for old firewalld version
Because current firewalld version is too old(< 0.7.0) to support
the rule priority setting in the libvirt zone file, so we should
add --without-firewalld-zone to configure commandline.
More info can be found in the following link:
https://github.com/libvirt/libvirt/commit/3b71f2e4.

Signed-off-by: Alex Chen <alex.chen@huawei.com>
2020-12-08 19:49:24 +08:00
openeuler-ci-bot
748b844bcb !35 Automatically generate code patches with openeuler
From: @zhendongchen
Reviewed-by: @yorifang
Signed-off-by: @yorifang
2020-10-27 15:41:26 +08:00
Euler Robot
64ab04561d spec: Update release version with !11
increase release verison by one

Signed-off-by: Euler Robot <euler.robot@huawei.com>
2020-10-26 20:25:40 +08:00
Euler Robot
eab0fdbe92 spec: Update patch and changelog with !11
rpc: gendispatch: handle empty flags
rpc: add support for filtering @acls by uint params
rpc: require write acl for guest agent in virDomainInterfaceAddresses
qemu: agent: set ifname to NULL after freeing

Signed-off-by: Jan Tomko <jtomko@redhat.com>
Signed-off-by: Jiajie Li <lijiajie11@huawei.com>
2020-10-26 20:25:40 +08:00
Huawei Technologies Co., Ltd
27ddd033e6 qemu: agent: set ifname to NULL after freeing
CVE-2020-25637

Signed-off-by: Jan Tomko <jtomko@redhat.com>
Rported-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Reviewed-by: Mauro Matteo Cascella <mcascell@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>

cherry-pick from commit a63b48c5ecef077bf0f909a85f453a605600cf05
Signed-off-by: Jiajie Li <lijiajie11@huawei.com>
2020-10-26 20:25:40 +08:00
Huawei Technologies Co., Ltd
b4631b1117 rpc: require write acl for guest agent in virDomainInterfaceAddresses
CVE-2020-25637

Add a requirement for domain:write if source is set to
VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_AGENT.

Signed-off-by: Jan Tomko <jtomko@redhat.com>
Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>

cherry-pick from commit e4116eaa44cb366b59f7fe98f4b88d04c04970ad
Signed-off-by: Jiajie Li <lijiajie11@huawei.com>
2020-10-26 20:25:40 +08:00
Huawei Technologies Co., Ltd
f8827bcf88 rpc: add support for filtering @acls by uint params
CVE-2020-25637

Add a new field to @acl annotations for filtering by
unsigned int parameters.

Signed-off-by: Jan Tomko <jtomko@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>

cherry-pick from commit 50864dcda191eb35732dbd80fb6ca251a6bba923
Signed-off-by: Jiajie Li <lijiajie11@huawei.com>
2020-10-26 20:25:40 +08:00
Huawei Technologies Co., Ltd
6714fa2b16 rpc: gendispatch: handle empty flags
CVE-2020-25637

Prepare for omission of the <flagname> in remote_protocol.x
@acl annotations:
 @acl: <object>:<permission>:<flagname>
so that we can add more field after, e.g.:
 @acl: <object>:<permission>::<field>

Signed-off-by: Jan Tomko <jtomko@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>

cherry-pick from commit 955029bd0ad7ef96000f529ac38204a8f4a96401
Signed-off-by: Jiajie Li <lijiajie11@huawei.com>
2020-10-26 20:25:40 +08:00
openeuler-ci-bot
aa8eee2f47 !17 Substitute security_context_t with char *
Merge pull request !17 from XuYandong/openEuler-20.03-LTS
2020-08-05 10:08:38 +08:00