Dmitry Trikoz | 24 May 19:26
Picon

Kexec corrupts command line in x86-linux-setup.c setup_edd_info()

Hi,
I've been chasing strange problem with kdump kernel. It was crashing on 
boot without any messages to the console.
Finally I found that kdump kernel command line was corrupt.
Digging down I found the problem in  setup_edd_info() and 
add_edd_entry(). It doesn't check for array size of
real_mode->eddbuf[] and real_mode->edd_mbr_sig_buffer[]
So when it overruns eddbuf[] it corrupts command_line that follows it.

Here is the fix:

--- a/kexec-tools/kexec/arch/i386/x86-linux-setup.c
+++ b/kexec-tools/kexec/arch/i386/x86-linux-setup.c
@@ -275,9 +275,9 @@ static int add_edd_entry(struct 
x86_linux_param_header *real_mode,
                                 "must not be NULL", __FUNCTION__);
                 return -1;
         }
-
-       edd_info = &real_mode->eddbuf[*current_edd];
-       memset(edd_info, 0, sizeof(struct edd_info));
+       if (*current_mbr >= EDD_MBR_SIG_MAX) {
+               return 0;
+       }

         /* extract the device number */
         if (sscanf(basename(sysfs_name), "int13_dev%hhx", &devnum) != 1) {
@@ -293,12 +293,21 @@ static int add_edd_entry(struct 
x86_linux_param_header *real_mode,
                 dbgprintf("EDD Device 0x%x: mbr_sig=0x%x\n", devnum, 
(Continue reading)

maximilian attems | 22 May 18:59
Picon

[PATCH v2] kexec: simply pass LINUX_REBOOT_CMD_KEXEC to reboot

While trying to port kexec cleanly to klibc,
came across this syscall usage for reboot(2).
Calling reboot directly simplifies the code.

Signed-off-by: maximilian attems <max@...>
---
 kexec/kexec-syscall.h |   18 ------------------
 kexec/kexec.c         |    3 ++-
 2 files changed, 2 insertions(+), 19 deletions(-)

v2: keep LINUX_REBOOT_CMD_KEXEC defines, thus no need of <linux/reboot.h>.
    (The packagers don't like linux header deps..)

The next TODO item is to add proper syscall kexec_load() to glibc.
Funnily here klibc has an head start! -maks

diff --git a/kexec/kexec-syscall.h b/kexec/kexec-syscall.h
index f4df45c..b56cb00 100644
--- a/kexec/kexec-syscall.h
+++ b/kexec/kexec-syscall.h
@@ -5,18 +5,6 @@
 #include <sys/syscall.h>
 #include <unistd.h>

-#define	LINUX_REBOOT_MAGIC1	0xfee1dead
-#define	LINUX_REBOOT_MAGIC2	672274793
-#define	LINUX_REBOOT_MAGIC2A	85072278
-#define	LINUX_REBOOT_MAGIC2B	369367448
-
-#define	LINUX_REBOOT_CMD_RESTART	0x01234567
(Continue reading)

maximilian attems | 22 May 18:09
Picon

[PATCH] kexec: simply pass LINUX_REBOOT_CMD_KEXEC to reboot

While trying to port kexec cleanly to klibc,
came across this syscall usage for reboot(2).
Calling reboot directly simplifies the code.

Signed-off-by: maximilian attems <max@...>
---
 kexec/kexec-syscall.h |   20 --------------------
 kexec/kexec.c         |    4 +++-
 2 files changed, 3 insertions(+), 21 deletions(-)

The next TODO item is to add proper syscall kexec_load() to glibc.
Funnily here klibc has an head start! -maks

diff --git a/kexec/kexec-syscall.h b/kexec/kexec-syscall.h
index f4df45c..415fbd7 100644
--- a/kexec/kexec-syscall.h
+++ b/kexec/kexec-syscall.h
@@ -5,22 +5,6 @@
 #include <sys/syscall.h>
 #include <unistd.h>

-#define	LINUX_REBOOT_MAGIC1	0xfee1dead
-#define	LINUX_REBOOT_MAGIC2	672274793
-#define	LINUX_REBOOT_MAGIC2A	85072278
-#define	LINUX_REBOOT_MAGIC2B	369367448
-
-#define	LINUX_REBOOT_CMD_RESTART	0x01234567
-#define	LINUX_REBOOT_CMD_HALT		0xCDEF0123
-#define	LINUX_REBOOT_CMD_CAD_ON		0x89ABCDEF
-#define	LINUX_REBOOT_CMD_CAD_OFF	0x00000000
(Continue reading)

Baruch Even | 20 May 02:00

[PATCH] Use HOSTCC for build utilities

Subject: [PATCH] Use HOSTCC for build utilities

bin-to-hex is used during the build and needs to be compiled with the host
compiler to be able to run during the build.

Signed-off-by: Baruch Even <baruch@...>
---
 util/Makefile |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/util/Makefile b/util/Makefile
index 948ee63..82c7407 100644
--- a/util/Makefile
+++ b/util/Makefile
@@ -4,8 +4,8 @@ $(BIN_TO_HEX): $(srcdir)/util/bin-to-hex.c
 	@$(MKDIR) -p $(@D)
 	$(LINK.o) $(CFLAGS) -o $@ $^

-$(BIN_TO_HEX): CC=$(BUILD_CC)
-$(BIN_TO_HEX): CFLAGS=$(BUILD_CFLAGS)
+$(BIN_TO_HEX): CC=$(HOSTCC)
+$(BIN_TO_HEX): CFLAGS=$(HOST_CFLAGS)
 $(BIN_TO_HEX): LDFLAGS=

 dist += util/Makefile util/bin-to-hex.c
--

-- 
1.7.10
Cerda, Weston | 18 May 09:33
Picon
Favicon

Your Mailbox Is Almost Full

Your Mailbox Is Almost Full "CLICK
HERE<https://docs.google.com/spreadsheet/viewform?formkey=dE1tZWZNRzVyalFmbG9JOUNERzF5enc6MQ>"
Update Your MailBox And Increase Your Account. Thanks System Administrator.
Atsushi Kumagai | 16 May 06:39
Picon
Picon

Re: 答复: a bug of "arch/x86_64.c"

Hello Zhangfengwei,

On Tue, 15 May 2012 10:11:30 +0800
Zhangfengwei <fngw.zhang <at> huawei.com> wrote:

> Thank you for your reply.
> I have a patch which is similar to the patch offered by Norbert,which also
> supports xen4.
> I can offered two patchs which are from both mine and Norbert's. 
> 1) The firt one solve the problem: makekdumpfile supports xen4.
> 2) The second reduce the restart time when a machine with a huge amount of
> domU memory crashes

Thank you for your proposal.

I asked Norbert to repost new patches to kexec-ML in another thread.
Could you advise on them when Norbert posts new patches ?

Thanks
Atsushi Kumagai

> 
> -----邮件原件-----
> 发件人: Atsushi Kumagai [mailto:kumagai-atsushi <at> mxc.nes.nec.co.jp] 
> 发送时间: 2012年5月14日 13:10
> 收件人: kexec <at> lists.infradead.org; fngw.zhang <at> huawei.com;
> oomichi <at> mxs.nes.nec.co.jp
> 抄送: Norbert.Trapp <at> ts.fujitsu.com
> 主题: Re: a bug of "arch/x86_64.c"
> 
(Continue reading)

Atsushi Kumagai | 16 May 06:39
Picon
Picon

Re: a bug of "arch/x86_64.c"

Hello Norbert,

On Mon, 14 May 2012 16:28:49 +0200
"Trapp, Norbert" <norbert.trapp <at> ts.fujitsu.com> wrote:

> Dear Kumagai-San,
> 
> the relevant functions for xen4 in makedumpfile
> for saving just the xen and dom0 pages are
> exclude_xen4_user_domain and kvtop_xen_x86_64.
> Our current version of kvtop_xen_x86_64 also
> tries to check for 1GB pages and reads the page
> list faster like the crash utility does.
> I send you our current versions.
> 
> As was suggested I sent the implementation to the
> xen mailing list last year but didn't get any answer.

I'm sorry for late reply.

> We check the core file data to find out whether
> it is a xen3 or a xen4 dump and then the xen3
> or xen4 functions get called. Alternatively
> there could be #ifdefs but I do not know how
> the makedumpfile rpms would then be produced.
> Probably the xen3 code should not yet be removed.
> 
> Also we only implemented xen4 for x86_64.
> Maybe there should be an error message for
> other architectures as long as nobody hands in
(Continue reading)

andrew | 14 May 09:48

Re: Payment of Accrued Interest via Certified ATM System (ATMs) Vide Circular No: EC/11/09/8537W

ECOWAS Sub-Headquarters
7 Rue Du La Rouge, Cotonou
Republic of Benin

To the Beneficiary

Contract Ref: ECS/28H/1745/PED11-13.

Attn

Re: Payment of Accrued Interest via Certified ATM System (ATMs) Vide Circular
No: EC/11/09/8537W

Your immediate attention is hereby drawn to the circular referenced
above.Please be informed that following ECOWAS Council Resolution
No.EC/10023/FM48/PED-7/11, the Debt Settlement and Finance Office has been
directed to liquidate the accrued interest on payment due to the contract
beneficiary here above referred. Following the mandate, the accumulated
interest on payment has been calculated at prevailing exchange rate to date,
and valued at, Three million, two hundred and eighty seven
thousand,five hundred and sixty-nine point four cents
(3,287,569.04)independent of withdrawal means postage.

As detailed in the prior contract agreement, the process for sequenced timely
withdrawal of accrued interest via accredited ATM System have now been
completed for your locality. Reconfirmation of beneficiary’s details and
receipt of statutory postage and handling charge of $580.50 will be followed
by postage of universal Switch ATM Card with activating serial number; 4-digit
pin code, and limit instructions). Reconfirm your secure postage address
including direct contact telephone, and beneficiaries name as you would want
(Continue reading)

Cong Wang | 14 May 08:34
Picon
Favicon

[v2 PATCH] ppc: move DEBUG code to --debug

From: Cong Wang <xiyou.wangcong@...>

From: Cong Wang <xiyou.wangcong@...>
V2: Fix a compile error

Like commit 28d4ab53280853d2aeefdfb7c369331e89ab9ac2
("Add generic debug option"), this one moves code
under #if DEBUG to --debug on ppc arch.

Sorry that I still can't find a ppc32 machine to test this.

Cc: Simon Horman <horms@...>
Signed-off-by: Cong Wang <xiyou.wangcong@...>
---
 kexec/arch/ppc/crashdump-powerpc.c |   18 ++++++++----------
 kexec/arch/ppc/fixup_dtb.c         |   32 ++++++++++++++------------------
 kexec/arch/ppc/fs2dt.c             |    6 +++---
 kexec/arch/ppc/kexec-ppc.c         |   17 ++++++++---------
 kexec/arch/ppc/libfdt-wrapper.c    |    4 ++--
 kexec/arch/ppc64/crashdump-ppc64.c |   16 ++++++----------
 kexec/arch/ppc64/kexec-elf-ppc64.c |   23 +++++++++++------------
 kexec/arch/ppc64/kexec-ppc64.c     |    9 +++------
 8 files changed, 55 insertions(+), 70 deletions(-)

diff --git a/kexec/arch/ppc/crashdump-powerpc.c b/kexec/arch/ppc/crashdump-powerpc.c
index 7c9dbff..1bef69b 100644
--- a/kexec/arch/ppc/crashdump-powerpc.c
+++ b/kexec/arch/ppc/crashdump-powerpc.c
@@ -226,15 +226,15 @@ static int get_crash_memory_ranges(struct memory_range **range, int *ranges)

(Continue reading)

HATAYAMA Daisuke | 14 May 07:44
Favicon

Re: makedumpfile memory usage grows with system memory size

From: Atsushi Kumagai <kumagai-atsushi@...>
Subject: Re: makedumpfile memory usage grows with system memory size
Date: Fri, 27 Apr 2012 16:46:49 +0900

>     - Now, the prototype doesn't support PG_buddy because the value of PG_buddy
>       is different depending on kernel configuration and it isn't stored into 
>       VMCOREINFO. However, I'll extend get_length_of_free_pages() for PG_buddy 
>       when the value of PG_buddy is stored into VMCOREINFO.

Hello Kumagai san,

I'm now investigating how to perform filtering free pages without
kernel debuginfo. For this, I've investigated which of PG_buddy and
_mapcount to use in kernel versions. In the current conclusion, it's
reasonable to do that as shown in the following table.

| kernel version   |  Use PG_buddy? or _mapcount?                             |
|------------------+----------------------------------------------------------|
| 2.6.15 -- 2.6.16 | offsetof(page,_mapcount):=sizeof(ulong)+sizeof(atomic_t) |
| 2.6.17 -- 2.6.26 |        PG_buddy := 19                                    |
| 2.6.27 -- 2.6.36 |        PG_buddy := 18                                    |
| 2.6.37 and later | offsetof(page,_mapcount):= under investigation           |                                           |

In summary: PG_buddy was first introduced at 2.6.17 as 19 to fix some
race bug leading to lru list corruptions, and from 2.6.17 to 2.6.26,
it had been defined using macro preprocessor. At 2.6.27 enum pageflags
was introduced for ease of page flags maintainance and its value
changed to 18. At 2.6.37, it was removed, and it no longer exists in
later kernel versions.

(Continue reading)

Ken'ichi Ohmichi | 14 May 01:39
Picon
Picon

Re: a bug of "arch/x86_64.c"


Hi Zhangfengwei,

Thank you for your patch.
I'm out of makedumpfile development, and the maintainer is Kumagai-San now.
So he will review this patch.

Kumagai-San, can you review this patch ?

Thanks
Ken'ichi Ohmichi

---

On Thu, 10 May 2012 20:07:33 +0800
Zhangfengwei <fngw.zhang@...> wrote:
>
> Hello,
>      I find a bug of makedumpfile in a server with pages of 4KB,2MB and 1GB
> .
>      The reason:
>      When we get physical address by " kvtop_xen_x86_64()",Sometimes it is
> wrong;
> because the address maybe is an address of a page of 1GB ,when we get the
> physical address of L3 by L4.
> so we should judge if the address is in a page of 1GB ,which is the same
> with xen does.
> 
> The xen codes(4.1.2) like this: 
> in do_page_walk() of mm.c it does: if ( (l3e_get_flags(l3e) & _PAGE_PSE) )
(Continue reading)


Gmane