Commit Graph

637761 Commits

Author SHA1 Message Date
Evoke Zhang
69476fe4ed PD#138714: vout: add tvout mode monitor for box
add sysfs node /sys/class/display/mode_flag,
change mode_flag to 0 to stop monitor tvout mode.

Change-Id: Ibb3ab599c94e0beece83895605f9cc779b6dc09a
Signed-off-by: Evoke Zhang <evoke.zhang@amlogic.com>
2017-04-14 03:32:27 -07:00
Xingyu Chen
5e951a45f3 dts: update parameters of gpio irq for gxm
PD#138714: dts: update parameters of gpio irq for gxm

Change-Id: Ib5b21eadf1a12dad78db9a08fd6cc72ef21c8527
Signed-off-by: Xingyu Chen <xingyu.chen@amlogic.com>
2017-04-14 02:26:36 -07:00
Yun Cai
8fe32fd3c8 efuse: support m8baby
PD#141217: initialize m8baby efuse

Change-Id: I1b88e61f952ea0431a635238770a80e221868b64
Signed-off-by: Yun Cai <yun.cai@amlogic.com>
2017-04-14 02:11:09 -07:00
Tao Zeng
5b0f016ff9 cec: add cec drivers for m8baby
PD#141217: initial add cec drivers for m8baby

1. update dts config for m200;
2. update KConfig and Makefiles for compile cec drivers;
3. add driver files to support cec driver on m8baby

Change-Id: I8e96839542360e625c47c5c31f4ddd45b3b93bc7
Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
2017-04-14 02:08:21 -07:00
Tao Zeng
3537756b8e dvfs: add dvfs support for m8baby
PD#141217: add dvfs drivers for m8baby

1. add dts and Kconfig/Makefile support for dvfs drivers;
2. add source code of drivers

Change-Id: I2735b31d602d0aaa4118738ebf96f88d72369628
Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
2017-04-14 01:56:32 -07:00
Tao Zeng
aef00313b3 cpufreq: add cpufreq drivers for m8baby
PD#141217: porting cpufreq drivers for m8baby

1. add driver source code files of cpufreq;
2. update dts and Make files;

Change-Id: I905f62ec7f89ae3f1ea06de988d23d4ef009a477
Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
2017-04-14 01:50:21 -07:00
Xingyu Chen
a55ffd9aad saradc: add sar adc driver support for m8b
PD#141217: add sar adc driver support for m8b

Change-Id: If0c43fe2c938d776e15d8dda03523626c6613e9f
Signed-off-by: Xingyu Chen <xingyu.chen@amlogic.com>
2017-04-14 01:33:40 -07:00
Peipeng Zhao
ac50358ec2 dts: add m400 dts
PD#141217: add m400 dts
m400 is A111 development board with SLC Nand

Change-Id: I47a3528df70f656c7d631d9c35cbca87dc702f97
Signed-off-by: Peipeng Zhao <peipeng.zhao@amlogic.com>
2017-04-14 15:25:28 +08:00
Pengcheng Chen
cd14fc32bd osd: osd logo optimize
PD#138714: osd logo optimize
1.move logo module,merge it into osd driver
2.fix remove get_logo_vmode() api caused video.c compile error

Change-Id: I8c90c0313fbf5661082627f7a37b3e465ba594da
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>
2017-04-13 23:15:46 -07:00
Evoke Zhang
273478ff4a hdmitx: add VPP_POSTBLEND_H_SIZE config
PD#138714: add VPP_POSTBLEND_H_SIZE config

Change-Id: I8e203690b12cae712c7c18f2fd601fc6d3fe0d40
Signed-off-by: Evoke Zhang <evoke.zhang@amlogic.com>
2017-04-13 20:54:31 -07:00
Pengcheng Chen
8232820372 osd: fix osd display error for logo module not loaded
PD#138714: fix osd display error for logo module not loaded


Change-Id: Ie33d76d344b47175acdbb232fd8c7265a0800450
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>
2017-04-13 05:41:52 -07:00
Xing Wang
fda2f6024c audio: adjust pcm bclk for 24/32bit
PD#141217: fix pcm 24/32bit support

