summaryrefslogtreecommitdiffstats
path: root/drivers/misc/mic/host/mic_virtio.c
diff options
context:
space:
mode:
authorAshutosh Dixit2013-11-27 17:58:41 +0100
committerGreg Kroah-Hartman2013-11-27 20:03:38 +0100
commit1e31aa9270daab40c7aef9d5488982e3475b87ef (patch)
treeb1c30376de230c4b21965622c5fc4e2705188ac5 /drivers/misc/mic/host/mic_virtio.c
parentmisc: mic: Bug fix for sysfs poll usage. (diff)
downloadkernel-qcow2-linux-1e31aa9270daab40c7aef9d5488982e3475b87ef.tar.gz
kernel-qcow2-linux-1e31aa9270daab40c7aef9d5488982e3475b87ef.tar.xz
kernel-qcow2-linux-1e31aa9270daab40c7aef9d5488982e3475b87ef.zip
misc: mic: Fix user space namespace pollution from mic_common.h.
Avoid declaring ALIGN() and __aligned() in include/uapi/linux/mic_common.h since they pollute user space namespace. Also, mic_aligned_size() can be simply replaced simply by sizeof() since all structures where mic_aligned_size() is used are declared using __attribute__ ((aligned(8))); -- >From mail from H Peter Anvin about this: On Fri, Nov 08, 2013 H Peter Anvin <h.peter.anvin@intel.com> wrote: Subject: Namespace pollution in mic_common.h This puts two macros, ALIGN() and __aligned(), into arbitrary user space namespace. This really isn't safe or acceptable, especially since those symbols are highly generic. ... When these structures are forced-aligned, they will in fact have padding automatically added by the compiler to an 8-byte boundary anyway, so mic_aligned_size() does nothing. ... Reported-by: H Peter Anvin <h.peter.anvin@intel.com> Reviewed-by: Sudeep Dutt <sudeep.dutt@intel.com> Signed-off-by: Nikhil Rao <nikhil.rao@intel.com> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mic/host/mic_virtio.c')
-rw-r--r--drivers/misc/mic/host/mic_virtio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/misc/mic/host/mic_virtio.c b/drivers/misc/mic/host/mic_virtio.c
index 945a3d0fe227..efe8da4401e9 100644
--- a/drivers/misc/mic/host/mic_virtio.c
+++ b/drivers/misc/mic/host/mic_virtio.c
@@ -467,7 +467,7 @@ static int mic_copy_dp_entry(struct mic_vdev *mvdev,
}
/* Find the first free device page entry */
- for (i = mic_aligned_size(struct mic_bootparam);
+ for (i = sizeof(struct mic_bootparam);
i < MIC_DP_SIZE - mic_total_desc_size(dd_config);
i += mic_total_desc_size(devp)) {
devp = mdev->dp + i;