RE: [PATCH rdma-next] IB/uverbs: Fix reading of 32 flags flags

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>-----Original Message-----
>From: linux-rdma-owner@xxxxxxxxxxxxxxx [mailto:linux-rdma-
>owner@xxxxxxxxxxxxxxx] On Behalf Of Leon Romanovsky
>Sent: Thursday, August 9, 2018 12:20 PM
>To: Doug Ledford <dledford@xxxxxxxxxx>; Jason Gunthorpe
><jgg@xxxxxxxxxxxx>
>Cc: RDMA mailing list <linux-rdma@xxxxxxxxxxxxxxx>; Jason Gunthorpe
><jgg@xxxxxxxx>; Leon Romanovsky <leonro@xxxxxxxxxxxx>
>Subject: [PATCH rdma-next] IB/uverbs: Fix reading of 32 flags flags
>
>From: Jason Gunthorpe <jgg@xxxxxxxxxxxx>
>
>This is missing a zeroing of the high bits of flags, and is also not
>correct for big endian machines. Properly zero extend the 32 bit flags
>into the 64 bit stack storage.
>
>Fixes: bccd06223f21 ("IB/uverbs: Add UVERBS_ATTR_FLAGS_IN to the specs
>language")
>Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxxxx>
>Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxxxx>
>---
> drivers/infiniband/core/uverbs_ioctl.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/infiniband/core/uverbs_ioctl.c
>b/drivers/infiniband/core/uverbs_ioctl.c
>index 081e9d7e820d..2530a46995c9 100644
>--- a/drivers/infiniband/core/uverbs_ioctl.c
>+++ b/drivers/infiniband/core/uverbs_ioctl.c
>@@ -521,7 +521,7 @@ int uverbs_get_flags64(u64 *to, const struct
>uverbs_attr_bundle *attrs_bundle,
> 	if (attr->ptr_attr.len == 8)
> 		flags = attr->ptr_attr.data;
> 	else if (attr->ptr_attr.len == 4)
>-		memcpy(&flags, &attr->ptr_attr.data, 4);
>+		flags = *(u32 *)&attr->ptr_attr.data;
> 	else
> 		return -EINVAL;
>

Looks good,

Reviewed-by: Michael J. Ruhl <michael.j.ruhl@xxxxxxxxx>

M
>--
>2.14.4
>
>--
>To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
>the body of a message to majordomo@xxxxxxxxxxxxxxx
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux