linux/arch
Joel Stanley caf69ba627 powerpc/powernv: Fix reading of OPAL msglog
memory_return_from_buffer returns a signed value, so ret should be
ssize_t.

Fixes the following issue reported by David Binderman:

  [linux-3.15/arch/powerpc/platforms/powernv/opal-msglog.c:65]: (style)
  Checking if unsigned variable 'ret' is less than zero.
  [linux-3.15/arch/powerpc/platforms/powernv/opal-msglog.c:82]: (style)
  Checking if unsigned variable 'ret' is less than zero.

  Local variable "ret" is of type size_t. This is always unsigned,
  so it is pointless to check if it is less than zero.

  https://bugzilla.kernel.org/show_bug.cgi?id=77551

Fixing this exposes a real bug for the case where the entire count
bytes is successfully read from the POS_WRAP case. The second
memory_read_from_buffer will return EINVAL, causing the entire read to
return EINVAL to userspace, despite the data being copied correctly. The
fix is to test for the case where the data has been read and return
early.

Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-06-11 17:03:36 +10:00
..
alpha Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into next 2014-06-03 14:00:15 -07:00
arc Nothing too exciting here, just minor fixes/cleanup. Only noteworthy ones are: 2014-06-09 18:05:11 -07:00
arm Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2014-06-09 18:46:02 -07:00
arm64 arm64: add APM X-Gene SoC RTC DTS entry 2014-06-06 16:08:06 -07:00
avr32 Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip into next 2014-06-03 12:57:53 -07:00
blackfin blackfin/ptrace: call find_vma with the mmap_sem held 2014-06-06 16:08:16 -07:00
c6x DeviceTree for 3.16: 2014-06-04 10:02:38 -07:00
cris cris: update comments for generic idle conversion 2014-06-06 16:08:18 -07:00
frv sys_sgetmask/sys_ssetmask: add CONFIG_SGETMASK_SYSCALL 2014-06-04 16:54:14 -07:00
hexagon Hexagon: Delete stale barrier.h 2014-05-01 10:09:47 -07:00
ia64 ia64: convert use of typedef ctl_table to struct ctl_table 2014-06-06 16:08:15 -07:00
m32r
m68k signals: kill sigfindinword() 2014-06-06 16:08:11 -07:00
metag hugetlb: restrict hugepage_migration_support() to x86_64 2014-06-04 16:53:51 -07:00
microblaze Microblaze patches for 3.16-rc1 2014-06-05 16:15:33 -07:00
mips Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2014-06-09 18:10:34 -07:00
mn10300 sys_sgetmask/sys_ssetmask: add CONFIG_SGETMASK_SYSCALL 2014-06-04 16:54:14 -07:00
openrisc DeviceTree for 3.16: 2014-06-04 10:02:38 -07:00
parisc - Optimised assembly string/memory routines (based on the AArch64 Cortex 2014-06-06 10:43:28 -07:00
powerpc powerpc/powernv: Fix reading of OPAL msglog 2014-06-11 17:03:36 +10:00
s390 Merge branch 'akpm' (patchbomb from Andrew) into next 2014-06-04 16:55:13 -07:00
score
sh - Optimised assembly string/memory routines (based on the AArch64 Cortex 2014-06-06 10:43:28 -07:00
sparc sys_sgetmask/sys_ssetmask: add CONFIG_SGETMASK_SYSCALL 2014-06-04 16:54:14 -07:00
tile tile: convert use of typedef ctl_table to struct ctl_table 2014-06-06 16:08:15 -07:00
um mm: split 'tlb_flush_mmu()' into tlb flushing and memory freeing parts 2014-04-25 16:05:40 -07:00
unicore32 arch/unicore32/mm/ioremap.c: return NULL on invalid pfn 2014-06-04 16:53:53 -07:00
x86 Merge git://www.linux-watchdog.org/linux-watchdog 2014-06-10 19:16:36 -07:00
xtensa - Optimised assembly string/memory routines (based on the AArch64 Cortex 2014-06-06 10:43:28 -07:00
.gitignore
Kconfig