]> git.baikalelectronics.ru Git - kernel.git/commit
s390: fix normalization bug in exception table sorting
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 1 Jan 2016 12:39:22 +0000 (13:39 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Mon, 11 Jan 2016 12:02:28 +0000 (13:02 +0100)
commitd601a67c3de1d769436e538b551ffc859c64e00f
treecf1c9e74ce980a0dccec5b657de5f8a0568f2abe
parent7040732bd16c00f00d4f1f178c2bcc8012d56861
s390: fix normalization bug in exception table sorting

The normalization pass in the sorting routine of the relative exception
table serves two purposes:
- it ensures that the address fields of the exception table entries are
  fully ordered, so that no ambiguities arise between entries with
  identical instruction offsets (i.e., when two instructions that are
  exactly 8 bytes apart each have an exception table entry associated with
  them)
- it ensures that the offsets of both the instruction and the fixup fields
  of each entry are relative to their final location after sorting.

Commit 5953e4079f32 ("s390/exceptions: switch to relative exception table
entries") ported the relative exception table format from x86, but modified
the sorting routine to only normalize the instruction offset field and not
the fixup offset field. The result is that the fixup offset of each entry
will be relative to the original location of the entry before sorting,
likely leading to crashes when those entries are dereferenced.

Fixes: 5953e4079f32 ("s390/exceptions: switch to relative exception table entries")
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/mm/extable.c