Patchwork kernel/seccomp.c:55:23: error: 'NR_syscalls' undeclared

login
register
mail settings
Submitter Leann Ogasawara
Date Nov. 16, 2011, 8:12 p.m.
Message ID <1321474367.2241.35.camel@adamo>
Download mbox | patch
Permalink /patch/126031/
State New
Headers show

Comments

Leann Ogasawara - Nov. 16, 2011, 8:12 p.m.
On Wed, 2011-11-16 at 11:12 -0800, Leann Ogasawara wrote:
> On Wed, 2011-11-16 at 10:52 -0800, Kees Cook wrote:
> > Hi,
> > 
> > Oh, er, I thought Tim was doing the seccomp rebase from what I had in
> > https://github.com/kees/linux/commits/ubuntu-precise which (I think)
> > fixed the NR_syscalls problem.
> 
> Hrm, indeed this is what I thought he'd done as well and pushed the end
> result to our official ubuntu-precise repo.  But looking at your tree on
> github and comparing that to what we have in our repo, we're definitely
> missing some patches.
> 
> I'll pull in the extra patches you have in your repo and re-build.  I'll
> let you know my results.

Cool, the extra patches in your tree fixed this up.  Also, just fyi, Tim
applied two additional patches to our repo as well (see attached).

Thanks,
Leann

> > On Wed, Nov 16, 2011 at 10:43 AM, Leann Ogasawara
> > <leann.ogasawara@canonical.com> wrote:
> > > Hi Kees and Will,
> > >
> > > I recently rebased the ubuntu-precise git tree to upstream v3.2-rc2.
> > > Unfortunately when doing some test cross-compiles on arm I hit the
> > > following build failure:
> > >
> > > kernel/seccomp.c: In function '__secure_computing':
> > > kernel/seccomp.c:55:23: error: 'NR_syscalls' undeclared (first use in this function)
> > > kernel/seccomp.c:55:23: note: each undeclared identifier is reported only once for each function it appears in
> > > make[3]: *** [kernel/seccomp.o] Error 1
> > >
> > > This is actually the same build error we were seeing in Oneiric when
> > > trying to enable seccomp on arm [1].  Care to send a patch to fix this
> > > up?  For now I've temporarily disabled the seccomp patches on arm in our
> > > ubuntu-precise git repo.
> > >
> > > Thanks,
> > > Leann
> > >
> > > [1] https://lists.ubuntu.com/archives/kernel-team/2011-August/016749.html
> > >
> > >
> > 
> > 
> > 
> 
> 
>

Patch

From 19f659eb805dbaf9e056c2689b151ab7fed2f7a5 Mon Sep 17 00:00:00 2001
From: Tim Gardner <tim.gardner@canonical.com>
Date: Wed, 9 Nov 2011 11:51:50 -0700
Subject: [PATCH 2/2] CHROMIUM: Fix kref usage

BugLink: http://bugs.launchpad.net/bugs/887780

Also fixes some compile warnings.

Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
---
 kernel/seccomp_filter.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/seccomp_filter.c b/kernel/seccomp_filter.c
index ac682cf..c551b9c 100644
--- a/kernel/seccomp_filter.c
+++ b/kernel/seccomp_filter.c
@@ -19,6 +19,7 @@ 
 
 #include <linux/capability.h>
 #include <linux/compat.h>
+#include <linux/module.h>
 #include <linux/err.h>
 #include <linux/errno.h>
 #include <linux/ftrace_event.h>
@@ -646,13 +647,12 @@  void put_seccomp_filters(struct seccomp_filters *orig)
 {
 	if (!orig)
 		return;
-	kref_put(orig, __put_seccomp_filters);
+	kref_put(&orig->usage, __put_seccomp_filters);
 }
 
 /* get_seccomp_filters - increments the reference count of @orig. */
 struct seccomp_filters *get_seccomp_filters(struct seccomp_filters *orig)
 {
-	int usage;
 	if (!orig)
 		return NULL;
 	/* XXX: kref needs overflow prevention support. */
-- 
1.7.4.1