You can subscribe to this list here.
| 1999 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(15) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2000 |
Jan
(6) |
Feb
(1) |
Mar
(39) |
Apr
(13) |
May
(24) |
Jun
(11) |
Jul
(23) |
Aug
(85) |
Sep
(12) |
Oct
(103) |
Nov
(79) |
Dec
(112) |
| 2001 |
Jan
(52) |
Feb
(82) |
Mar
(84) |
Apr
(65) |
May
(105) |
Jun
(188) |
Jul
(174) |
Aug
(182) |
Sep
(103) |
Oct
(137) |
Nov
(143) |
Dec
(98) |
| 2002 |
Jan
(258) |
Feb
(236) |
Mar
(386) |
Apr
(307) |
May
(238) |
Jun
(170) |
Jul
(252) |
Aug
(230) |
Sep
(278) |
Oct
(394) |
Nov
(336) |
Dec
(194) |
| 2003 |
Jan
(290) |
Feb
(182) |
Mar
(175) |
Apr
(220) |
May
(209) |
Jun
(286) |
Jul
(279) |
Aug
(164) |
Sep
(208) |
Oct
(324) |
Nov
(204) |
Dec
(380) |
| 2004 |
Jan
(344) |
Feb
(332) |
Mar
(395) |
Apr
(357) |
May
(349) |
Jun
(352) |
Jul
(279) |
Aug
(269) |
Sep
(374) |
Oct
(442) |
Nov
(428) |
Dec
(253) |
| 2005 |
Jan
(225) |
Feb
(219) |
Mar
(245) |
Apr
(249) |
May
(203) |
Jun
(157) |
Jul
(171) |
Aug
(194) |
Sep
(200) |
Oct
(232) |
Nov
(190) |
Dec
(195) |
| 2006 |
Jan
(158) |
Feb
(190) |
Mar
(235) |
Apr
(161) |
May
(134) |
Jun
(169) |
Jul
(117) |
Aug
(161) |
Sep
(170) |
Oct
(297) |
Nov
(230) |
Dec
(205) |
| 2007 |
Jan
(197) |
Feb
(132) |
Mar
(151) |
Apr
(97) |
May
(109) |
Jun
(99) |
Jul
(57) |
Aug
(110) |
Sep
(56) |
Oct
(119) |
Nov
(39) |
Dec
(45) |
| 2008 |
Jan
(101) |
Feb
(116) |
Mar
(141) |
Apr
(98) |
May
(133) |
Jun
(61) |
Jul
(43) |
Aug
(76) |
Sep
(20) |
Oct
(32) |
Nov
(22) |
Dec
(41) |
| 2009 |
Jan
(35) |
Feb
(15) |
Mar
(18) |
Apr
(13) |
May
(13) |
Jun
(26) |
Jul
(12) |
Aug
(32) |
Sep
(21) |
Oct
(41) |
Nov
(35) |
Dec
(12) |
| 2010 |
Jan
(3) |
Feb
(35) |
Mar
(28) |
Apr
(20) |
May
(5) |
Jun
(14) |
Jul
(6) |
Aug
(8) |
Sep
(20) |
Oct
(20) |
Nov
(10) |
Dec
(12) |
| 2011 |
Jan
(14) |
Feb
(10) |
Mar
(14) |
Apr
(14) |
May
(13) |
Jun
(43) |
Jul
(13) |
Aug
(50) |
Sep
(30) |
Oct
(23) |
Nov
(15) |
Dec
(49) |
| 2012 |
Jan
(15) |
Feb
(28) |
Mar
(7) |
Apr
|
May
(12) |
Jun
(13) |
Jul
(28) |
Aug
(11) |
Sep
(19) |
Oct
(27) |
Nov
(5) |
Dec
(25) |
| 2013 |
Jan
(18) |
Feb
(19) |
Mar
(56) |
Apr
(26) |
May
(38) |
Jun
(24) |
Jul
(42) |
Aug
(24) |
Sep
(4) |
Oct
(3) |
Nov
(18) |
Dec
(4) |
| 2014 |
Jan
(10) |
Feb
(9) |
Mar
(3) |
Apr
|
May
(12) |
Jun
(34) |
Jul
(8) |
Aug
(18) |
Sep
(3) |
Oct
(27) |
Nov
(2) |
Dec
(1) |
| 2015 |
Jan
|
Feb
(10) |
Mar
(49) |
Apr
(2) |
May
(4) |
Jun
(7) |
Jul
(1) |
Aug
(17) |
Sep
(7) |
Oct
(35) |
Nov
(40) |
Dec
(4) |
| 2016 |
Jan
(9) |
Feb
|
Mar
(6) |
Apr
|
May
(10) |
Jun
(2) |
Jul
|
Aug
|
Sep
(5) |
Oct
|
Nov
|
Dec
(1) |
| 2017 |
Jan
(2) |
Feb
(4) |
Mar
(1) |
Apr
(4) |
May
(31) |
Jun
(9) |
Jul
(1) |
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
(2) |
| 2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
(4) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Richard W. <ri...@no...> - 2014-07-23 22:24:41
|
Himangi,
Am 19.07.2014 13:34, schrieb Himangi Saraogi:
> alloc_bootmem and related functions never return NULL. Thus a NULL
> test or memset after calls to these functions is unnecessary.
>
> The following Coccinelle semantic patch was used for making the change:
>
> @@
> expression E;
> statement S;
> @@
>
> E = \(alloc_bootmem\|alloc_bootmem_low\|alloc_bootmem_pages\|alloc_bootmem_low_pages\)(...)
> ... when != E
> - if (E == NULL) S
>
> Signed-off-by: Himangi Saraogi <him...@gm...>
> Acked-by: Julia Lawall <jul...@li...>
Thank you! All three patches are now queued for 3.17.
Thanks,
//richard
> ---
> arch/um/drivers/net_kern.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c
> index 7d26d9c..f70dd54 100644
> --- a/arch/um/drivers/net_kern.c
> +++ b/arch/um/drivers/net_kern.c
> @@ -659,10 +659,6 @@ static int __init eth_setup(char *str)
> }
>
> new = alloc_bootmem(sizeof(*new));
> - if (new == NULL) {
> - printk(KERN_ERR "eth_init : alloc_bootmem failed\n");
> - return 1;
> - }
>
> INIT_LIST_HEAD(&new->list);
> new->index = n;
>
|
|
From: Richard W. <ri...@si...> - 2014-07-21 14:20:59
|
From: Richard Weinberger <ri...@no...>
Use the more generic functions get_signal() signal_setup_done()
for signal delivery.
Signed-off-by: Richard Weinberger <ri...@no...>
---
arch/um/include/shared/frame_kern.h | 12 ++++------
arch/um/kernel/signal.c | 27 +++++++++-------------
arch/x86/um/signal.c | 45 +++++++++++++++++--------------------
3 files changed, 36 insertions(+), 48 deletions(-)
diff --git a/arch/um/include/shared/frame_kern.h b/arch/um/include/shared/frame_kern.h
index f2ca570..a5cde5c 100644
--- a/arch/um/include/shared/frame_kern.h
+++ b/arch/um/include/shared/frame_kern.h
@@ -6,14 +6,10 @@
#ifndef __FRAME_KERN_H_
#define __FRAME_KERN_H_
-extern int setup_signal_stack_sc(unsigned long stack_top, int sig,
- struct k_sigaction *ka,
- struct pt_regs *regs,
- sigset_t *mask);
-extern int setup_signal_stack_si(unsigned long stack_top, int sig,
- struct k_sigaction *ka,
- struct pt_regs *regs, struct siginfo *info,
- sigset_t *mask);
+extern int setup_signal_stack_sc(unsigned long stack_top, struct ksignal *ksig,
+ struct pt_regs *regs, sigset_t *mask);
+extern int setup_signal_stack_si(unsigned long stack_top, struct ksignal *ksig,
+ struct pt_regs *regs, sigset_t *mask);
#endif
diff --git a/arch/um/kernel/signal.c b/arch/um/kernel/signal.c
index f57e02e..4f60e4a 100644
--- a/arch/um/kernel/signal.c
+++ b/arch/um/kernel/signal.c
@@ -18,8 +18,7 @@ EXPORT_SYMBOL(unblock_signals);
/*
* OK, we're invoking a handler
*/
-static void handle_signal(struct pt_regs *regs, unsigned long signr,
- struct k_sigaction *ka, struct siginfo *info)
+static void handle_signal(struct ksignal *ksig, struct pt_regs *regs)
{
sigset_t *oldset = sigmask_to_save();
int singlestep = 0;
@@ -39,7 +38,7 @@ static void handle_signal(struct pt_regs *regs, unsigned long signr,
break;
case -ERESTARTSYS:
- if (!(ka->sa.sa_flags & SA_RESTART)) {
+ if (!(ksig->ka.sa.sa_flags & SA_RESTART)) {
PT_REGS_SYSCALL_RET(regs) = -EINTR;
break;
}
@@ -52,32 +51,28 @@ static void handle_signal(struct pt_regs *regs, unsigned long signr,
}
sp = PT_REGS_SP(regs);
- if ((ka->sa.sa_flags & SA_ONSTACK) && (sas_ss_flags(sp) == 0))
+ if ((ksig->ka.sa.sa_flags & SA_ONSTACK) && (sas_ss_flags(sp) == 0))
sp = current->sas_ss_sp + current->sas_ss_size;
#ifdef CONFIG_ARCH_HAS_SC_SIGNALS
- if (!(ka->sa.sa_flags & SA_SIGINFO))
- err = setup_signal_stack_sc(sp, signr, ka, regs, oldset);
+ if (!(ksig->ka.sa.sa_flags & SA_SIGINFO))
+ err = setup_signal_stack_sc(sp, ksig, regs, oldset);
else
#endif
- err = setup_signal_stack_si(sp, signr, ka, regs, info, oldset);
+ err = setup_signal_stack_si(sp, ksig, regs, oldset);
- if (err)
- force_sigsegv(signr, current);
- else
- signal_delivered(signr, info, ka, regs, singlestep);
+ signal_setup_done(err, ksig, singlestep);
}
static int kern_do_signal(struct pt_regs *regs)
{
- struct k_sigaction ka_copy;
- struct siginfo info;
- int sig, handled_sig = 0;
+ struct ksignal ksig;
+ int handled_sig = 0;
- while ((sig = get_signal_to_deliver(&info, &ka_copy, regs, NULL)) > 0) {
+ while (get_signal(&ksig)) {
handled_sig = 1;
/* Whee! Actually deliver the signal. */
- handle_signal(regs, sig, &ka_copy, &info);
+ handle_signal(&ksig, regs);
}
/* Did we come from a system call? */
diff --git a/arch/x86/um/signal.c b/arch/x86/um/signal.c
index 5e04a1c..79d8245 100644
--- a/arch/x86/um/signal.c
+++ b/arch/x86/um/signal.c
@@ -370,13 +370,12 @@ struct rt_sigframe
char retcode[8];
};
-int setup_signal_stack_sc(unsigned long stack_top, int sig,
- struct k_sigaction *ka, struct pt_regs *regs,
- sigset_t *mask)
+int setup_signal_stack_sc(unsigned long stack_top, struct ksignal *ksig,
+ struct pt_regs *regs, sigset_t *mask)
{
struct sigframe __user *frame;
void __user *restorer;
- int err = 0;
+ int err = 0, sig = ksig->sig;
/* This is the same calculation as i386 - ((sp + 4) & 15) == 0 */
stack_top = ((stack_top + 4) & -16UL) - 4;
@@ -385,8 +384,8 @@ int setup_signal_stack_sc(unsigned long stack_top, int sig,
return 1;
restorer = frame->retcode;
- if (ka->sa.sa_flags & SA_RESTORER)
- restorer = ka->sa.sa_restorer;
+ if (ksig->ka.sa.sa_flags & SA_RESTORER)
+ restorer = ksig->ka.sa.sa_restorer;
err |= __put_user(restorer, &frame->pretcode);
err |= __put_user(sig, &frame->sig);
@@ -410,20 +409,19 @@ int setup_signal_stack_sc(unsigned long stack_top, int sig,
return err;
PT_REGS_SP(regs) = (unsigned long) frame;
- PT_REGS_IP(regs) = (unsigned long) ka->sa.sa_handler;
+ PT_REGS_IP(regs) = (unsigned long) ksig->ka.sa.sa_handler;
PT_REGS_AX(regs) = (unsigned long) sig;
PT_REGS_DX(regs) = (unsigned long) 0;
PT_REGS_CX(regs) = (unsigned long) 0;
return 0;
}
-int setup_signal_stack_si(unsigned long stack_top, int sig,
- struct k_sigaction *ka, struct pt_regs *regs,
- siginfo_t *info, sigset_t *mask)
+int setup_signal_stack_si(unsigned long stack_top, struct ksignal *ksig,
+ struct pt_regs *regs, sigset_t *mask)
{
struct rt_sigframe __user *frame;
void __user *restorer;
- int err = 0;
+ int err = 0, sig = ksig->sig;
stack_top &= -8UL;
frame = (struct rt_sigframe __user *) stack_top - 1;
@@ -431,14 +429,14 @@ int setup_signal_stack_si(unsigned long stack_top, int sig,
return 1;
restorer = frame->retcode;
- if (ka->sa.sa_flags & SA_RESTORER)
- restorer = ka->sa.sa_restorer;
+ if (ksig->ka.sa.sa_flags & SA_RESTORER)
+ restorer = ksig->ka.sa.sa_restorer;
err |= __put_user(restorer, &frame->pretcode);
err |= __put_user(sig, &frame->sig);
err |= __put_user(&frame->info, &frame->pinfo);
err |= __put_user(&frame->uc, &frame->puc);
- err |= copy_siginfo_to_user(&frame->info, info);
+ err |= copy_siginfo_to_user(&frame->info, &ksig->info);
err |= copy_ucontext_to_user(&frame->uc, &frame->fpstate, mask,
PT_REGS_SP(regs));
@@ -457,7 +455,7 @@ int setup_signal_stack_si(unsigned long stack_top, int sig,
return err;
PT_REGS_SP(regs) = (unsigned long) frame;
- PT_REGS_IP(regs) = (unsigned long) ka->sa.sa_handler;
+ PT_REGS_IP(regs) = (unsigned long) ksig->ka.sa.sa_handler;
PT_REGS_AX(regs) = (unsigned long) sig;
PT_REGS_DX(regs) = (unsigned long) &frame->info;
PT_REGS_CX(regs) = (unsigned long) &frame->uc;
@@ -502,12 +500,11 @@ struct rt_sigframe
struct _fpstate fpstate;
};
-int setup_signal_stack_si(unsigned long stack_top, int sig,
- struct k_sigaction *ka, struct pt_regs * regs,
- siginfo_t *info, sigset_t *set)
+int setup_signal_stack_si(unsigned long stack_top, struct ksignal *ksig,
+ struct pt_regs *regs, sigset_t *set)
{
struct rt_sigframe __user *frame;
- int err = 0;
+ int err = 0, sig = ksig->sig;
frame = (struct rt_sigframe __user *)
round_down(stack_top - sizeof(struct rt_sigframe), 16);
@@ -517,8 +514,8 @@ int setup_signal_stack_si(unsigned long stack_top, int sig,
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
goto out;
- if (ka->sa.sa_flags & SA_SIGINFO) {
- err |= copy_siginfo_to_user(&frame->info, info);
+ if (ksig->ka.sa.sa_flags & SA_SIGINFO) {
+ err |= copy_siginfo_to_user(&frame->info, &ksig->info);
if (err)
goto out;
}
@@ -543,8 +540,8 @@ int setup_signal_stack_si(unsigned long stack_top, int sig,
* already in userspace.
*/
/* x86-64 should always use SA_RESTORER. */
- if (ka->sa.sa_flags & SA_RESTORER)
- err |= __put_user(ka->sa.sa_restorer, &frame->pretcode);
+ if (ksig->ka.sa.sa_flags & SA_RESTORER)
+ err |= __put_user(ksig->ka.sa.sa_restorer, &frame->pretcode);
else
/* could use a vstub here */
return err;
@@ -570,7 +567,7 @@ int setup_signal_stack_si(unsigned long stack_top, int sig,
*/
PT_REGS_SI(regs) = (unsigned long) &frame->info;
PT_REGS_DX(regs) = (unsigned long) &frame->uc;
- PT_REGS_IP(regs) = (unsigned long) ka->sa.sa_handler;
+ PT_REGS_IP(regs) = (unsigned long) ksig->ka.sa.sa_handler;
out:
return err;
}
--
1.8.4.5
|
|
From: Himangi S. <him...@gm...> - 2014-07-19 11:34:20
|
alloc_bootmem and related functions never return NULL. Thus a NULL
test or memset after calls to these functions is unnecessary.
The following Coccinelle semantic patch was used for making the change:
@@
expression E;
statement S;
@@
E = \(alloc_bootmem\|alloc_bootmem_low\|alloc_bootmem_pages\|alloc_bootmem_low_pages\)(...)
... when != E
- if (E == NULL) S
Signed-off-by: Himangi Saraogi <him...@gm...>
Acked-by: Julia Lawall <jul...@li...>
---
arch/um/drivers/net_kern.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c
index 7d26d9c..f70dd54 100644
--- a/arch/um/drivers/net_kern.c
+++ b/arch/um/drivers/net_kern.c
@@ -659,10 +659,6 @@ static int __init eth_setup(char *str)
}
new = alloc_bootmem(sizeof(*new));
- if (new == NULL) {
- printk(KERN_ERR "eth_init : alloc_bootmem failed\n");
- return 1;
- }
INIT_LIST_HEAD(&new->list);
new->index = n;
--
1.9.1
|
|
From: Himangi S. <him...@gm...> - 2014-07-19 11:33:30
|
alloc_bootmem and related functions never return NULL. Thus a NULL test after calls to these functions is unnecessary. The following Coccinelle semantic patch was used for making the change: @@ expression E; statement S; @@ E = \(alloc_bootmem\|alloc_bootmem_low\|alloc_bootmem_pages\|alloc_bootmem_low_pages\)(...) ... when != E - if (E == NULL) S Signed-off-by: Himangi Saraogi <him...@gm...> Acked-by: Julia Lawall <jul...@li...> --- arch/um/kernel/initrd.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/um/kernel/initrd.c b/arch/um/kernel/initrd.c index 55cead8..48bae81 100644 --- a/arch/um/kernel/initrd.c +++ b/arch/um/kernel/initrd.c @@ -37,8 +37,6 @@ static int __init read_initrd(void) } area = alloc_bootmem(size); - if (area == NULL) - return 0; if (load_initrd(initrd, area, size) == -1) return 0; -- 1.9.1 |
|
From: Himangi S. <him...@gm...> - 2014-07-19 11:32:10
|
alloc_bootmem and related functions never return NULL. Thus a NULL
test after calls to these functions is unnecessary.
The following Coccinelle semantic patch was used for making the change:
@@
expression E;
statement S;
@@
E = \(alloc_bootmem\|alloc_bootmem_low\|alloc_bootmem_pages\|alloc_bootmem_low_pages\)(...)
... when != E
- if (E == NULL) S
Signed-off-by: Himangi Saraogi <him...@gm...>
Acked-by: Julia Lawall <jul...@li...>
---
arch/um/kernel/physmem.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/arch/um/kernel/physmem.c b/arch/um/kernel/physmem.c
index 30fdd5d..fb041cf 100644
--- a/arch/um/kernel/physmem.c
+++ b/arch/um/kernel/physmem.c
@@ -43,8 +43,6 @@ int __init init_maps(unsigned long physmem, unsigned long iomem,
total_len = phys_len + iomem_len + highmem_len;
map = alloc_bootmem_low_pages(total_len);
- if (map == NULL)
- return -ENOMEM;
for (i = 0; i < total_pages; i++) {
p = &map[i];
--
1.9.1
|
|
From: Richard W. <ri...@no...> - 2014-07-18 07:34:17
|
Am 18.07.2014 01:13, schrieb Real Name:
> On Sat, Jun 28, 2014 at 12:06:28PM +0800, Real Name wrote:
>> On Sat, Jun 21, 2014 at 03:28:52PM +0800, Real Name wrote:
>>> On Thu, Jun 05, 2014 at 11:49:49PM +0200, Richard Weinberger wrote:
>>>> Am 05.06.2014 06:15, schrieb Honggang Li:
>>>>> arch/x86/um/checksum_32.S had been copy & paste from x86. When build
>>>>> x86 uml, csum_partial_copy_generic_i386 mess up the exception table.
>>>>> In fact, exception table dose not work in uml kernel.
>>>>
>>>> Are you sure that exception tables do not work on UML?
>>>> I said, I'm not sure. Can you please find out?
>>>
>>> Hi,
>>> After traced i386 uml kernel with gdb , I'm sure exception tables
>>> do *not* work. When csum_partial_copy_generic_i386 read user space memory,
>>> an access error exception arises, however, the segv function always
>>> return zero. So, the fixup nerver executed. The uml system hang (not
>>> kernel panic).
>>
>> The kernel hang because the SEGV signal handler can't modify the EIP
>> register in signal context.
>>
>> Here is the summary why exception table dose not works for linux (>3.3):
>> 1) broken exception table (706276543b699d80f546e45f8b12574e7b18d952)
>> 2) arch_fixup modify the local copy of regs.
>
> hi, Richard
> ping? are you agree with what i said?
>
Yeah, I think we can merge both of your patches in 3.17. :)
Thanks,
//richard
>>>
>>> thanks.
>>>
>>>>
>>>> In arch/um/kernel/trap.c:segv() we have the mechanism for it:
>>>> else if (!is_user && arch_fixup(ip, regs))
>>>> goto out;
>> 0) access invalid memory address in kernel (no mm for the address. it is
>> easy to force invalid memory acess in kernel. I cast 0x1234 as a void
>> pointer, and pass it to csum_partial_copy_generic_i386)
>> 1) SEGV signal arise
>> 1.1) hard_handler (arch/um/os-Linux/signal.c)
>> The third argument of hard_handler point to signal context.
>> 1.2) call sig_handler
>> 1.3) call sig_handler_common (dump the registers in signal context into
>> local var struct uml_pt_regs r.). line 36 is the key point why
>> exception table dose not works in UML.
>>
>> 34 if (sig == SIGSEGV) {
>> 35 /* For segfaults, we want the data from the sigcontext. */
>> 36 get_regs_from_mc(&r, mc);
>> 37 GET_FAULTINFO_FROM_MC(r.faultinfo, mc);
>> 38
>>
>> 1.4) call segv_handler (arch/um/kernel/trap.c)
>> 1.5) call segv
>> 1.6) call arch_fixup (arch/x86/um/fault.c)
>> 1.7) arch_fixup (UPT_IP(regs) = fixup->fixup;) set the EIP register of
>> local copy uml_pt_regs
>> 1.8) When function return to sig_handler, the EIP change lost
>> 1.9) When hard_handler signal handler return, it restore the EIP with
>> the address arise the SEGV in step 0. The fixup section never be
>> executed. If exception table works, UML kernel should run fixup code in
>> here.
>>
>> Then repeate step 0 to 1.9, kernel hang on.
>>
>> thanks
>>
>>>>
>>>> The interesting question is, is this by design or was it just copy&pasted from x86
>>>> many moons ago? :)
>>>>
>>>>> And csum_partial_copy_generic_i386 never been called. So, delete it.
>>>>
>>>> I like such clean ups. :-)
>>>>
>>>> Thanks,
>>>> //richard
|
|
From: Real N. <enj...@gm...> - 2014-07-17 23:13:42
|
On Sat, Jun 28, 2014 at 12:06:28PM +0800, Real Name wrote:
> On Sat, Jun 21, 2014 at 03:28:52PM +0800, Real Name wrote:
> > On Thu, Jun 05, 2014 at 11:49:49PM +0200, Richard Weinberger wrote:
> > > Am 05.06.2014 06:15, schrieb Honggang Li:
> > > > arch/x86/um/checksum_32.S had been copy & paste from x86. When build
> > > > x86 uml, csum_partial_copy_generic_i386 mess up the exception table.
> > > > In fact, exception table dose not work in uml kernel.
> > >
> > > Are you sure that exception tables do not work on UML?
> > > I said, I'm not sure. Can you please find out?
> >
> > Hi,
> > After traced i386 uml kernel with gdb , I'm sure exception tables
> > do *not* work. When csum_partial_copy_generic_i386 read user space memory,
> > an access error exception arises, however, the segv function always
> > return zero. So, the fixup nerver executed. The uml system hang (not
> > kernel panic).
>
> The kernel hang because the SEGV signal handler can't modify the EIP
> register in signal context.
>
> Here is the summary why exception table dose not works for linux (>3.3):
> 1) broken exception table (706276543b699d80f546e45f8b12574e7b18d952)
> 2) arch_fixup modify the local copy of regs.
hi, Richard
ping? are you agree with what i said?
> >
> > thanks.
> >
> > >
> > > In arch/um/kernel/trap.c:segv() we have the mechanism for it:
> > > else if (!is_user && arch_fixup(ip, regs))
> > > goto out;
> 0) access invalid memory address in kernel (no mm for the address. it is
> easy to force invalid memory acess in kernel. I cast 0x1234 as a void
> pointer, and pass it to csum_partial_copy_generic_i386)
> 1) SEGV signal arise
> 1.1) hard_handler (arch/um/os-Linux/signal.c)
> The third argument of hard_handler point to signal context.
> 1.2) call sig_handler
> 1.3) call sig_handler_common (dump the registers in signal context into
> local var struct uml_pt_regs r.). line 36 is the key point why
> exception table dose not works in UML.
>
> 34 if (sig == SIGSEGV) {
> 35 /* For segfaults, we want the data from the sigcontext. */
> 36 get_regs_from_mc(&r, mc);
> 37 GET_FAULTINFO_FROM_MC(r.faultinfo, mc);
> 38
>
> 1.4) call segv_handler (arch/um/kernel/trap.c)
> 1.5) call segv
> 1.6) call arch_fixup (arch/x86/um/fault.c)
> 1.7) arch_fixup (UPT_IP(regs) = fixup->fixup;) set the EIP register of
> local copy uml_pt_regs
> 1.8) When function return to sig_handler, the EIP change lost
> 1.9) When hard_handler signal handler return, it restore the EIP with
> the address arise the SEGV in step 0. The fixup section never be
> executed. If exception table works, UML kernel should run fixup code in
> here.
>
> Then repeate step 0 to 1.9, kernel hang on.
>
> thanks
>
> > >
> > > The interesting question is, is this by design or was it just copy&pasted from x86
> > > many moons ago? :)
> > >
> > > > And csum_partial_copy_generic_i386 never been called. So, delete it.
> > >
> > > I like such clean ups. :-)
> > >
> > > Thanks,
> > > //richard
|
|
From: Real N. <enj...@gm...> - 2014-06-28 04:06:42
|
On Sat, Jun 21, 2014 at 03:28:52PM +0800, Real Name wrote:
> On Thu, Jun 05, 2014 at 11:49:49PM +0200, Richard Weinberger wrote:
> > Am 05.06.2014 06:15, schrieb Honggang Li:
> > > arch/x86/um/checksum_32.S had been copy & paste from x86. When build
> > > x86 uml, csum_partial_copy_generic_i386 mess up the exception table.
> > > In fact, exception table dose not work in uml kernel.
> >
> > Are you sure that exception tables do not work on UML?
> > I said, I'm not sure. Can you please find out?
>
> Hi,
> After traced i386 uml kernel with gdb , I'm sure exception tables
> do *not* work. When csum_partial_copy_generic_i386 read user space memory,
> an access error exception arises, however, the segv function always
> return zero. So, the fixup nerver executed. The uml system hang (not
> kernel panic).
The kernel hang because the SEGV signal handler can't modify the EIP
register in signal context.
Here is the summary why exception table dose not works for linux (>3.3):
1) broken exception table (706276543b699d80f546e45f8b12574e7b18d952)
2) arch_fixup modify the local copy of regs.
>
> thanks.
>
> >
> > In arch/um/kernel/trap.c:segv() we have the mechanism for it:
> > else if (!is_user && arch_fixup(ip, regs))
> > goto out;
0) access invalid memory address in kernel (no mm for the address. it is
easy to force invalid memory acess in kernel. I cast 0x1234 as a void
pointer, and pass it to csum_partial_copy_generic_i386)
1) SEGV signal arise
1.1) hard_handler (arch/um/os-Linux/signal.c)
The third argument of hard_handler point to signal context.
1.2) call sig_handler
1.3) call sig_handler_common (dump the registers in signal context into
local var struct uml_pt_regs r.). line 36 is the key point why
exception table dose not works in UML.
34 if (sig == SIGSEGV) {
35 /* For segfaults, we want the data from the sigcontext. */
36 get_regs_from_mc(&r, mc);
37 GET_FAULTINFO_FROM_MC(r.faultinfo, mc);
38
1.4) call segv_handler (arch/um/kernel/trap.c)
1.5) call segv
1.6) call arch_fixup (arch/x86/um/fault.c)
1.7) arch_fixup (UPT_IP(regs) = fixup->fixup;) set the EIP register of
local copy uml_pt_regs
1.8) When function return to sig_handler, the EIP change lost
1.9) When hard_handler signal handler return, it restore the EIP with
the address arise the SEGV in step 0. The fixup section never be
executed. If exception table works, UML kernel should run fixup code in
here.
Then repeate step 0 to 1.9, kernel hang on.
thanks
> >
> > The interesting question is, is this by design or was it just copy&pasted from x86
> > many moons ago? :)
> >
> > > And csum_partial_copy_generic_i386 never been called. So, delete it.
> >
> > I like such clean ups. :-)
> >
> > Thanks,
> > //richard
|
|
From: Real N. <enj...@gm...> - 2014-06-21 07:29:07
|
On Thu, Jun 05, 2014 at 11:49:49PM +0200, Richard Weinberger wrote: > Am 05.06.2014 06:15, schrieb Honggang Li: > > arch/x86/um/checksum_32.S had been copy & paste from x86. When build > > x86 uml, csum_partial_copy_generic_i386 mess up the exception table. > > In fact, exception table dose not work in uml kernel. > > Are you sure that exception tables do not work on UML? > I said, I'm not sure. Can you please find out? Hi, After traced i386 uml kernel with gdb , I'm sure exception tables do *not* work. When csum_partial_copy_generic_i386 read user space memory, an access error exception arises, however, the segv function always return zero. So, the fixup nerver executed. The uml system hang (not kernel panic). thanks. > > In arch/um/kernel/trap.c:segv() we have the mechanism for it: > else if (!is_user && arch_fixup(ip, regs)) > goto out; > > The interesting question is, is this by design or was it just copy&pasted from x86 > many moons ago? :) > > > And csum_partial_copy_generic_i386 never been called. So, delete it. > > I like such clean ups. :-) > > Thanks, > //richard |
|
From: Andy L. <lu...@am...> - 2014-06-21 00:34:45
|
The core mm code will provide a default gate area based on
FIXADDR_USER_START and FIXADDR_USER_END if
!defined(__HAVE_ARCH_GATE_AREA) && defined(AT_SYSINFO_EHDR).
This default is only useful for ia64. arm64, ppc, s390, sh, tile,
64-bit UML, and x86_32 have their own code just to disable it. arm,
32-bit UML, and x86_64 have gate areas, but they have their own
implementations.
This gets rid of the default and moves the code into ia64.
This should save some code on architectures without a gate area: it's
now possible to inline the gate_area functions in the default case.
Signed-off-by: Andy Lutomirski <lu...@am...>
---
arch/arm64/include/asm/page.h | 3 ---
arch/arm64/kernel/vdso.c | 19 -------------------
arch/ia64/include/asm/page.h | 2 ++
arch/ia64/mm/init.c | 26 ++++++++++++++++++++++++++
arch/powerpc/include/asm/page.h | 3 ---
arch/powerpc/kernel/vdso.c | 16 ----------------
arch/s390/include/asm/page.h | 2 --
arch/s390/kernel/vdso.c | 15 ---------------
arch/sh/include/asm/page.h | 5 -----
arch/sh/kernel/vsyscall/vsyscall.c | 15 ---------------
arch/tile/include/asm/page.h | 6 ------
arch/tile/kernel/vdso.c | 15 ---------------
arch/um/include/asm/page.h | 5 +++++
arch/x86/include/asm/page.h | 1 -
arch/x86/include/asm/page_64.h | 2 ++
arch/x86/um/asm/elf.h | 1 -
arch/x86/um/mem_64.c | 15 ---------------
arch/x86/vdso/vdso32-setup.c | 19 +------------------
include/linux/mm.h | 17 ++++++++++++-----
mm/memory.c | 38 --------------------------------------
mm/nommu.c | 5 -----
21 files changed, 48 insertions(+), 182 deletions(-)
diff --git a/arch/arm64/include/asm/page.h b/arch/arm64/include/asm/page.h
index 46bf666..992710f 100644
--- a/arch/arm64/include/asm/page.h
+++ b/arch/arm64/include/asm/page.h
@@ -28,9 +28,6 @@
#define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT)
#define PAGE_MASK (~(PAGE_SIZE-1))
-/* We do define AT_SYSINFO_EHDR but don't use the gate mechanism */
-#define __HAVE_ARCH_GATE_AREA 1
-
#ifndef __ASSEMBLY__
#ifdef CONFIG_ARM64_64K_PAGES
diff --git a/arch/arm64/kernel/vdso.c b/arch/arm64/kernel/vdso.c
index 50384fe..f630626 100644
--- a/arch/arm64/kernel/vdso.c
+++ b/arch/arm64/kernel/vdso.c
@@ -187,25 +187,6 @@ const char *arch_vma_name(struct vm_area_struct *vma)
}
/*
- * We define AT_SYSINFO_EHDR, so we need these function stubs to keep
- * Linux happy.
- */
-int in_gate_area_no_mm(unsigned long addr)
-{
- return 0;
-}
-
-int in_gate_area(struct mm_struct *mm, unsigned long addr)
-{
- return 0;
-}
-
-struct vm_area_struct *get_gate_vma(struct mm_struct *mm)
-{
- return NULL;
-}
-
-/*
* Update the vDSO data page to keep in sync with kernel timekeeping.
*/
void update_vsyscall(struct timekeeper *tk)
diff --git a/arch/ia64/include/asm/page.h b/arch/ia64/include/asm/page.h
index f1e1b2e..1f1bf14 100644
--- a/arch/ia64/include/asm/page.h
+++ b/arch/ia64/include/asm/page.h
@@ -231,4 +231,6 @@ get_order (unsigned long size)
#define PERCPU_ADDR (-PERCPU_PAGE_SIZE)
#define LOAD_OFFSET (KERNEL_START - KERNEL_TR_PAGE_SIZE)
+#define __HAVE_ARCH_GATE_AREA 1
+
#endif /* _ASM_IA64_PAGE_H */
diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
index 25c3502..35efaa3 100644
--- a/arch/ia64/mm/init.c
+++ b/arch/ia64/mm/init.c
@@ -278,6 +278,32 @@ setup_gate (void)
ia64_patch_gate();
}
+static struct vm_area_struct gate_vma;
+
+static int __init gate_vma_init(void)
+{
+ gate_vma.vm_mm = NULL;
+ gate_vma.vm_start = FIXADDR_USER_START;
+ gate_vma.vm_end = FIXADDR_USER_END;
+ gate_vma.vm_flags = VM_READ | VM_MAYREAD | VM_EXEC | VM_MAYEXEC;
+ gate_vma.vm_page_prot = __P101;
+
+ return 0;
+}
+__initcall(gate_vma_init);
+
+struct vm_area_struct *get_gate_vma(struct mm_struct *mm)
+{
+ return &gate_vma;
+}
+
+int in_gate_area_no_mm(unsigned long addr)
+{
+ if ((addr >= FIXADDR_USER_START) && (addr < FIXADDR_USER_END))
+ return 1;
+ return 0;
+}
+
void ia64_mmu_init(void *my_cpu_data)
{
unsigned long pta, impl_va_bits;
diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h
index 32e4e21..26fe1ae 100644
--- a/arch/powerpc/include/asm/page.h
+++ b/arch/powerpc/include/asm/page.h
@@ -48,9 +48,6 @@ extern unsigned int HPAGE_SHIFT;
#define HUGE_MAX_HSTATE (MMU_PAGE_COUNT-1)
#endif
-/* We do define AT_SYSINFO_EHDR but don't use the gate mechanism */
-#define __HAVE_ARCH_GATE_AREA 1
-
/*
* Subtle: (1 << PAGE_SHIFT) is an int, not an unsigned long. So if we
* assign PAGE_MASK to a larger type it gets extended the way we want
diff --git a/arch/powerpc/kernel/vdso.c b/arch/powerpc/kernel/vdso.c
index ce74c33..f174351 100644
--- a/arch/powerpc/kernel/vdso.c
+++ b/arch/powerpc/kernel/vdso.c
@@ -840,19 +840,3 @@ static int __init vdso_init(void)
return 0;
}
arch_initcall(vdso_init);
-
-int in_gate_area_no_mm(unsigned long addr)
-{
- return 0;
-}
-
-int in_gate_area(struct mm_struct *mm, unsigned long addr)
-{
- return 0;
-}
-
-struct vm_area_struct *get_gate_vma(struct mm_struct *mm)
-{
- return NULL;
-}
-
diff --git a/arch/s390/include/asm/page.h b/arch/s390/include/asm/page.h
index 114258e..7b2ac6e 100644
--- a/arch/s390/include/asm/page.h
+++ b/arch/s390/include/asm/page.h
@@ -162,6 +162,4 @@ static inline int devmem_is_allowed(unsigned long pfn)
#include <asm-generic/memory_model.h>
#include <asm-generic/getorder.h>
-#define __HAVE_ARCH_GATE_AREA 1
-
#endif /* _S390_PAGE_H */
diff --git a/arch/s390/kernel/vdso.c b/arch/s390/kernel/vdso.c
index 6136490..0bbb7e0 100644
--- a/arch/s390/kernel/vdso.c
+++ b/arch/s390/kernel/vdso.c
@@ -316,18 +316,3 @@ static int __init vdso_init(void)
return 0;
}
early_initcall(vdso_init);
-
-int in_gate_area_no_mm(unsigned long addr)
-{
- return 0;
-}
-
-int in_gate_area(struct mm_struct *mm, unsigned long addr)
-{
- return 0;
-}
-
-struct vm_area_struct *get_gate_vma(struct mm_struct *mm)
-{
- return NULL;
-}
diff --git a/arch/sh/include/asm/page.h b/arch/sh/include/asm/page.h
index 15d9703..fe20d14 100644
--- a/arch/sh/include/asm/page.h
+++ b/arch/sh/include/asm/page.h
@@ -186,11 +186,6 @@ typedef struct page *pgtable_t;
#include <asm-generic/memory_model.h>
#include <asm-generic/getorder.h>
-/* vDSO support */
-#ifdef CONFIG_VSYSCALL
-#define __HAVE_ARCH_GATE_AREA
-#endif
-
/*
* Some drivers need to perform DMA into kmalloc'ed buffers
* and so we have to increase the kmalloc minalign for this.
diff --git a/arch/sh/kernel/vsyscall/vsyscall.c b/arch/sh/kernel/vsyscall/vsyscall.c
index 5ca5797..ea2aa13 100644
--- a/arch/sh/kernel/vsyscall/vsyscall.c
+++ b/arch/sh/kernel/vsyscall/vsyscall.c
@@ -92,18 +92,3 @@ const char *arch_vma_name(struct vm_area_struct *vma)
return NULL;
}
-
-struct vm_area_struct *get_gate_vma(struct mm_struct *mm)
-{
- return NULL;
-}
-
-int in_gate_area(struct mm_struct *mm, unsigned long address)
-{
- return 0;
-}
-
-int in_gate_area_no_mm(unsigned long address)
-{
- return 0;
-}
diff --git a/arch/tile/include/asm/page.h b/arch/tile/include/asm/page.h
index 6727680..a213a8d 100644
--- a/arch/tile/include/asm/page.h
+++ b/arch/tile/include/asm/page.h
@@ -39,12 +39,6 @@
#define HPAGE_MASK (~(HPAGE_SIZE - 1))
/*
- * We do define AT_SYSINFO_EHDR to support vDSO,
- * but don't use the gate mechanism.
- */
-#define __HAVE_ARCH_GATE_AREA 1
-
-/*
* If the Kconfig doesn't specify, set a maximum zone order that
* is enough so that we can create huge pages from small pages given
* the respective sizes of the two page types. See <linux/mmzone.h>.
diff --git a/arch/tile/kernel/vdso.c b/arch/tile/kernel/vdso.c
index 1533af2..5bc51d7 100644
--- a/arch/tile/kernel/vdso.c
+++ b/arch/tile/kernel/vdso.c
@@ -121,21 +121,6 @@ const char *arch_vma_name(struct vm_area_struct *vma)
return NULL;
}
-struct vm_area_struct *get_gate_vma(struct mm_struct *mm)
-{
- return NULL;
-}
-
-int in_gate_area(struct mm_struct *mm, unsigned long address)
-{
- return 0;
-}
-
-int in_gate_area_no_mm(unsigned long address)
-{
- return 0;
-}
-
int setup_vdso_pages(void)
{
struct page **pagelist;
diff --git a/arch/um/include/asm/page.h b/arch/um/include/asm/page.h
index 5ff53d9..71c5d13 100644
--- a/arch/um/include/asm/page.h
+++ b/arch/um/include/asm/page.h
@@ -119,4 +119,9 @@ extern unsigned long uml_physmem;
#include <asm-generic/getorder.h>
#endif /* __ASSEMBLY__ */
+
+#ifdef CONFIG_X86_32
+#define __HAVE_ARCH_GATE_AREA 1
+#endif
+
#endif /* __UM_PAGE_H */
diff --git a/arch/x86/include/asm/page.h b/arch/x86/include/asm/page.h
index 775873d..802dde3 100644
--- a/arch/x86/include/asm/page.h
+++ b/arch/x86/include/asm/page.h
@@ -70,7 +70,6 @@ extern bool __virt_addr_valid(unsigned long kaddr);
#include <asm-generic/memory_model.h>
#include <asm-generic/getorder.h>
-#define __HAVE_ARCH_GATE_AREA 1
#define HAVE_ARCH_HUGETLB_UNMAPPED_AREA
#endif /* __KERNEL__ */
diff --git a/arch/x86/include/asm/page_64.h b/arch/x86/include/asm/page_64.h
index 0f1ddee..f408caf 100644
--- a/arch/x86/include/asm/page_64.h
+++ b/arch/x86/include/asm/page_64.h
@@ -39,4 +39,6 @@ void copy_page(void *to, void *from);
#endif /* !__ASSEMBLY__ */
+#define __HAVE_ARCH_GATE_AREA 1
+
#endif /* _ASM_X86_PAGE_64_H */
diff --git a/arch/x86/um/asm/elf.h b/arch/x86/um/asm/elf.h
index 0feee2f..25a1022 100644
--- a/arch/x86/um/asm/elf.h
+++ b/arch/x86/um/asm/elf.h
@@ -216,6 +216,5 @@ extern long elf_aux_hwcap;
#define ELF_HWCAP (elf_aux_hwcap)
#define SET_PERSONALITY(ex) do ; while(0)
-#define __HAVE_ARCH_GATE_AREA 1
#endif
diff --git a/arch/x86/um/mem_64.c b/arch/x86/um/mem_64.c
index c6492e7..f8fecad 100644
--- a/arch/x86/um/mem_64.c
+++ b/arch/x86/um/mem_64.c
@@ -9,18 +9,3 @@ const char *arch_vma_name(struct vm_area_struct *vma)
return NULL;
}
-
-struct vm_area_struct *get_gate_vma(struct mm_struct *mm)
-{
- return NULL;
-}
-
-int in_gate_area(struct mm_struct *mm, unsigned long addr)
-{
- return 0;
-}
-
-int in_gate_area_no_mm(unsigned long addr)
-{
- return 0;
-}
diff --git a/arch/x86/vdso/vdso32-setup.c b/arch/x86/vdso/vdso32-setup.c
index e4f7781..e904c27 100644
--- a/arch/x86/vdso/vdso32-setup.c
+++ b/arch/x86/vdso/vdso32-setup.c
@@ -115,23 +115,6 @@ static __init int ia32_binfmt_init(void)
return 0;
}
__initcall(ia32_binfmt_init);
-#endif
-
-#else /* CONFIG_X86_32 */
-
-struct vm_area_struct *get_gate_vma(struct mm_struct *mm)
-{
- return NULL;
-}
-
-int in_gate_area(struct mm_struct *mm, unsigned long addr)
-{
- return 0;
-}
-
-int in_gate_area_no_mm(unsigned long addr)
-{
- return 0;
-}
+#endif /* CONFIG_SYSCTL */
#endif /* CONFIG_X86_64 */
diff --git a/include/linux/mm.h b/include/linux/mm.h
index e03dd29..8981cc8 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -2014,13 +2014,20 @@ static inline bool kernel_page_present(struct page *page) { return true; }
#endif /* CONFIG_HIBERNATION */
#endif
+#ifdef __HAVE_ARCH_GATE_AREA
extern struct vm_area_struct *get_gate_vma(struct mm_struct *mm);
-#ifdef __HAVE_ARCH_GATE_AREA
-int in_gate_area_no_mm(unsigned long addr);
-int in_gate_area(struct mm_struct *mm, unsigned long addr);
+extern int in_gate_area_no_mm(unsigned long addr);
+extern int in_gate_area(struct mm_struct *mm, unsigned long addr);
#else
-int in_gate_area_no_mm(unsigned long addr);
-#define in_gate_area(mm, addr) ({(void)mm; in_gate_area_no_mm(addr);})
+static inline struct vm_area_struct *get_gate_vma(struct mm_struct *mm)
+{
+ return NULL;
+}
+static inline int in_gate_area_no_mm(unsigned long addr) { return 0; }
+static inline int in_gate_area(struct mm_struct *mm, unsigned long addr)
+{
+ return 0;
+}
#endif /* __HAVE_ARCH_GATE_AREA */
#ifdef CONFIG_SYSCTL
diff --git a/mm/memory.c b/mm/memory.c
index d67fd9f..099d234 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -3399,44 +3399,6 @@ int __pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address)
}
#endif /* __PAGETABLE_PMD_FOLDED */
-#if !defined(__HAVE_ARCH_GATE_AREA)
-
-#if defined(AT_SYSINFO_EHDR)
-static struct vm_area_struct gate_vma;
-
-static int __init gate_vma_init(void)
-{
- gate_vma.vm_mm = NULL;
- gate_vma.vm_start = FIXADDR_USER_START;
- gate_vma.vm_end = FIXADDR_USER_END;
- gate_vma.vm_flags = VM_READ | VM_MAYREAD | VM_EXEC | VM_MAYEXEC;
- gate_vma.vm_page_prot = __P101;
-
- return 0;
-}
-__initcall(gate_vma_init);
-#endif
-
-struct vm_area_struct *get_gate_vma(struct mm_struct *mm)
-{
-#ifdef AT_SYSINFO_EHDR
- return &gate_vma;
-#else
- return NULL;
-#endif
-}
-
-int in_gate_area_no_mm(unsigned long addr)
-{
-#ifdef AT_SYSINFO_EHDR
- if ((addr >= FIXADDR_USER_START) && (addr < FIXADDR_USER_END))
- return 1;
-#endif
- return 0;
-}
-
-#endif /* __HAVE_ARCH_GATE_AREA */
-
static int __follow_pte(struct mm_struct *mm, unsigned long address,
pte_t **ptepp, spinlock_t **ptlp)
{
diff --git a/mm/nommu.c b/mm/nommu.c
index b78e3a8..c4ca56b 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -1981,11 +1981,6 @@ error:
return -ENOMEM;
}
-int in_gate_area_no_mm(unsigned long addr)
-{
- return 0;
-}
-
int filemap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
{
BUG();
--
1.9.3
|
|
From: Real N. <enj...@gm...> - 2014-06-17 13:45:18
|
On Mon, Jun 09, 2014 at 01:45:56PM +0800, Real Name wrote:
> On Thu, Jun 05, 2014 at 11:49:49PM +0200, Richard Weinberger wrote:
> > Am 05.06.2014 06:15, schrieb Honggang Li:
> > > arch/x86/um/checksum_32.S had been copy & paste from x86. When build
> > > x86 uml, csum_partial_copy_generic_i386 mess up the exception table.
> > > In fact, exception table dose not work in uml kernel.
> >
> > Are you sure that exception tables do not work on UML?
> > I said, I'm not sure. Can you please find out?
>
> I think we can't test the exception table with linux-next uml kernel, because
> the exception table is broken.
>
This patch is the root source of the broken exception table of UML
kernel.
linux]# git bisect visualize
commit 706276543b699d80f546e45f8b12574e7b18d952
Author: H. Peter Anvin <hp...@zy...>
Date: Fri Apr 20 17:12:48 2012 -0700
x86, extable: Switch to relative exception table entries
|
|
From: Real N. <enj...@gm...> - 2014-06-09 05:46:10
|
On Thu, Jun 05, 2014 at 11:49:49PM +0200, Richard Weinberger wrote: > Am 05.06.2014 06:15, schrieb Honggang Li: > > arch/x86/um/checksum_32.S had been copy & paste from x86. When build > > x86 uml, csum_partial_copy_generic_i386 mess up the exception table. > > In fact, exception table dose not work in uml kernel. > > Are you sure that exception tables do not work on UML? > I said, I'm not sure. Can you please find out? I think we can't test the exception table with linux-next uml kernel, because the exception table is broken. The *old* linux-2.4.xx uml kernel has a good exception table. 1) install one redhat-9.0 virtual machine 2) build and booting into linux-2.4.25. You can't run uml kernel with default redhat-9.0 kernel, because there is one bug. 3) build linux-2.4.20 uml kernel (with uml-patch-2.4.20-8) 4) run linux-2.4.20/linux ubda=/root/root_fs.rh-7.2-server.pristine.20020312 mem=64m (The root_fs and uml-patch are available from the *old* uml website.) The exception table records of the old kernel belong to csum_partial_copy_generic_i386 too. # objjdump --full-contents --section=__ex_table arch/um/sys-i386/checksum.o arch/um/sys-i386/checksum.o: file format elf32-i386 Contents of section __ex_table: 0000 c7000000 00000000 cd000000 1b000000 ................ 0010 e4000000 00000000 e6000000 00000000 ................ 0020 eb000000 1b000000 ef000000 1b000000 ................ 0030 f2000000 00000000 f5000000 00000000 ................ 0040 fa000000 1b000000 ff000000 1b000000 ................ 0050 02010000 00000000 05010000 00000000 ................ 0060 0a010000 1b000000 0f010000 1b000000 ................ 0070 12010000 00000000 15010000 00000000 ................ 0080 1a010000 1b000000 1f010000 1b000000 ................ 0090 3c010000 00000000 40010000 1b000000 <.......@....... 00a0 58010000 00000000 5e010000 1b000000 X.......^....... 00b0 69010000 00000000 6b010000 1b000000 i.......k...... [root@rht9 linux-2.4.20]# objdump --full-contents --section=__ex_table arch/um/kern> arch/um/kernel/checksum.o: file format elf32-i386 [root@rht9 linux-2.4.20]# objdump --full-contents --section=__ex_table linux linux: file format elf32-i386 Contents of section __ex_table: a0203c20 5b680ea0 2cd31ba0 61680ea0 47d31ba0 [h..,...ah..G... a0203c30 78680ea0 2cd31ba0 7a680ea0 2cd31ba0 xh..,...zh..,... a0203c40 7f680ea0 47d31ba0 83680ea0 47d31ba0 .h..G....h..G... a0203c50 86680ea0 2cd31ba0 89680ea0 2cd31ba0 .h..,....h..,... a0203c60 8e680ea0 47d31ba0 93680ea0 47d31ba0 .h..G....h..G... a0203c70 96680ea0 2cd31ba0 99680ea0 2cd31ba0 .h..,....h..,... a0203c80 9e680ea0 47d31ba0 a3680ea0 47d31ba0 .h..G....h..G... a0203c90 a6680ea0 2cd31ba0 a9680ea0 2cd31ba0 .h..,....h..,... a0203ca0 ae680ea0 47d31ba0 b3680ea0 47d31ba0 .h..G....h..G... a0203cb0 d0680ea0 2cd31ba0 d4680ea0 47d31ba0 .h..,....h..G... a0203cc0 ec680ea0 2cd31ba0 f2680ea0 47d31ba0 .h..,....h..G... a0203cd0 fd680ea0 2cd31ba0 ff680ea0 47d31ba0 .h..,....h..G... ************************************************************************** The exception table of linux-3.1x.y is broken. The complier tool chain create bad exception table. I think this should be a bug. linux-3.12.6]$ objdump --full-contents --section=__ex_table ./linux ./linux: file format elf32-i386 Contents of section __ex_table: 82a5048 3e6fdcff bcbaf6ff 396fdcff b4baf6ff >o......9o...... 82a5058 336fdcff acbaf6ff 306fdcff bfbaf6ff 3o......0o...... 82a5068 2b6fdcff 9cbaf6ff 286fdcff afbaf6ff +o......(o...... 82a5078 236fdcff 8cbaf6ff 206fdcff 9fbaf6ff #o...... o...... 82a5088 1b6fdcff 7cbaf6ff 186fdcff 8fbaf6ff .o..|....o...... 82a5098 136fdcff 6cbaf6ff 106fdcff 7fbaf6ff .o..l....o...... 82a50a8 0b6fdcff 5cbaf6ff 086fdcff 6fbaf6ff .o..\....o..o... 82a50b8 036fdcff 4cbaf6ff 006fdcff 5fbaf6ff .o..L....o.._... 82a50c8 fb6edcff 3cbaf6ff f86edcff 4fbaf6ff .n..<....n..O... 82a50d8 f36edcff 2cbaf6ff f06edcff 3fbaf6ff .n..,....n..?... 82a50e8 eb6edcff 1cbaf6ff e86edcff 2fbaf6ff .n.......n../... 82a50f8 e36edcff 0cbaf6ff e06edcff 1fbaf6ff .n.......n...... 82a5108 db6edcff fcb9f6ff d86edcff 0fbaf6ff .n.......n...... 82a5118 d36edcff ecb9f6ff d06edcff ffb9f6ff .n.......n...... 82a5128 cb6edcff dcb9f6ff c86edcff efb9f6ff .n.......n...... 82a5138 c36edcff ccb9f6ff c06edcff dfb9f6ff .n.......n...... 82a5148 bb6edcff bcb9f6ff b86edcff cfb9f6ff .n.......n...... 82a5158 ce6edcff acb9f6ff cc6edcff bfb9f6ff .n.......n...... 82a5168 cf6edcff 9cb9f6ff c96edcff afb9f6ff .n.......n...... > > In arch/um/kernel/trap.c:segv() we have the mechanism for it: > else if (!is_user && arch_fixup(ip, regs)) > goto out; > The kcov analysis proof that this piece of code never been executed. > The interesting question is, is this by design or was it just copy&pasted from x86 > many moons ago? :) Hi, Jeff Could you please answer this question, as you are the author? thanks > > > And csum_partial_copy_generic_i386 never been called. So, delete it. > > I like such clean ups. :-) Could you please pick up the attached patch. I update the comment of the patch. Thank you. > > Thanks, > //richard |
|
From: Richard W. <ri...@no...> - 2014-06-05 21:50:02
|
Am 05.06.2014 06:15, schrieb Honggang Li:
> arch/x86/um/checksum_32.S had been copy & paste from x86. When build
> x86 uml, csum_partial_copy_generic_i386 mess up the exception table.
> In fact, exception table dose not work in uml kernel.
Are you sure that exception tables do not work on UML?
I said, I'm not sure. Can you please find out?
In arch/um/kernel/trap.c:segv() we have the mechanism for it:
else if (!is_user && arch_fixup(ip, regs))
goto out;
The interesting question is, is this by design or was it just copy&pasted from x86
many moons ago? :)
> And csum_partial_copy_generic_i386 never been called. So, delete it.
I like such clean ups. :-)
Thanks,
//richard
|
|
From: Honggang Li <enj...@gm...> - 2014-06-05 04:15:43
|
arch/x86/um/checksum_32.S had been copy & paste from x86. When build x86 uml, csum_partial_copy_generic_i386 mess up the exception table. In fact, exception table dose not work in uml kernel. And csum_partial_copy_generic_i386 never been called. So, delete it. Signed-off-by: Honggang Li <enj...@gm...> --- arch/x86/um/checksum_32.S | 239 ---------------------------------------------- 1 file changed, 239 deletions(-) diff --git a/arch/x86/um/checksum_32.S b/arch/x86/um/checksum_32.S index 8d0c420..fa4b8b9 100644 --- a/arch/x86/um/checksum_32.S +++ b/arch/x86/um/checksum_32.S @@ -214,242 +214,3 @@ csum_partial: ret #endif - -/* -unsigned int csum_partial_copy_generic (const char *src, char *dst, - int len, int sum, int *src_err_ptr, int *dst_err_ptr) - */ - -/* - * Copy from ds while checksumming, otherwise like csum_partial - * - * The macros SRC and DST specify the type of access for the instruction. - * thus we can call a custom exception handler for all access types. - * - * FIXME: could someone double-check whether I haven't mixed up some SRC and - * DST definitions? It's damn hard to trigger all cases. I hope I got - * them all but there's no guarantee. - */ - -#define SRC(y...) \ - 9999: y; \ - _ASM_EXTABLE(9999b, 6001f) - -#define DST(y...) \ - 9999: y; \ - _ASM_EXTABLE(9999b, 6002f) - -.align 4 - -#ifndef CONFIG_X86_USE_PPRO_CHECKSUM - -#define ARGBASE 16 -#define FP 12 - -csum_partial_copy_generic_i386: - subl $4,%esp - pushl %edi - pushl %esi - pushl %ebx - movl ARGBASE+16(%esp),%eax # sum - movl ARGBASE+12(%esp),%ecx # len - movl ARGBASE+4(%esp),%esi # src - movl ARGBASE+8(%esp),%edi # dst - - testl $2, %edi # Check alignment. - jz 2f # Jump if alignment is ok. - subl $2, %ecx # Alignment uses up two bytes. - jae 1f # Jump if we had at least two bytes. - addl $2, %ecx # ecx was < 2. Deal with it. - jmp 4f -SRC(1: movw (%esi), %bx ) - addl $2, %esi -DST( movw %bx, (%edi) ) - addl $2, %edi - addw %bx, %ax - adcl $0, %eax -2: - movl %ecx, FP(%esp) - shrl $5, %ecx - jz 2f - testl %esi, %esi -SRC(1: movl (%esi), %ebx ) -SRC( movl 4(%esi), %edx ) - adcl %ebx, %eax -DST( movl %ebx, (%edi) ) - adcl %edx, %eax -DST( movl %edx, 4(%edi) ) - -SRC( movl 8(%esi), %ebx ) -SRC( movl 12(%esi), %edx ) - adcl %ebx, %eax -DST( movl %ebx, 8(%edi) ) - adcl %edx, %eax -DST( movl %edx, 12(%edi) ) - -SRC( movl 16(%esi), %ebx ) -SRC( movl 20(%esi), %edx ) - adcl %ebx, %eax -DST( movl %ebx, 16(%edi) ) - adcl %edx, %eax -DST( movl %edx, 20(%edi) ) - -SRC( movl 24(%esi), %ebx ) -SRC( movl 28(%esi), %edx ) - adcl %ebx, %eax -DST( movl %ebx, 24(%edi) ) - adcl %edx, %eax -DST( movl %edx, 28(%edi) ) - - lea 32(%esi), %esi - lea 32(%edi), %edi - dec %ecx - jne 1b - adcl $0, %eax -2: movl FP(%esp), %edx - movl %edx, %ecx - andl $0x1c, %edx - je 4f - shrl $2, %edx # This clears CF -SRC(3: movl (%esi), %ebx ) - adcl %ebx, %eax -DST( movl %ebx, (%edi) ) - lea 4(%esi), %esi - lea 4(%edi), %edi - dec %edx - jne 3b - adcl $0, %eax -4: andl $3, %ecx - jz 7f - cmpl $2, %ecx - jb 5f -SRC( movw (%esi), %cx ) - leal 2(%esi), %esi -DST( movw %cx, (%edi) ) - leal 2(%edi), %edi - je 6f - shll $16,%ecx -SRC(5: movb (%esi), %cl ) -DST( movb %cl, (%edi) ) -6: addl %ecx, %eax - adcl $0, %eax -7: -5000: - -# Exception handler: -.section .fixup, "ax" - -6001: - movl ARGBASE+20(%esp), %ebx # src_err_ptr - movl $-EFAULT, (%ebx) - - # zero the complete destination - computing the rest - # is too much work - movl ARGBASE+8(%esp), %edi # dst - movl ARGBASE+12(%esp), %ecx # len - xorl %eax,%eax - rep ; stosb - - jmp 5000b - -6002: - movl ARGBASE+24(%esp), %ebx # dst_err_ptr - movl $-EFAULT,(%ebx) - jmp 5000b - -.previous - - popl %ebx - popl %esi - popl %edi - popl %ecx # equivalent to addl $4,%esp - ret - -#else - -/* Version for PentiumII/PPro */ - -#define ROUND1(x) \ - SRC(movl x(%esi), %ebx ) ; \ - addl %ebx, %eax ; \ - DST(movl %ebx, x(%edi) ) ; - -#define ROUND(x) \ - SRC(movl x(%esi), %ebx ) ; \ - adcl %ebx, %eax ; \ - DST(movl %ebx, x(%edi) ) ; - -#define ARGBASE 12 - -csum_partial_copy_generic_i386: - pushl %ebx - pushl %edi - pushl %esi - movl ARGBASE+4(%esp),%esi #src - movl ARGBASE+8(%esp),%edi #dst - movl ARGBASE+12(%esp),%ecx #len - movl ARGBASE+16(%esp),%eax #sum -# movl %ecx, %edx - movl %ecx, %ebx - movl %esi, %edx - shrl $6, %ecx - andl $0x3c, %ebx - negl %ebx - subl %ebx, %esi - subl %ebx, %edi - lea -1(%esi),%edx - andl $-32,%edx - lea 3f(%ebx,%ebx), %ebx - testl %esi, %esi - jmp *%ebx -1: addl $64,%esi - addl $64,%edi - SRC(movb -32(%edx),%bl) ; SRC(movb (%edx),%bl) - ROUND1(-64) ROUND(-60) ROUND(-56) ROUND(-52) - ROUND (-48) ROUND(-44) ROUND(-40) ROUND(-36) - ROUND (-32) ROUND(-28) ROUND(-24) ROUND(-20) - ROUND (-16) ROUND(-12) ROUND(-8) ROUND(-4) -3: adcl $0,%eax - addl $64, %edx - dec %ecx - jge 1b -4: movl ARGBASE+12(%esp),%edx #len - andl $3, %edx - jz 7f - cmpl $2, %edx - jb 5f -SRC( movw (%esi), %dx ) - leal 2(%esi), %esi -DST( movw %dx, (%edi) ) - leal 2(%edi), %edi - je 6f - shll $16,%edx -5: -SRC( movb (%esi), %dl ) -DST( movb %dl, (%edi) ) -6: addl %edx, %eax - adcl $0, %eax -7: -.section .fixup, "ax" -6001: movl ARGBASE+20(%esp), %ebx # src_err_ptr - movl $-EFAULT, (%ebx) - # zero the complete destination (computing the rest is too much work) - movl ARGBASE+8(%esp),%edi # dst - movl ARGBASE+12(%esp),%ecx # len - xorl %eax,%eax - rep; stosb - jmp 7b -6002: movl ARGBASE+24(%esp), %ebx # dst_err_ptr - movl $-EFAULT, (%ebx) - jmp 7b -.previous - - popl %esi - popl %edi - popl %ebx - ret - -#undef ROUND -#undef ROUND1 - -#endif -- 1.8.3.1 |
|
From: Honggang Li <enj...@gm...> - 2014-06-05 04:15:40
|
The csum_partial_copy_generic_i386 never been called. It mess up x86 uml kernel exception table. So remove it. linux-next]$ grep -n -r csum_partial_copy_generic_i386 . ./arch/x86/um/checksum_32.S:249:csum_partial_copy_generic_i386: ./arch/x86/um/checksum_32.S:384:csum_partial_copy_generic_i386: Honggang Li (1): remove csum_partial_copy_generic_i386 to clean up exception table arch/x86/um/checksum_32.S | 239 ---------------------------------------------- 1 file changed, 239 deletions(-) -- 1.8.3.1 |
|
From: Richard W. <ri...@no...> - 2014-06-04 14:04:23
|
Am 04.06.2014 15:39, schrieb Real Name: > On Fri, May 30, 2014 at 10:50:59AM +0200, Richard Weinberger wrote: > > I find the function through checking which object file has the _ex_table section. > > tmp]$ cat find_ex_table.sh > #!/bin/bash > > (cd ~/uml/linux-3.12.6; find . -type f -name '*.o' > /tmp/xx.txt) > > for file in `cat /tmp/xx.txt`; do > readelf -S ~/uml/linux-3.12.6/$file | grep ex_table > if [ $? -eq 0 ]; then > echo $file; > echo; > fi > done > > All __extable entries belong to function csum_partial_copy_generic_i386 defined in file linux-3.12.6/arch/x86/um/checksum_32.S > I'm sure this is just because of copy&pasting from i386. I'd be surprised of exception tables actually work on UML. Thanks, //richard |
|
From: Real N. <enj...@gm...> - 2014-06-04 13:39:19
|
On Fri, May 30, 2014 at 10:50:59AM +0200, Richard Weinberger wrote:
I find the function through checking which object file has the _ex_table section.
tmp]$ cat find_ex_table.sh
#!/bin/bash
(cd ~/uml/linux-3.12.6; find . -type f -name '*.o' > /tmp/xx.txt)
for file in `cat /tmp/xx.txt`; do
readelf -S ~/uml/linux-3.12.6/$file | grep ex_table
if [ $? -eq 0 ]; then
echo $file;
echo;
fi
done
All __extable entries belong to function csum_partial_copy_generic_i386 defined in file linux-3.12.6/arch/x86/um/checksum_32.S
However, I am confused with the difference between __ex_table of vmlinux.o and vmlinux(linux). To avoid mess the email, I only take two lines of the each objdump output.
-------------------------------------------------------------------------------
um]$ objdump --full-contents --section=__ex_table ~/uml/linux-3.12.6/vmlinux.o
/uml/linux-3.12.6/vmlinux.o: file format elf32-i386
Contents of section __ex_table:
0000 9e3d0100 00000000 a13d0100 00000000 .=.......=......
0010 a33d0100 00000000 a83d0100 1b000000 .=.......=......
-------------------------------------------------------------------------------
um]$ objdump --full-contents --section=__ex_table ~/uml/linux-3.12.6/vmlinux
uml/linux-3.12.6/vmlinux: file format elf32-i386
Contents of section __ex_table:
82a9048 b630dcff 14bcf6ff b130dcff 0cbcf6ff .0.......0......
82a9058 ab30dcff 04bcf6ff a830dcff 17bcf6ff .0.......0......
-------------------------------------------------------------------------------
Do you know, how to "9e3d0100" (vmlinx.o) become "b630dcff" (vmlinux), and the "00000000" (vmlinx.o) have been replaced with different values?
> Am 30.05.2014 10:08, schrieb enjoy mindful:
> > Sorry. I know how to use addr2line. But it is not what I'm looking for.
> >
> > For example, with i386 kernel, it is easy to find c017e7a5 belong to
> > function get_user.
> >
> > x86]$ vi /hack/linux-3.12.6/Documentation/x86/exception-tables.txt
> > .............
> > 217 or in human readable byte order:
> > 218
> > 219 > c01aa7c4 c017c093 c0199fe0 c017c097 c017c099 ................
> > 220 > c01aa7d4 c017c2f6 c0199fe9 c017e7a5 c0199ff5 ................
> > 221 ^^^^^^^^^^^^^^^^^
> > 222 this is the interesting part!
> > 223 > c01aa7e4 c0180a08 c019a001 c0180a0a c019a004 ................
> >
> > my question is how to find 0xffdc6eb8 belong to which uml kernel function.
>
> Ah ok.
> I'd decode it from the source side.
> I.e. start in arch/x86/um/fault.c
>
> Thanks,
> //richard
|
|
From: Richard W. <ric...@gm...> - 2014-06-04 08:40:18
|
On Wed, Jun 4, 2014 at 10:26 AM, Real Name <enj...@gm...> wrote: > Hi, > I tried to run UML (linux-3.12.6-x86) kernel with valgrind and GDB. > But valgrind always terminated because SIGSEGV signal. I searched with > google, just got some very old resource about run linux-2.6.xx with valgrind. To run UML in GDB you have to tell GDB to ignore SIGSEGV. UML uses it for page faults. > So, is it possible to run linux (>3.12) with valgrind? If yes, how to do it? No. A long time ago it was possible after applying a patch to both UML and valgrind. -- Thanks, //richard |
|
From: Real N. <enj...@gm...> - 2014-06-04 08:26:44
|
Hi, I tried to run UML (linux-3.12.6-x86) kernel with valgrind and GDB. But valgrind always terminated because SIGSEGV signal. I searched with google, just got some very old resource about run linux-2.6.xx with valgrind. So, is it possible to run linux (>3.12) with valgrind? If yes, how to do it? thanks |
|
From: Richard W. <ri...@no...> - 2014-06-03 07:20:14
|
Am 03.06.2014 03:29, schrieb Nalli, Sanketh: > I mean, there is only ONE thread in UML that intercepts > The system calls and services them. > Can we have more such threads in the kernel ? UML has no SMP support. Thanks, //richard > -----Original Message----- > From: Nalli, Sanketh > Sent: Monday, June 02, 2014 6:29 PM > To: use...@li...; 'Richard Weinberger' > Cc: Volos, Haris > Subject: RE: [uml-user] invalid /proc/PID/exe in UML processes > > Okay, so I've found a way around the invalid exe symlink. > I don't need that anymore. > The next challenge is concurrency in UML. > > I wrote a simple program that launches 10 pthreads, Each of which makes some system calls in an infinite loop. > > I notice that even though there are 10 threads in my dummy program, There is only ONE UML kernel thread. Is this correct ? > If so, does this mean that UML kernel is serializing the execution ? > Is there some way of making UML kernel multi-threaded ? > > -----Original Message----- > From: Richard Weinberger [mailto:ri...@no...] > Sent: Monday, June 02, 2014 1:46 PM > To: Nalli, Sanketh > Cc: use...@li... > Subject: Re: [uml-user] invalid /proc/PID/exe in UML processes > > Am 02.06.2014 22:42, schrieb Nalli, Sanketh: >> Nope, but here is some bootlog > > Hmm, I have no idea so far. > > Applications running under valgrind or other debuggers suffered from the issue that /proc/pid/exe is empty. > >> The host does not have skas3 patch >> Do you think that is the problem ? > > Nope. SKAS0 works fine. > >> Which host shd I use that already has this patch (I mean I cud patch >> the host myself but if there is one Already present, that is good !) >> >> Core dump limits : >> soft - 0 >> hard - NONE >> Checking that ptrace can change system call numbers...OK Checking >> syscall emulation patch for ptrace...OK Checking advanced syscall >> emulation patch for ptrace...OK Checking for tmpfs mount on >> /dev/shm...nothing mounted on /dev/shm Checking PROT_EXEC mmap in >> /tmp/...OK Checking for new_mm and switch_mm support in the host: >> /proc/self/mm ... Failed - >> No such file or directory >> Checking for the skas3 patch in the host: >> - /proc/mm...not found: No such file or directory >> - PTRACE_FAULTINFO...not found >> - PTRACE_LDT...not found >> UML running in SKAS0 mode >> Adding 20606976 bytes to physical memory to account for exec-shield >> gap Linux version 2.6.24-g91525300-dirty >> (jd...@am...) (gcc version 4.1.1 20070105 (Red Hat >> 4.1.1-51)) #1 Mon Jan 28 12:03:41 EST 2008 > > Wow. This UML is horrible old. > > Thanks, > //richard > |
|
From: Nalli, S. <san...@hp...> - 2014-06-03 01:30:58
|
I mean, there is only ONE thread in UML that intercepts The system calls and services them. Can we have more such threads in the kernel ? -----Original Message----- From: Nalli, Sanketh Sent: Monday, June 02, 2014 6:29 PM To: use...@li...; 'Richard Weinberger' Cc: Volos, Haris Subject: RE: [uml-user] invalid /proc/PID/exe in UML processes Okay, so I've found a way around the invalid exe symlink. I don't need that anymore. The next challenge is concurrency in UML. I wrote a simple program that launches 10 pthreads, Each of which makes some system calls in an infinite loop. I notice that even though there are 10 threads in my dummy program, There is only ONE UML kernel thread. Is this correct ? If so, does this mean that UML kernel is serializing the execution ? Is there some way of making UML kernel multi-threaded ? -----Original Message----- From: Richard Weinberger [mailto:ri...@no...] Sent: Monday, June 02, 2014 1:46 PM To: Nalli, Sanketh Cc: use...@li... Subject: Re: [uml-user] invalid /proc/PID/exe in UML processes Am 02.06.2014 22:42, schrieb Nalli, Sanketh: > Nope, but here is some bootlog Hmm, I have no idea so far. Applications running under valgrind or other debuggers suffered from the issue that /proc/pid/exe is empty. > The host does not have skas3 patch > Do you think that is the problem ? Nope. SKAS0 works fine. > Which host shd I use that already has this patch (I mean I cud patch > the host myself but if there is one Already present, that is good !) > > Core dump limits : > soft - 0 > hard - NONE > Checking that ptrace can change system call numbers...OK Checking > syscall emulation patch for ptrace...OK Checking advanced syscall > emulation patch for ptrace...OK Checking for tmpfs mount on > /dev/shm...nothing mounted on /dev/shm Checking PROT_EXEC mmap in > /tmp/...OK Checking for new_mm and switch_mm support in the host: > /proc/self/mm ... Failed - > No such file or directory > Checking for the skas3 patch in the host: > - /proc/mm...not found: No such file or directory > - PTRACE_FAULTINFO...not found > - PTRACE_LDT...not found > UML running in SKAS0 mode > Adding 20606976 bytes to physical memory to account for exec-shield > gap Linux version 2.6.24-g91525300-dirty > (jd...@am...) (gcc version 4.1.1 20070105 (Red Hat > 4.1.1-51)) #1 Mon Jan 28 12:03:41 EST 2008 Wow. This UML is horrible old. Thanks, //richard |
|
From: Nalli, S. <san...@hp...> - 2014-06-03 01:30:21
|
Okay, so I've found a way around the invalid exe symlink. I don't need that anymore. The next challenge is concurrency in UML. I wrote a simple program that launches 10 pthreads, Each of which makes some system calls in an infinite loop. I notice that even though there are 10 threads in my dummy program, There is only ONE UML kernel thread. Is this correct ? If so, does this mean that UML kernel is serializing the execution ? Is there some way of making UML kernel multi-threaded ? -----Original Message----- From: Richard Weinberger [mailto:ri...@no...] Sent: Monday, June 02, 2014 1:46 PM To: Nalli, Sanketh Cc: use...@li... Subject: Re: [uml-user] invalid /proc/PID/exe in UML processes Am 02.06.2014 22:42, schrieb Nalli, Sanketh: > Nope, but here is some bootlog Hmm, I have no idea so far. Applications running under valgrind or other debuggers suffered from the issue that /proc/pid/exe is empty. > The host does not have skas3 patch > Do you think that is the problem ? Nope. SKAS0 works fine. > Which host shd I use that already has this patch (I mean I cud patch > the host myself but if there is one Already present, that is good !) > > Core dump limits : > soft - 0 > hard - NONE > Checking that ptrace can change system call numbers...OK Checking > syscall emulation patch for ptrace...OK Checking advanced syscall > emulation patch for ptrace...OK Checking for tmpfs mount on > /dev/shm...nothing mounted on /dev/shm Checking PROT_EXEC mmap in > /tmp/...OK Checking for new_mm and switch_mm support in the host: > /proc/self/mm ... Failed - > No such file or directory > Checking for the skas3 patch in the host: > - /proc/mm...not found: No such file or directory > - PTRACE_FAULTINFO...not found > - PTRACE_LDT...not found > UML running in SKAS0 mode > Adding 20606976 bytes to physical memory to account for exec-shield > gap Linux version 2.6.24-g91525300-dirty > (jd...@am...) (gcc version 4.1.1 20070105 (Red Hat > 4.1.1-51)) #1 Mon Jan 28 12:03:41 EST 2008 Wow. This UML is horrible old. Thanks, //richard |
|
From: Nalli, S. <san...@hp...> - 2014-06-02 20:53:16
|
Here is some bootlog from 3.9
Core dump limits :
soft - 0
hard - NONE
Checking that ptrace can change system call numbers...OK
Checking syscall emulation patch for ptrace...OK
Checking advanced syscall emulation patch for ptrace...OK
Checking for tmpfs mount on /dev/shm...nothing mounted on /dev/shm
Checking PROT_EXEC mmap in /tmp/...OK
Checking for the skas3 patch in the host:
- /proc/mm...not found: No such file or directory
- PTRACE_FAULTINFO...not found
- PTRACE_LDT...not found
UML running in SKAS0 mode
Adding 12623872 bytes to physical memory to account for exec-shield gap
Initializing cgroup subsys cpuset
Initializing cgroup subsys cpu
Linux version 3.9.0 (nalli@haris-crashnburn) (gcc version 4.8.1 (Ubuntu 4.8.1-2ubuntu1~12.04) ) #1 Tue May 27 15:47:48 PDT 2014
-----Original Message-----
From: Nalli, Sanketh
Sent: Monday, June 02, 2014 1:51 PM
To: 'Richard Weinberger'
Cc: 'use...@li...'
Subject: RE: [uml-user] invalid /proc/PID/exe in UML processes
Oh wait, sorry its not.
-----Original Message-----
From: Nalli, Sanketh
Sent: Monday, June 02, 2014 1:50 PM
To: 'Richard Weinberger'
Cc: use...@li...
Subject: RE: [uml-user] invalid /proc/PID/exe in UML processes
OK Checking for new_mm and switch_mm support in the host:
> /proc/self/mm ... Failed -
> No such file or directory
> Checking for the skas3 patch in the host:
> - /proc/mm...not found: No such file or directory
> - PTRACE_FAULTINFO...not found
> - PTRACE_LDT...not found
> UML running in SKAS0 mode
> Adding 20606976 bytes to physical memory to account for exec-shield
> gap Linux version 2.6.24-g91525300-dirty
> (jd...@am...) (gcc version 4.1.1 20070105 (Red Hat
> 4.1.1-51)) #1 Mon Jan 28 12:03:41 EST 2008
Wow. This UML is horrible old.
Well, it’s the latest kernel from kernel.org.
Thanks,
//richard
|
|
From: Nalli, S. <san...@hp...> - 2014-06-02 20:52:09
|
Oh wait, sorry its not. -----Original Message----- From: Nalli, Sanketh Sent: Monday, June 02, 2014 1:50 PM To: 'Richard Weinberger' Cc: use...@li... Subject: RE: [uml-user] invalid /proc/PID/exe in UML processes OK Checking for new_mm and switch_mm support in the host: > /proc/self/mm ... Failed - > No such file or directory > Checking for the skas3 patch in the host: > - /proc/mm...not found: No such file or directory > - PTRACE_FAULTINFO...not found > - PTRACE_LDT...not found > UML running in SKAS0 mode > Adding 20606976 bytes to physical memory to account for exec-shield > gap Linux version 2.6.24-g91525300-dirty > (jd...@am...) (gcc version 4.1.1 20070105 (Red Hat > 4.1.1-51)) #1 Mon Jan 28 12:03:41 EST 2008 Wow. This UML is horrible old. Well, it’s the latest kernel from kernel.org. Thanks, //richard |
|
From: Nalli, S. <san...@hp...> - 2014-06-02 20:51:15
|
OK Checking for new_mm and switch_mm support in the host: > /proc/self/mm ... Failed - > No such file or directory > Checking for the skas3 patch in the host: > - /proc/mm...not found: No such file or directory > - PTRACE_FAULTINFO...not found > - PTRACE_LDT...not found > UML running in SKAS0 mode > Adding 20606976 bytes to physical memory to account for exec-shield > gap Linux version 2.6.24-g91525300-dirty > (jd...@am...) (gcc version 4.1.1 20070105 (Red Hat > 4.1.1-51)) #1 Mon Jan 28 12:03:41 EST 2008 Wow. This UML is horrible old. Well, it’s the latest kernel from kernel.org. Thanks, //richard |