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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140320094406.14878.38787.stgit@localhost.localdomain>
Date:	Thu, 20 Mar 2014 15:14:06 +0530
From:	Janani Venkataraman <jananive@...ux.vnet.ibm.com>
To:	linux-kernel@...r.kernel.org
Cc:	amwang@...hat.com, procps@...elists.org, rdunlap@...otime.net,
	james.hogan@...tec.com, aravinda@...ux.vnet.ibm.com, hch@....de,
	mhiramat@...hat.com, jeremy.fitzhardinge@...rix.com,
	xemul@...allels.com, d.hatayama@...fujitsu.com, coreutils@....org,
	kosaki.motohiro@...fujitsu.com, adobriyan@...il.com,
	util-linux@...r.kernel.org, tarundsk@...ux.vnet.ibm.com,
	vapier@...too.org, roland@...k.frob.com, ananth@...ux.vnet.ibm.com,
	gorcunov@...nvz.org, avagin@...nvz.org, oleg@...hat.com,
	eparis@...hat.com, suzuki@...ux.vnet.ibm.com, andi@...stfloor.org,
	tj@...nel.org, akpm@...ux-foundation.org,
	torvalds@...ux-foundation.org
Subject: [PATCH 33/33] Support check

This checks if a particular build can support dumps on 32/64 bit applications.

For eg. A 32bit build of gencore cant support dumps on 64 bit applications.

Signed-off-by: Janani Venkataraman <jananive@...ux.vnet.ibm.com>
---
 src/coredump.c |   11 +++++++++++
 src/elf64.c    |    2 ++
 2 files changed, 13 insertions(+)

diff --git a/src/coredump.c b/src/coredump.c
index 98a7146..49af7b3 100644
--- a/src/coredump.c
+++ b/src/coredump.c
@@ -76,6 +76,17 @@ struct core_proc cp;
 /* PID of Daemon */
 int pid_log;
 
+/* Support Check */
+static int support_check(int pid, struct core_proc *cp)
+{
+	gencore_log("This build of gencore(32bit) cannot dump a 64bit process.\n");
+	return -1;
+}
+
+#if defined(__i386) || (defined(__s390__) && !defined(__s390x__)) || (defined(__PPC__) && !defined(__PPC64__))
+#define do_elf64_coredump support_check
+#endif
+
 /* Initialised core process members */
 void init_core(void)
 {
diff --git a/src/elf64.c b/src/elf64.c
index 651f218..11c8c76 100644
--- a/src/elf64.c
+++ b/src/elf64.c
@@ -28,6 +28,7 @@
  * and operations once elf.c is included.
  */
 
+#if defined(__x86_64) || (defined(__s390x__) && defined(__s390__)) || (defined(__PPC64__) && defined(__PPC__))
 #define do_elf_coredump do_elf64_coredump
 
 #define Elf_Ehdr Elf64_Ehdr
@@ -40,3 +41,4 @@
 #define Elf_Addr Elf64_Addr
 
 #include "elf.c"
+#endif

--
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