* [PATCH] parisc: Add build-time sanity checks for compat ipc struct sizes
@ 2015-10-28 22:30 Helge Deller
2015-10-29 21:59 ` Helge Deller
0 siblings, 1 reply; 2+ messages in thread
From: Helge Deller @ 2015-10-28 22:30 UTC (permalink / raw)
To: linux-parisc, James Bottomley, John David Anglin
Ensure that the size of various compat ipc structs are the same as of
the native kernel.
Signed-off-by: Helge Deller <deller@gmx.de>
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
index c229427..f2ee988 100644
--- a/arch/parisc/mm/init.c
+++ b/arch/parisc/mm/init.c
@@ -23,6 +23,7 @@
#include <linux/unistd.h>
#include <linux/nodemask.h> /* for node_online_map */
#include <linux/pagemap.h> /* for release_pages and page_cache_release */
+#include <linux/compat.h>
#include <asm/pgalloc.h>
#include <asm/pgtable.h>
@@ -30,6 +31,7 @@
#include <asm/pdc_chassis.h>
#include <asm/mmzone.h>
#include <asm/sections.h>
+#include <asm/msgbuf.h>
extern int data_start;
extern void parisc_kernel_start(void); /* Kernel entry point in head.S */
@@ -590,6 +592,14 @@ unsigned long pcxl_dma_start __read_mostly;
void __init mem_init(void)
{
+#ifdef CONFIG_COMPAT
+ /* Do sanity checks on compat structures */
+ BUILD_BUG_ON(sizeof(struct compat_ipc64_perm) != sizeof(struct ipc64_perm));
+ BUILD_BUG_ON(sizeof(struct compat_msqid64_ds) != sizeof(struct msqid64_ds));
+ BUILD_BUG_ON(sizeof(struct compat_semid64_ds) != sizeof(struct semid64_ds));
+ BUILD_BUG_ON(sizeof(struct compat_shmid64_ds) != sizeof(struct shmid64_ds));
+#endif
+
/* Do sanity checks on page table constants */
BUILD_BUG_ON(PTE_ENTRY_SIZE != sizeof(pte_t));
BUILD_BUG_ON(PMD_ENTRY_SIZE != sizeof(pmd_t));
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] parisc: Add build-time sanity checks for compat ipc struct sizes
2015-10-28 22:30 [PATCH] parisc: Add build-time sanity checks for compat ipc struct sizes Helge Deller
@ 2015-10-29 21:59 ` Helge Deller
0 siblings, 0 replies; 2+ messages in thread
From: Helge Deller @ 2015-10-29 21:59 UTC (permalink / raw)
To: linux-parisc, James Bottomley, John David Anglin
On 28.10.2015 23:30, Helge Deller wrote:
> Ensure that the size of various compat ipc structs are the same as of
> the native kernel.
I've pushed all of my patches (with modifications to what I sent earlier) to
fix the IPC structs into the compat-patches branch of my git tree.
If someone wants to test, please pull from here:
git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux.git compat-patches
It's based on the sources of kernel 3.18 but merges cleanly up to git head.
Helge
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-10-29 21:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-28 22:30 [PATCH] parisc: Add build-time sanity checks for compat ipc struct sizes Helge Deller
2015-10-29 21:59 ` Helge Deller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).