Change-Id: I3aae169645ec237079a17c89ce4f5361962a3e62
Signed-off-by: Xing Wang <xing.wang@amlogic.com>
2017-04-13 05:33:06 -07:00
Jian Hu
188e2d88c6 pwm: add support for m8b
PD#141217: add pwm support for m8b
1.add support for m8b
2.add pwm driver support for txlx

verified on m8b

Change-Id: Id6980f090062d05315ca03a7248e4d318181c76c
Signed-off-by: Jian Hu <jian.hu@amlogic.com>
2017-04-13 04:56:26 -07:00
Xuhua Zhang
6dd7266c3c i2c: add i2c support on m8b
PD#141217: add i2c support on m8b.
add i2c ao~d support.

Change-Id: Ibc46745d99b172186255fc3f47be42e04480c9a9
Signed-off-by: Jian Hu <jian.hu@amlogic.com>
Signed-off-by: Jianxin Pan <jianxin.pan@amlogic.com>
2017-04-13 19:42:24 +08:00
Jianxin Pan
a462a4f47a hotplug: add cpu hotplug support for m8b
PD#141217: add cpu hotplug support for m8b
1) enable CONFIG_AMLOGIC_CPU_HOTPLUG
2) clusterID of M8b is 2

Change-Id: I8f6dc6ced430364beb5eb82f20cb7034eb714eb0
Signed-off-by: Jianxin Pan <jianxin.pan@amlogic.com>
2017-04-13 03:55:30 -07:00
Jianxin Pan
c640050156 cpu_version: add cpu version for m8b
PD#141217: add cpu version for m8b

Change-Id: I2d2fd64e5d27aa7c7887bc34adab058fc1a82e44
Signed-off-by: Jianxin Pan <jianxin.pan@amlogic.com>
2017-04-13 18:37:35 +08:00
Matthew Shyu
2137fb1fcc crypto: fix blkmv irq initialization
PD#141217: fix blkmv irq initialization

Change-Id: I588e48b40207b6371df66d511ff56dfbeff21fba
Signed-off-by: Matthew Shyu <matthew.shyu@amlogic.com>
2017-04-12 17:14:01 +08:00
Nan Li
46148b7e38 emmc: add emmc driver support on m8b
PD#141217: initial add emmc dirver support on m8b
1) add emmc driver support
HS200 mode 85M
2) add sd driver support
HS mode 38M

test on m8b_m200.

Change-Id: I1575c45af2e1246019d54a8092ee29e1da0a1a70
Signed-off-by: Nan Li <nan.li@amlogic.com>
2017-04-11 20:53:55 +08:00
Xingyu Chen
eac32a1357 pinctrl: add pinctrl & gpio support for m8b
PD#141217: add pinctrl & gpio support for m8b

fix gpio irq bugs

TODO: because of limitation of software framework and gpio irq
lines, the ao gpio pins on M8B don't support external irq detect,
and suggest using ee gpio pins to detect.

Change-Id: I933b71104877d97444107d8fba56e3540f94efff
Signed-off-by: Xingyu Chen <xingyu.chen@amlogic.com>
2017-04-11 05:46:44 -07:00
Jianxin Pan
637a972c26 defconfig: meson32: enable reg_access
PD#141217: enable paddr in debugfs

Change-Id: Ia8d139c02da92c2f1db5dd8c34bfcb7b86863821
Signed-off-by: Jianxin Pan <jianxin.pan@amlogic.com>
2017-04-11 05:42:45 -07:00
Matthew Shyu
195ea69f96 crypto: initial add crypto drivers based on BLKMV
PD#141217: crypto drivers based on BLKMV are under
CONFIG_AMLOGIC_CRYPTO_BLKMV
and move DMA version to CONFIG_AMLOGIC_CRYPTO_DMA

Change-Id: I42561765a599dc3611a144da6a455df5bded59d5
Signed-off-by: Matthew Shyu <matthew.shyu@amlogic.com>
2017-04-11 05:36:18 -07:00
Frank Chen
73f711076a defconfig: mesoo64: enable CONFIG_GPIO_SYSFS
PD#138714: enable CONFIG_GPIO_SYSFS

gpio sysfs interface allow control gpio in userspace

