lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 4 Apr 2015 06:17:23 +0800
From:	Chen Gang <xili_gchen_5257@...mail.com>
To:	gregkh@...uxfoundation.org, daniel@...que.org,
	dh.herrmann@...glemail.com, tixxdz@...ndz.org
CC:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: samples: kdbus: kdbus-workers: Define dummy prime_new()

Quite a few of architures (e.g. blackfin, cris, frv ...) do not support
memfd_create system call which is used in prime_new(). So define a dummy
one.

The related error (with allmodconfig under blackfin):

    CC [M]  samples/kfifo/inttype-example.o
  samples/kdbus/kdbus-workers.c: In function ‘prime_new’:
  samples/kdbus/kdbus-workers.c:930:18: error: ‘__NR_memfd_create’ undeclared (first use in this function)
    p->fd = syscall(__NR_memfd_create, "prime-area", MFD_CLOEXEC);
                    ^
  samples/kdbus/kdbus-workers.c:930:18: note: each undeclared identifier is reported only once for each function it appears in
  make[2]: *** [samples/kdbus/kdbus-workers] Error 1

Signed-off-by: Chen Gang <gang.chen.5i5j@...il.com>
---
 samples/kdbus/kdbus-workers.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/samples/kdbus/kdbus-workers.c b/samples/kdbus/kdbus-workers.c
index d331e01..0affd23 100644
--- a/samples/kdbus/kdbus-workers.c
+++ b/samples/kdbus/kdbus-workers.c
@@ -910,6 +910,8 @@ exit:
  *
  */
 
+#ifdef __NR_memfd_create
+
 static int prime_new(struct prime **out)
 {
 	struct prime *p;
@@ -954,6 +956,15 @@ error:
 	return r;
 }
 
+#else
+
+static int prime_new(struct prime **out)
+{
+	return err("the architecture does not support memfd_create");
+}
+
+#endif
+
 static void prime_free(struct prime *p)
 {
 	if (!p)
-- 
1.9.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