提交 84b514dc 编写于 作者: P Parav Pandit 提交者: Pengyuan Zhao

vdpa: Consider device id larger than 31

stable inclusion
from stable-v5.16
commit bb47620b
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I5WXCZ
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=bb47620be322c5e9e372536cb6b54e17b3a00258
----------------------------------------------------------------------

virtio device id value can be more than 31. Hence, use BIT_ULL in
assignment.

Fixes: 33b34750 ("vdpa: Define vdpa mgmt device, ops and a netlink interface")
Reported-by: Nkernel test robot <lkp@intel.com>
Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NParav Pandit <parav@nvidia.com>
Acked-by: NJason Wang <jasowang@redhat.com>
Link: https://lore.kernel.org/r/20211130042949.88958-1-parav@nvidia.comSigned-off-by: NMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: NPengyuan Zhao <zhaopengyuan@hisilicon.com>
上级 21ab9f0d
......@@ -421,7 +421,8 @@ static int vdpa_mgmtdev_fill(const struct vdpa_mgmt_dev *mdev, struct sk_buff *m
goto msg_err;
while (mdev->id_table[i].device) {
supported_classes |= BIT(mdev->id_table[i].device);
if (mdev->id_table[i].device <= 63)
supported_classes |= BIT_ULL(mdev->id_table[i].device);
i++;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册