kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* [RFC] Only a.out QMAGIC format is working
@ 2014-04-01 12:47 Geyslan Gregório Bem
  2014-04-19 16:22 ` Pavel Machek
  0 siblings, 1 reply; 9+ messages in thread
From: Geyslan Gregório Bem @ 2014-04-01 12:47 UTC (permalink / raw)
  To: kernelnewbies

Sirs,

I was researching about old binary formats and did some tests.
Meantime, I was able to run sucessfully only the QMAGIC format.
Nonetheless, the OMAGIC, NMAGIC and ZMAGIC didn't work anymore.

The test occurred using old slackware binaries and some new, the
latter compiled by me, using cross-compiled as and ld. In any case,
the QMAGIC was the only functional.

After some debugging I identified (when loading a OMAGIC) that the
kernel sigkill the current after this checking:

http://lxr.linux.no/linux+v3.13.5/arch/x86/ia32/ia32_aout.c#L325

 325                error = vm_brk(text_addr & PAGE_MASK, map_size);
 326
 327                if (error != (text_addr & PAGE_MASK)) {
 328                        send_sig(SIGKILL, current, 0);
 329                        return error;
 330                }

I suppose this happens due to changes made, in the course of time, in
the memory mapping (vm_brk/do_brk), therefore the only one that still
works is the QMAGIC (the aligned one). Or maybe, it's purposely. [RFC]

Is important to note that when a ZMAGIC is loaded what happens is a
"Segmentation fault" and not "SIGKILL".

That was reported by others too:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/966472

-- 
Regards,

Geyslan G. Bem
hackingbits.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [RFC] Only a.out QMAGIC format is working
  2014-04-01 12:47 [RFC] Only a.out QMAGIC format is working Geyslan Gregório Bem
@ 2014-04-19 16:22 ` Pavel Machek
  2014-04-19 16:37   ` [Kernel-BR] " Geyslan Gregório Bem
  0 siblings, 1 reply; 9+ messages in thread
From: Pavel Machek @ 2014-04-19 16:22 UTC (permalink / raw)
  To: kernelnewbies

Hi!

> I was researching about old binary formats and did some tests.
> Meantime, I was able to run sucessfully only the QMAGIC format.
> Nonetheless, the OMAGIC, NMAGIC and ZMAGIC didn't work anymore.

Some time ago, I ran into similar problem, and turning off userspace
randomization was neccessary... Jiri Kosina might remember details.

									Pavel

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Kernel-BR] Re: [RFC] Only a.out QMAGIC format is working
  2014-04-19 16:22 ` Pavel Machek
@ 2014-04-19 16:37   ` Geyslan Gregório Bem
  2014-04-19 18:33     ` Valdis.Kletnieks at vt.edu
  2014-04-20 11:45     ` Pavel Machek
  0 siblings, 2 replies; 9+ messages in thread
From: Geyslan Gregório Bem @ 2014-04-19 16:37 UTC (permalink / raw)
  To: kernelnewbies

Pavel,

Thank you.

Maintainers, is there some chance to fix it or a.out is really doomed?


2014-04-19 13:15 GMT-03:00 Pavel Machek <pavel@ucw.cz>:
> Hi!
>
>> I was researching about old binary formats and did some tests.
>> Meantime, I was able to run sucessfully only the QMAGIC format.
>> Nonetheless, the OMAGIC, NMAGIC and ZMAGIC didn't work anymore.
>
> Some time ago, I ran into similar problem, and turning off userspace
> randomization was neccessary... Jiri Kosina might remember details.
>
>                                                                         Pavel
>
> --
> (english) http://www.livejournal.com/~pavelmachek
> (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
>
> --
> Voc? est? recebendo esta mensagem porque se inscreveu no grupo "Kernel Brasil" dos Grupos do Google.
> Para cancelar inscri??o nesse grupo e parar de receber e-mails dele, envie um e-mail para kernel-br+unsubscribe at googlegroups.com.
> Para postar neste grupo, envie um e-mail para kernel-br at googlegroups.com.
> Para ver esta discuss?o na web, acesse https://groups.google.com/d/msgid/kernel-br/20140419161552.GB27776%40amd.pavel.ucw.cz.
> Para obter mais op??es, acesse https://groups.google.com/d/optout.



-- 
Regards,

Geyslan G. Bem
hackingbits.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Kernel-BR] Re: [RFC] Only a.out QMAGIC format is working
  2014-04-19 16:37   ` [Kernel-BR] " Geyslan Gregório Bem
@ 2014-04-19 18:33     ` Valdis.Kletnieks at vt.edu
  2014-04-19 19:19       ` Geyslan Gregório Bem
  2014-04-20 11:45     ` Pavel Machek
  1 sibling, 1 reply; 9+ messages in thread
From: Valdis.Kletnieks at vt.edu @ 2014-04-19 18:33 UTC (permalink / raw)
  To: kernelnewbies

On Sat, 19 Apr 2014 13:37:27 -0300, Geyslan Greg?rio Bem said:

> Maintainers, is there some chance to fix it or a.out is really doomed?

Is there an actual use case for a.out on a modern kernel?

In other wods, is there any reason to really care if it's doomed, since
it's been *years* since that worked?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 848 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140419/d31f5459/attachment.bin 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Kernel-BR] Re: [RFC] Only a.out QMAGIC format is working
  2014-04-19 18:33     ` Valdis.Kletnieks at vt.edu
@ 2014-04-19 19:19       ` Geyslan Gregório Bem
  0 siblings, 0 replies; 9+ messages in thread
From: Geyslan Gregório Bem @ 2014-04-19 19:19 UTC (permalink / raw)
  To: kernelnewbies

Valdis,

2014-04-19 15:33 GMT-03:00  <Valdis.Kletnieks@vt.edu>:
> On Sat, 19 Apr 2014 13:37:27 -0300, Geyslan Greg?rio Bem said:
>
>> Maintainers, is there some chance to fix it or a.out is really doomed?
>
> Is there an actual use case for a.out on a modern kernel?

Maybe retrocompatibility.

>
> In other wods, is there any reason to really care if it's doomed, since
> it's been *years* since that worked?

Perhaps not, but why to continue patching the ia32_aout.c and
binfmt_aout.c if that format doesn't matter (and work) anymore? That's
was the reason that I asked if it is really doomed in linux.


-- 
Regards,

Geyslan G. Bem
hackingbits.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Kernel-BR] Re: [RFC] Only a.out QMAGIC format is working
  2014-04-19 16:37   ` [Kernel-BR] " Geyslan Gregório Bem
  2014-04-19 18:33     ` Valdis.Kletnieks at vt.edu
@ 2014-04-20 11:45     ` Pavel Machek
  2014-04-20 12:13       ` Geyslan Gregório Bem
  1 sibling, 1 reply; 9+ messages in thread
From: Pavel Machek @ 2014-04-20 11:45 UTC (permalink / raw)
  To: kernelnewbies

On Sat 2014-04-19 13:37:27, Geyslan Greg?rio Bem wrote:
> Pavel,
> 
> Thank you.
> 
> Maintainers, is there some chance to fix it or a.out is really
> doomed?

There should be chance to fix it.

Do you have some idea when it stopped working?
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Kernel-BR] Re: [RFC] Only a.out QMAGIC format is working
  2014-04-20 11:45     ` Pavel Machek
@ 2014-04-20 12:13       ` Geyslan Gregório Bem
  2014-04-28  3:23         ` Andi Kleen
  0 siblings, 1 reply; 9+ messages in thread
From: Geyslan Gregório Bem @ 2014-04-20 12:13 UTC (permalink / raw)
  To: kernelnewbies

Em 20 de abril de 2014 08:45, Pavel Machek <pavel@ucw.cz> escreveu:

> On Sat 2014-04-19 13:37:27, Geyslan Greg?rio Bem wrote:
> > Pavel,
> >
> > Thank you.
> >
> > Maintainers, is there some chance to fix it or a.out is really
> > doomed?
>
> There should be chance to fix it.
>
> I think it too.


> Do you have some idea when it stopped working?
>

But I have no clue when it stopped.


> Pavel
> --
> (english) http://www.livejournal.com/~pavelmachek
> (cesky, pictures)
> http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
>
> --
> Voc? est? recebendo esta mensagem porque se inscreveu no grupo "Kernel
> Brasil" dos Grupos do Google.
> Para cancelar inscri??o nesse grupo e parar de receber e-mails dele, envie
> um e-mail para kernel-br+unsubscribe at googlegroups.com.
> Para postar neste grupo, envie um e-mail para kernel-br at googlegroups.com.
> Para ver esta discuss?o na web, acesse
> https://groups.google.com/d/msgid/kernel-br/20140420114501.GA12135%40amd.pavel.ucw.cz
> .
> Para obter mais op??es, acesse https://groups.google.com/d/optout.
>



-- 
Regards,

Geyslan G. Bem
hackingbits.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140420/af76770f/attachment.html 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Kernel-BR] Re: [RFC] Only a.out QMAGIC format is working
  2014-04-20 12:13       ` Geyslan Gregório Bem
@ 2014-04-28  3:23         ` Andi Kleen
  2014-04-28 10:27           ` Geyslan Gregório Bem
  0 siblings, 1 reply; 9+ messages in thread
From: Andi Kleen @ 2014-04-28  3:23 UTC (permalink / raw)
  To: kernelnewbies

Geyslan Greg?rio Bem <geyslan@gmail.com> writes:
>     
>     There should be chance to fix it.
>     
> I think it too.

If it's randomization the following could help:

echo 0 > /proc/sys/kernel/randomize_va_space

Does it?

-Andi

-- 
ak at linux.intel.com -- Speaking for myself only

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Kernel-BR] Re: [RFC] Only a.out QMAGIC format is working
  2014-04-28  3:23         ` Andi Kleen
@ 2014-04-28 10:27           ` Geyslan Gregório Bem
  0 siblings, 0 replies; 9+ messages in thread
From: Geyslan Gregório Bem @ 2014-04-28 10:27 UTC (permalink / raw)
  To: kernelnewbies

Andi,

Em 28 de abril de 2014 00:23, Andi Kleen <andi@firstfloor.org> escreveu:

> Geyslan Greg?rio Bem <geyslan@gmail.com> writes:
> >
> >     There should be chance to fix it.
> >
> > I think it too.
>
> If it's randomization the following could help:
>
> echo 0 > /proc/sys/kernel/randomize_va_space
>
> Does it?
>

Nop.

After this:

$ echo 0 | sudo tee /proc/sys/kernel/randomize_va_space

NMAGIC segfault and  the others have been killed.


> -Andi
>
> --
> ak at linux.intel.com -- Speaking for myself only
>
> --
> Voc? est? recebendo esta mensagem porque se inscreveu no grupo "Kernel
> Brasil" dos Grupos do Google.
> Para cancelar inscri??o nesse grupo e parar de receber e-mails dele, envie
> um e-mail para kernel-br+unsubscribe at googlegroups.com.
> Para postar neste grupo, envie um e-mail para kernel-br at googlegroups.com.
> Para ver esta discuss?o na web, acesse
> https://groups.google.com/d/msgid/kernel-br/8738gym90x.fsf%40tassilo.jf.intel.com
> .
> Para obter mais op??es, acesse https://groups.google.com/d/optout.
>



-- 
Regards,

Geyslan G. Bem
hackingbits.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140428/92d8538c/attachment.html 

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-04-28 10:27 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-01 12:47 [RFC] Only a.out QMAGIC format is working Geyslan Gregório Bem
2014-04-19 16:22 ` Pavel Machek
2014-04-19 16:37   ` [Kernel-BR] " Geyslan Gregório Bem
2014-04-19 18:33     ` Valdis.Kletnieks at vt.edu
2014-04-19 19:19       ` Geyslan Gregório Bem
2014-04-20 11:45     ` Pavel Machek
2014-04-20 12:13       ` Geyslan Gregório Bem
2014-04-28  3:23         ` Andi Kleen
2014-04-28 10:27           ` Geyslan Gregório Bem

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).