Change-Id: I922d9d270aedf541b08b14f53a0a0a7a25664341
Signed-off-by: Frank Chen <frank.chen@amlogic.com>
2017-04-11 20:07:04 +08:00
Yue Wang
80cb2148c8 defconfig: meson32: generate defconfig from savedefconfig
PD#141217: generate meson32_defconfig from savedefconfig

Change-Id: I3370f4c9e936095aeca7d6ec5fb163c91725c7b7
Signed-off-by: Yue Wang <yue.wang@amlogic.com>
2017-04-10 19:30:38 -07:00
Guosong Zhou
252cab3b35 ionvideo: initial add the driver
PD#138714: initial add the driver

1.Add amlogic ionvideo driver;
2.device tree support of ionvideo for p212/q200/skt/p400/p401;
3.related Makefiles/Kconfig/Headfiles update;

Change-Id: I2c0013a8ab256f73618b7f583c3b275fa3aaeebb
Signed-off-by: Guosong Zhou <guosong.zhou@amlogic.com>
2017-04-10 02:15:15 -07:00
Bo Yang
e96f8d445b dts: add led, watchdog, and jtag device node
PD#138714: dts: add led, watchdog, and jtag device node

Change-Id: Ie367c0e7acd67be9d12d5d3b32ac43d8a4eee10f
Signed-off-by: Bo Yang <bo.yang@amlogic.com>
2017-04-09 23:49:39 -07:00
Pengcheng Chen
708ee01881 ge2d: move ge2d class register to ge2d probe
PD#138714: move ge2d class register to ge2d probe.

Change-Id: I09767d937fedf9ca67a8640e2ea989c32fb901f1
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>
2017-04-10 10:02:24 +08:00
Victor Wan
7abf625bfc Merge branch 'linux-linaro-lsk-v4.9' into amlogic-4.9-dev 2017-04-07 19:38:16 +08:00
Nan Li
8092b22e21 emmc: modify emmc suspend and resume fail
PD#138714: when emmc suspend & resume, emmc probe fail.

Change-Id: Ib62092ecc96a3692f02a2509757177713af7de45
Signed-off-by: Nan Li <nan.li@amlogic.com>
2017-04-06 19:13:03 -07:00
Nanxin Qin
daf34ea5e7 media: update video.c & enable vsync interrupt
PD#142052: update video.c & enable vsync interrupt
1. the DEBUG_TMP is used to debug temporary
2. add meson-amvideom node is used to vsync the config in the dts

Change-Id: Id08e30e92fca45d2e07ac1321b834fcf437e3d0a
Signed-off-by: Nanxin Qin <nanxin.qin@amlogic.com>
2017-04-05 19:06:56 -07:00
Ke Gong
7b663ab7ed dvb: add 32/64 bits compatibility support
PD#138714: add 32/64 bits compatibility support for dvb

1.add 32/64 bits compatibility support for dvb
2.add extension descrambler setting interface in CA
3.add DTV_TS_INPUT property
4.add CONFIG_AMLOGIC_DVB_COMPAT

Change-Id: Ifb48e1671446f3ac14db764b39ab1535950f177a
Signed-off-by: Ke Gong <ke.gong@amlogic.com>
2017-04-05 20:45:33 +08:00
Jianxin Pan
c353ab2a6f build: fix compile warnings from section mismatch
PD#138714: warning messages like this

WARNING: modpopst: Found 3 section mismath(es).

Change-Id: I26bbdfc9ef04bf177dbab69a7383aaea142b7e37
Signed-off-by: Jianxin Pan <jianxin.pan@amlogic.com>
2017-04-05 04:43:36 -07:00
Rongjun Chen
c36ba0f0f7 wifi/bt: initial add wifi and bt driver
PD#138714: initial add wifi and bt

Change-Id: I96b3731297860c77a5a125573b98be7e54950cb1
Signed-off-by: Rongjun Chen <rongjun.chen@amlogic.com>
2017-04-05 18:06:23 +08:00
Jianxin Pan
c360ae91bb defconfig: meson64: defconfig for no video device
PD#138714: meson64_audio_defconfig

