All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sharyathi Nagesh <sharyath@in.ibm.com>
To: linux-kernel@vger.kernel.org, fastboot@lists.osdl.org,
	akpm@osdl.org, maneesh@in.ltcfwd.linux.ibm.com,
	ebiederm@xmission.com, mohan@in.ibm.com, sachinp@in.ibm.com
Cc: mohd.omar@in.ibm.com, IndhuDurai@in.ibm.com
Subject: correction to compat_sys_kexec_load
Date: Fri, 23 May 2008 17:06:28 +0530	[thread overview]
Message-ID: <4836AC3C.3090005@in.ibm.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 972 bytes --]

Hi
   While testing with kexec tool, I observed some problems. When 
application (kexec) is 32 bit and kernel is 64 bit I observed that 
loading crash kernel works without any issues but unloading crash kernel 
fails.
--------------------------------------------------------
running strace over 'kexec -u -p'
show the problem to be with sys_kexec_load() call

sys_kexec_load(0, 0, 0, 0x1, 0)         = -1 EINVAL (Invalid argument)
write(2, "kexec_load (0 segments) failed: "..., 49
kexec_load (0 segments) failed: Invalid argument
) = 4
--------------------------------------------------------

This is patch to fix the problem, I think kernel code had a typo where in:
if((flags & KEXEC_ARCH_MASK) == KEXEC_ARCH) was used instead of
if((flags & KEXEC_ARCH_MASK) != KEXEC_ARCH)

This patch takes care of that, I have tested the patch it worked fine 
for me. Please review the patch and let me know of your views. This 
patch is based on linux-2.6.26-rc3.

Thanks
Yeehaw



[-- Attachment #2: compat_sys_kexec_correction.patch --]
[-- Type: text/x-patch, Size: 596 bytes --]

Index: linux-2.6.25.3-2/kernel/kexec.c
===================================================================
--- linux-2.6.25.3-2.orig/kernel/kexec.c	2008-05-23 14:57:08.000000000 +0530
+++ linux-2.6.25.3-2/kernel/kexec.c	2008-05-23 15:00:41.000000000 +0530
@@ -1068,7 +1068,8 @@
 	/* Don't allow clients that don't understand the native
 	 * architecture to do anything.
 	 */
-	if ((flags & KEXEC_ARCH_MASK) == KEXEC_ARCH_DEFAULT)
+	if (((flags & KEXEC_ARCH_MASK) != KEXEC_ARCH) &&
+		((flags & KEXEC_ARCH_MASK) != KEXEC_ARCH_DEFAULT))
 		return -EINVAL;
 
 	if (nr_segments > KEXEC_SEGMENT_MAX)

             reply	other threads:[~2008-05-23 11:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-23 11:36 Sharyathi Nagesh [this message]
2008-05-23 20:14 ` correction to compat_sys_kexec_load Eric W. Biederman
2008-05-23 20:14   ` Eric W. Biederman
2008-05-23 21:33   ` Bernhard Walle
2008-05-23 21:33     ` Bernhard Walle
2008-05-24  0:36     ` Eric W. Biederman
2008-05-24  0:36       ` Eric W. Biederman
2008-05-26 20:32       ` Bernhard Walle
2008-05-26 20:32         ` Bernhard Walle
2008-05-28  4:39         ` Sharyathi Nagesh
2008-05-28  4:39           ` Sharyathi Nagesh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4836AC3C.3090005@in.ibm.com \
    --to=sharyath@in.ibm.com \
    --cc=IndhuDurai@in.ibm.com \
    --cc=akpm@osdl.org \
    --cc=ebiederm@xmission.com \
    --cc=fastboot@lists.osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maneesh@in.ltcfwd.linux.ibm.com \
    --cc=mohan@in.ibm.com \
    --cc=mohd.omar@in.ibm.com \
    --cc=sachinp@in.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.