Gralloc: Use 4 bytes padding for private_handle_t
Force 4 bytes padding to avoid data leak due to uninitialized padding. Bug: 77237704 Change-Id: I3922bf62bfa6c78806a6d5fd969e2d9faf067abe CRs-Fixed: 2257685
This commit is contained in:
@@ -33,6 +33,7 @@ typedef gralloc1_error_t (*GRALLOC1_PFN_PERFORM)(gralloc1_device_t *device, int
|
|||||||
|
|
||||||
#define PRIV_HANDLE_CONST(exp) static_cast<const private_handle_t *>(exp)
|
#define PRIV_HANDLE_CONST(exp) static_cast<const private_handle_t *>(exp)
|
||||||
|
|
||||||
|
#pragma pack(push, 4)
|
||||||
struct private_handle_t : public native_handle_t {
|
struct private_handle_t : public native_handle_t {
|
||||||
enum {
|
enum {
|
||||||
PRIV_FLAGS_FRAMEBUFFER = 0x00000001,
|
PRIV_FLAGS_FRAMEBUFFER = 0x00000001,
|
||||||
@@ -75,15 +76,15 @@ struct private_handle_t : public native_handle_t {
|
|||||||
int format;
|
int format;
|
||||||
int buffer_type;
|
int buffer_type;
|
||||||
unsigned int layer_count;
|
unsigned int layer_count;
|
||||||
uint64_t id __attribute__((aligned(8)));
|
uint64_t id;
|
||||||
uint64_t usage __attribute__((aligned(8)));
|
uint64_t usage;
|
||||||
|
|
||||||
unsigned int size;
|
unsigned int size;
|
||||||
unsigned int offset;
|
unsigned int offset;
|
||||||
unsigned int offset_metadata;
|
unsigned int offset_metadata;
|
||||||
uint64_t base __attribute__((aligned(8)));
|
uint64_t base;
|
||||||
uint64_t base_metadata __attribute__((aligned(8)));
|
uint64_t base_metadata;
|
||||||
uint64_t gpuaddr __attribute__((aligned(8)));
|
uint64_t gpuaddr;
|
||||||
|
|
||||||
static const int kNumFds = 2;
|
static const int kNumFds = 2;
|
||||||
static const int kMagic = 'gmsm';
|
static const int kMagic = 'gmsm';
|
||||||
@@ -173,5 +174,6 @@ struct private_handle_t : public native_handle_t {
|
|||||||
|
|
||||||
uint64_t GetBackingstore() const { return id; }
|
uint64_t GetBackingstore() const { return id; }
|
||||||
};
|
};
|
||||||
|
#pragma pack(pop)
|
||||||
|
|
||||||
#endif // __GR_PRIV_HANDLE_H__
|
#endif // __GR_PRIV_HANDLE_H__
|
||||||
|
|||||||
Reference in New Issue
Block a user