Change-Id: I6af9bae918ab684c5353c0331eb3c85f9b3b003e
Signed-off-by: Jianxin Pan <jianxin.pan@amlogic.com>
2017-04-04 20:02:05 -07:00
Yan Wang
6e87152654 meson32: fix m8b cpu hotplug crash issue
PD#141217: fix m8b cpu hotplug crash issue

Change-Id: I7a80785a37a9ed4ab05f25cdc5ba43deba83d74c
Signed-off-by: Yan Wang <yan.wang@amlogic.com>
2017-04-04 18:44:24 -07:00
Bo Yang
7646d275b5 led: add system gpio led driver support
PD#138714: led: add system gpio led driver support

add new configuration:

+CONFIG_AMLOGIC_LED=y
+CONFIG_AMLOGIC_LED_SYS=y

Change-Id: I34c3740eaf9efb02667d9e3d7e95ef8570e2c63c
Signed-off-by: Bo Yang <bo.yang@amlogic.com>
2017-03-31 23:14:57 -07:00
Bo Yang
afd1a77810 watchdog: initial add meson watchdog driver
PD#138714: watchdog: initial add meson watchdog driver

add two configurations
+CONFIG_AMLOGIC_WDT=y
+CONFIG_AMLOGIC_WDT_MESON=y

Change-Id: If48e1cb61ec6f51e4fa903a83f67cdeffdd5a5b4
Signed-off-by: Bo Yang <bo.yang@amlogic.com>
2017-04-01 13:47:47 +08:00
Sunny Luo
1570047aa4 spicc: initial add spicc driver
PD#138714: spicc: initial add spicc driver

Change-Id: I60aa176f7bd9d64bd6e9db56adc7f592bc856f50
Signed-off-by: Sunny Luo <sunny.luo@amlogic.com>
2017-04-01 13:39:14 +08:00
Guosong Zhou
8a363156d2 amlvideo: initial add the driver
PD#138714: initial add the driver

1.Add amlogic amlvideo driver;
2.related Makefiles/Kconfig/Headfiles update;

Change-Id: If506455a1611af9a940112a8b37ab8c63b6a37d8
Signed-off-by: Guosong Zhou <guosong.zhou@amlogic.com>
2017-04-01 13:36:28 +08:00
Bo Yang
5a3633a1a3 jtag: add jtag setup driver support
PD#138714: jtag: add jtag setup driver support

add two configuration fot jtag support:

+CONFIG_AMLOGIC_JTAG=y
+CONFIG_AMLOGIC_JTAG_MESON=y

Change-Id: Ic0bdd336b1ec8ca31359f1a6ab0b0e305a8e37d1
Signed-off-by: Bo Yang <bo.yang@amlogic.com>
2017-04-01 11:58:44 +08:00
Greg Kroah-Hartman
f676772746 Linux 4.9.20 2017-03-31 10:32:02 +02:00
Bin Liu
1dc3a068cc usb: musb: fix possible spinlock deadlock
commit bc1e215454 upstream.

The DSPS glue calls del_timer_sync() in its musb_platform_disable()
implementation, which requires the caller to not hold a lock. But
musb_remove() calls musb_platform_disable() will musb->lock held. This
could causes spinlock deadlock.

So change musb_remove() to call musb_platform_disable() without holds
musb->lock. This doesn't impact the musb_platform_disable implementation
in other glue drivers.

