]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virDevMapperGetTargetsImpl: Use correct length when copying into dm.name
authorMichal Privoznik <mprivozn@redhat.com>
Sat, 6 Mar 2021 10:47:59 +0000 (11:47 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 8 Mar 2021 11:16:13 +0000 (12:16 +0100)
commit4f30c1bb8c32374c62f90abb5aa224611c59c363
tree019a578b6702b60bbc9f260e65e487a1d9b13a8c
parentd5b2644815f12c3ef2dc0d31d32a0c30092a8853
virDevMapperGetTargetsImpl: Use correct length when copying into dm.name

For reasons unknown, when rewriting this code and dropping
libdevmapper I've mistakenly used incorrect length of dm.name. In
linux/dm-ioctl.h the dm_ioctl struct is defined as follows:

  #define DM_NAME_LEN 128

  struct dm_ioctl {
    ...
    char name[DM_NAME_LEN];     /* device name */
    ...
  };

However, when copying string into this member, DM_TABLE_DEPS was
used, which is defined as follows:

  #define DM_TABLE_DEPS    _IOWR(DM_IOCTL, DM_TABLE_DEPS_CMD, struct dm_ioctl)

After decryption, this results in the following size: 3241737483.

Fixes: 22494556542c676d1b9e7f1c1f2ea13ac17e1e3e
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/util/virdevmapper.c