* [PATCH] c/r: prctl: fix build error for no-MMU case
@ 2012-09-24 21:41 Mark Salter
2012-09-24 21:55 ` Cyrill Gorcunov
0 siblings, 1 reply; 2+ messages in thread
From: Mark Salter @ 2012-09-24 21:41 UTC (permalink / raw)
To: Cyrill Gorcunov; +Cc: linux-kernel, Mark Salter
Commit 1ad75b9e1 added some address checking to prctl_set_mm()
used by checkpoint-restore. This causes a build error for no-MMU
systems:
kernel/sys.c: In function 'prctl_set_mm':
kernel/sys.c:1868:34: error: 'mmap_min_addr' undeclared (first use in this function)
The test for mmap_min_addr doesn't make a lot of sense for no-MMU
code as noted in commit 6e1415467. This patch defines mmap_min_addr
as 0UL in the no-MMU case so that the compiler will optimize away
tests for "addr < mmap_min_addr".
Signed-off-by: Mark Salter <msalter@redhat.com>
---
include/linux/security.h | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/include/linux/security.h b/include/linux/security.h
index 3dea6a9..d143b8e 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -118,6 +118,7 @@ void reset_security_ops(void);
extern unsigned long mmap_min_addr;
extern unsigned long dac_mmap_min_addr;
#else
+#define mmap_min_addr 0UL
#define dac_mmap_min_addr 0UL
#endif
--
1.7.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] c/r: prctl: fix build error for no-MMU case
2012-09-24 21:41 [PATCH] c/r: prctl: fix build error for no-MMU case Mark Salter
@ 2012-09-24 21:55 ` Cyrill Gorcunov
0 siblings, 0 replies; 2+ messages in thread
From: Cyrill Gorcunov @ 2012-09-24 21:55 UTC (permalink / raw)
To: Mark Salter; +Cc: linux-kernel, Eric W. Biederman, Kees Cook, Andrew Morton
On Mon, Sep 24, 2012 at 05:41:32PM -0400, Mark Salter wrote:
> Commit 1ad75b9e1 added some address checking to prctl_set_mm()
> used by checkpoint-restore. This causes a build error for no-MMU
> systems:
>
> kernel/sys.c: In function 'prctl_set_mm':
> kernel/sys.c:1868:34: error: 'mmap_min_addr' undeclared (first use in this function)
>
> The test for mmap_min_addr doesn't make a lot of sense for no-MMU
> code as noted in commit 6e1415467. This patch defines mmap_min_addr
> as 0UL in the no-MMU case so that the compiler will optimize away
> tests for "addr < mmap_min_addr".
>
> Signed-off-by: Mark Salter <msalter@redhat.com>
Thanks, Mark! I should add that this mmap_min_addr currently
referenced in other parts of code only under CONFIG_MMU so this
definition in header should not break anything.
Reviewed-by: Cyrill Gorcunov <gorcunov@openvz.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-09-24 21:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-24 21:41 [PATCH] c/r: prctl: fix build error for no-MMU case Mark Salter
2012-09-24 21:55 ` Cyrill Gorcunov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox