All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Weinberger <richard@nod.at>
To: "Martin Pärtel" <martin.partel@gmail.com>
Cc: "user-mode-linux-devel@lists.sourceforge.net"
	<user-mode-linux-devel@lists.sourceforge.net>
Subject: Re: [uml-devel] [PATCH] um: pass siginfo to guest process
Date: Fri, 08 Jun 2012 00:07:55 +0200	[thread overview]
Message-ID: <4FD1263B.5070208@nod.at> (raw)
In-Reply-To: <4FD11F90.5080407@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1486 bytes --]

Am 07.06.2012 23:39, schrieb Martin Pärtel:
> On 06/08/2012 12:26 AM, Richard Weinberger wrote:
> 
>> Am 07.06.2012 22:59, schrieb Martin Pärtel:
>>> Signal handlers in UML guest processes now get correct siginfo_t fields
>>> for SIGTRAP, SIGFPE, SIGILL and SIGBUS. Specifically, si_addr and si_code
>>> are now correct where previously they were si_addr = NULL and si_code = 128.
>>
>> What exactly is broken?
>> In my SIGSEGV test case si_addr is not NULL, it contains the correct faulting address.
>>
> 
> 
> SIGSEGV is probably fine. At least SIGFPE is not. Test program below.
> 
>>> +
>>> +            ptrace(PTRACE_GETSIGINFO, pid, 0,&si);
>>> +
>>
>> Doesn't this leak the host siginfo_t into the guest?
>>
> 
> 
> Docs for PTRACE_GETSIGINFO say `si' gets a copy. After that, `si' is not used for anything other than giving it to the guest. But I really can't say I
> understand the surrounding code too well so please review carefully :)

I was not talking about a memory leak.
What I meant was a information leak.
Using the host siginfo_t a guest process may get it's UID, PID, memory location, etc... on the host side.

Anyway, thanks for the test case!
This seems to be really broken.
I had only a few minutes to look at the issue but I think the correct way to fix is changing
arch/um/kernel/trap.c:relay_signal() to use force_sig_info() instead of force_sig().
Create siginfo_t and fill by hand like segv() does.

Thanks,
//richard


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

[-- Attachment #2: Type: text/plain, Size: 395 bytes --]

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

[-- Attachment #3: Type: text/plain, Size: 194 bytes --]

_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

  parent reply	other threads:[~2012-06-07 22:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-07 20:59 [uml-devel] [PATCH] um: pass siginfo to guest process Martin Pärtel
2012-06-07 21:26 ` Richard Weinberger
2012-06-07 21:41   ` Martin Pärtel
     [not found]   ` <4FD11F90.5080407@gmail.com>
2012-06-07 22:07     ` Richard Weinberger [this message]
2012-06-07 22:42       ` Martin Pärtel
2012-06-07 22:47         ` Richard Weinberger

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=4FD1263B.5070208@nod.at \
    --to=richard@nod.at \
    --cc=martin.partel@gmail.com \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /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.