linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 08/11] signal/arm: Document conflicts with SI_USER and SIGFPE
Date: Mon, 15 Jan 2018 14:12:26 -0600	[thread overview]
Message-ID: <878tcyop91.fsf@xmission.com> (raw)
In-Reply-To: <20180115174947.GH17719@n2100.armlinux.org.uk> (Russell King's message of "Mon, 15 Jan 2018 17:49:47 +0000")

Russell King - ARM Linux <linux@armlinux.org.uk> writes:

> On Thu, Jan 11, 2018 at 06:59:37PM -0600, Eric W. Biederman wrote:
>> Setting si_code to 0 results in a userspace seeing an si_code of 0.
>> This is the same si_code as SI_USER.  Posix and common sense requires
>> that SI_USER not be a signal specific si_code.  As such this use of 0
>> for the si_code is a pretty horribly broken ABI.
>> 
>> Further use of si_code == 0 guaranteed that copy_siginfo_to_user saw a
>> value of __SI_KILL and now sees a value of SIL_KILL with the result
>> that uid and pid fields are copied and which might copying the si_addr
>> field by accident but certainly not by design.  Making this a very
>> flakey implementation.
>> 
>> Utilizing FPE_FIXME, siginfo_layout will now return SIL_FAULT and the
>> appropriate fields will be reliably copied.
>
> So what do you suggest when none of the SIGFPE FPE_xxx codes match the
> condition that "we don't know what happened" ?  Raise a SIGKILL instead
> maybe?  We will have dumped the VFP state into the kernel log at this
> point, things are pretty much fscked.
>
> It's probably an impossible condition unless the hardware has failed,
> no one has knowingly reported getting such a dump in their kernel log,
> so it's something that could very likely be changed in some way
> without anyone noticing.

It sounds like we have two equally valid possible solutions:
1) force_sig(SIGKILL, current);
2) Allocate a new FPE_xxx code in asm-generic/siginfo.h
   I believe the next available number is 15.

If no one is going to notice this should be comparatively easy to fix.
I just don't have the knowledge of arm to make the judgement myself.

Eric

  reply	other threads:[~2018-01-15 20:12 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87373b6ghs.fsf@xmission.com>
2018-01-12  0:59 ` [PATCH 07/11] signal/arm64: Document conflicts with SI_USER and SIGFPE, SIGTRAP, SIGBUS Eric W. Biederman
2018-01-15 16:30   ` Dave Martin
2018-01-15 17:23     ` Eric W. Biederman
     [not found]       ` <20180116172407.GA22781@e103592.cambridge.arm.com>
     [not found]         ` <871sipl9p9.fsf@xmission.com>
2018-01-17 11:46           ` Dave Martin
2018-01-17 11:57           ` Russell King - ARM Linux
2018-01-17 12:15             ` Dave Martin
2018-01-17 12:37               ` Russell King - ARM Linux
2018-01-17 15:37                 ` Dave Martin
2018-01-17 15:49                   ` Russell King - ARM Linux
2018-01-17 16:11                     ` Dave Martin
2018-01-17 16:45                 ` Eric W. Biederman
2018-01-17 17:14                   ` Russell King - ARM Linux
2018-01-24 21:28                     ` Eric W. Biederman
2018-01-17 17:17       ` Dave Martin
2018-01-17 17:24         ` Eric W. Biederman
2018-01-17 17:39           ` Dave Martin
2018-01-15 19:30     ` James Morse
2018-01-12  0:59 ` [PATCH 08/11] signal/arm: Document conflicts with SI_USER and SIGFPE Eric W. Biederman
2018-01-15 17:49   ` Russell King - ARM Linux
2018-01-15 20:12     ` Eric W. Biederman [this message]
2018-01-19 12:05     ` Dave Martin

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=878tcyop91.fsf@xmission.com \
    --to=ebiederm@xmission.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 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).