root@am335x-evm:~# modprobe -r musb-dsps
[  126.134879] musb-hdrc musb-hdrc.1: remove, state 1
[  126.140465] usb usb2: USB disconnect, device number 1
[  126.146178] usb 2-1: USB disconnect, device number 2
[  126.416985] musb-hdrc musb-hdrc.1: USB bus 2 deregistered
[  126.423943]
[  126.425525] ======================================================
[  126.431997] [ INFO: possible circular locking dependency detected ]
[  126.438564] 4.11.0-rc1-00003-g1557f13bca04-dirty #77 Not tainted
[  126.444852] -------------------------------------------------------
[  126.451414] modprobe/778 is trying to acquire lock:
[  126.456523]  (((&glue->timer))){+.-...}, at: [<c01b8788>] del_timer_sync+0x0/0xd0
[  126.464403]
[  126.464403] but task is already holding lock:
[  126.470511]  (&(&musb->lock)->rlock){-.-...}, at: [<bf30b7f8>] musb_remove+0x50/0x1
30 [musb_hdrc]
[  126.479965]
[  126.479965] which lock already depends on the new lock.
[  126.479965]
[  126.488531]
[  126.488531] the existing dependency chain (in reverse order) is:
[  126.496368]
[  126.496368] -> #1 (&(&musb->lock)->rlock){-.-...}:
[  126.502968]        otg_timer+0x80/0xec [musb_dsps]
[  126.507990]        call_timer_fn+0xb4/0x390
[  126.512372]        expire_timers+0xf0/0x1fc
[  126.516754]        run_timer_softirq+0x80/0x178
[  126.521511]        __do_softirq+0xc4/0x554
[  126.525802]        irq_exit+0xe8/0x158
[  126.529735]        __handle_domain_irq+0x58/0xb8
[  126.534583]        __irq_usr+0x54/0x80
[  126.538507]
[  126.538507] -> #0 (((&glue->timer))){+.-...}:
[  126.544636]        del_timer_sync+0x40/0xd0
[  126.549066]        musb_remove+0x6c/0x130 [musb_hdrc]
[  126.554370]        platform_drv_remove+0x24/0x3c
[  126.559206]        device_release_driver_internal+0x14c/0x1e0
[  126.565225]        bus_remove_device+0xd8/0x108
[  126.569970]        device_del+0x1e4/0x308
[  126.574170]        platform_device_del+0x24/0x8c
[  126.579006]        platform_device_unregister+0xc/0x20
[  126.584394]        dsps_remove+0x14/0x30 [musb_dsps]
[  126.589595]        platform_drv_remove+0x24/0x3c
[  126.594432]        device_release_driver_internal+0x14c/0x1e0
[  126.600450]        driver_detach+0x38/0x6c
[  126.604740]        bus_remove_driver+0x4c/0xa0
[  126.609407]        SyS_delete_module+0x11c/0x1e4
[  126.614252]        __sys_trace_return+0x0/0x10

Fixes: ea2f35c01d ("usb: musb: Fix sleeping function called from invalid context for hdrc glue")
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-31 10:31:46 +02:00
Sebastian Andrzej Siewior
916c5cfeab sched/rt: Add a missing rescheduling point
commit 619bd4a718 upstream.

Since the change in commit:

  fd7a4bed18 ("sched, rt: Convert switched_{from, to}_rt() / prio_changed_rt() to balance callbacks")

... we don't reschedule a task under certain circumstances:

Lets say task-A, SCHED_OTHER, is running on CPU0 (and it may run only on
CPU0) and holds a PI lock. This task is removed from the CPU because it
used up its time slice and another SCHED_OTHER task is running. Task-B on
CPU1 runs at RT priority and asks for the lock owned by task-A. This
results in a priority boost for task-A. Task-B goes to sleep until the
lock has been made available. Task-A is already runnable (but not active),
so it receives no wake up.

The reality now is that task-A gets on the CPU once the scheduler decides
to remove the current task despite the fact that a high priority task is
enqueued and waiting. This may take a long time.

The desired behaviour is that CPU0 immediately reschedules after the
priority boost which made task-A the task with the lowest priority.

Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: fd7a4bed18 ("sched, rt: Convert switched_{from, to}_rt() prio_changed_rt() to balance callbacks")
Link: http://lkml.kernel.org/r/20170124144006.29821-1-bigeasy@linutronix.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-31 10:31:46 +02:00
Eric Biggers
2984e52c75 fscrypt: remove broken support for detecting keyring key revocation
commit 1b53cf9815 upstream.

Filesystem encryption ostensibly supported revoking a keyring key that
had been used to "unlock" encrypted files, causing those files to become
"locked" again.  This was, however, buggy for several reasons, the most
severe of which was that when key revocation happened to be detected for
an inode, its fscrypt_info was immediately freed, even while other
threads could be using it for encryption or decryption concurrently.
This could be exploited to crash the kernel or worse.

