habanalabs: align ioctl uapi structures to 64-bit
authorDan Rapaport <drapaport@habana.ai>
Mon, 30 May 2022 11:11:45 +0000 (14:11 +0300)
committerOded Gabbay <ogabbay@kernel.org>
Tue, 12 Jul 2022 06:09:21 +0000 (09:09 +0300)
The compiler is padding the members of the struct to be aligned to
64-bit. The content of the padded bytes is and not zeroed explicitly,
hence might copy undefined data. We add a padding member to the struct
to get a zeroed 64-bit align struct.

Signed-off-by: Dan Rapaport <drapaport@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
include/uapi/misc/habanalabs.h

index 52540d5b4fc95075ab1f9d39b256bd08e955af68..6d2ccc09dcf2f01017b31b4b391d9570726c7663 100644 (file)
@@ -949,6 +949,7 @@ struct hl_cs_in {
 
        /* Context ID - Currently not in use */
        __u32 ctx_id;
+       __u8 pad[4];
 };
 
 struct hl_cs_out {