This patch fixes the use-after-free by removing the code which detects
the keyring key having been revoked, invalidated, or expired.  Instead,
an encrypted inode that is "unlocked" now simply remains unlocked until
it is evicted from memory.  Note that this is no worse than the case for
block device-level encryption, e.g. dm-crypt, and it still remains
possible for a privileged user to evict unused pages, inodes, and
dentries by running 'sync; echo 3 > /proc/sys/vm/drop_caches', or by
simply unmounting the filesystem.  In fact, one of those actions was
already needed anyway for key revocation to work even somewhat sanely.
This change is not expected to break any applications.

In the future I'd like to implement a real API for fscrypt key
revocation that interacts sanely with ongoing filesystem operations ---
waiting for existing operations to complete and blocking new operations,
and invalidating and sanitizing key material and plaintext from the VFS
caches.  But this is a hard problem, and for now this bug must be fixed.

This bug affected almost all versions of ext4, f2fs, and ubifs
encryption, and it was potentially reachable in any kernel configured
with encryption support (CONFIG_EXT4_ENCRYPTION=y,
CONFIG_EXT4_FS_ENCRYPTION=y, CONFIG_F2FS_FS_ENCRYPTION=y, or
CONFIG_UBIFS_FS_ENCRYPTION=y).  Note that older kernels did not use the
shared fs/crypto/ code, but due to the potential security implications
of this bug, it may still be worthwhile to backport this fix to them.

Fixes: b7236e21d5 ("ext4 crypto: reorganize how we store keys in the inode")
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Acked-by: Michael Halcrow <mhalcrow@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-31 10:31:46 +02:00
Dave Martin
21c95eca62 metag/ptrace: Reject partial NT_METAG_RPIPE writes
commit 7195ee3120 upstream.

It's not clear what behaviour is sensible when doing partial write of
NT_METAG_RPIPE, so just don't bother.

This patch assumes that userspace will never rely on a partial SETREGSET
in this case, since it's not clear what should happen anyway.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Acked-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-31 10:31:46 +02:00
Dave Martin
2d6532ceb4 metag/ptrace: Provide default TXSTATUS for short NT_PRSTATUS
commit 5fe81fe981 upstream.

Ensure that if userspace supplies insufficient data to PTRACE_SETREGSET
to fill TXSTATUS, a well-defined default value is used, based on the
task's current value.

Suggested-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-31 10:31:46 +02:00
Dave Martin
2739b48741 metag/ptrace: Preserve previous registers for short regset write
commit a78ce80d2c upstream.

Ensure that if userspace supplies insufficient data to PTRACE_SETREGSET
to fill all the registers, the thread's old registers are preserved.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Acked-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-31 10:31:46 +02:00
Dave Martin
84b94c4356 sparc/ptrace: Preserve previous registers for short regset write
commit d3805c546b upstream.

Ensure that if userspace supplies insufficient data to PTRACE_SETREGSET
to fill all the registers, the thread's old registers are preserved.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-31 10:31:46 +02:00
Dave Martin
0ba34c87f7 mips/ptrace: Preserve previous registers for short regset write
commit d614fd58a2 upstream.

Ensure that if userspace supplies insufficient data to PTRACE_SETREGSET
to fill all the registers, the thread's old registers are preserved.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-31 10:31:46 +02:00
Dave Martin
616fe993f4 h8300/ptrace: Fix incorrect register transfer count
commit 502585c755 upstream.

regs_set() and regs_get() are vulnerable to an off-by-1 buffer overrun
if CONFIG_CPU_H8S is set, since this adds an extra entry to
register_offset[] but not to user_regs_struct.

So, iterate over user_regs_struct based on its actual size, not based on
the length of register_offset[].

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-31 10:31:46 +02:00
Dave Martin
d77bd2d6a4 c6x/ptrace: Remove useless PTRACE_SETREGSET implementation
commit fb411b837b upstream.

gpr_set won't work correctly and can never have been tested, and the
correct behaviour is not clear due to the endianness-dependent task
layout.

So, just remove it.  The core code will now return -EOPNOTSUPPORT when
trying to set NT_PRSTATUS on this architecture until/unless a correct
implementation is supplied.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-31 10:31:46 +02:00