linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Al Viro <viro@zeniv.linux.org.uk>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	stable@kernel.org
Subject: [PATCH 4.17 60/63] alpha: fix osf_wait4() breakage
Date: Mon, 23 Jul 2018 14:25:06 +0200	[thread overview]
Message-ID: <20180723122448.624282129@linuxfoundation.org> (raw)
In-Reply-To: <20180723122446.351334162@linuxfoundation.org>

4.17-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Al Viro <viro@ZenIV.linux.org.uk>

commit f88a333b44318643282b8acc92af90deda441f5e upstream.

kernel_wait4() expects a userland address for status - it's only
rusage that goes as a kernel one (and needs a copyout afterwards)

[ Also, fix the prototype of kernel_wait4() to have that __user
  annotation   - Linus ]

Fixes: 92ebce5ac55d ("osf_wait4: switch to kernel_wait4()")
Cc: stable@kernel.org # v4.13+
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/alpha/kernel/osf_sys.c |    5 +----
 include/linux/sched/task.h  |    2 +-
 2 files changed, 2 insertions(+), 5 deletions(-)

--- a/arch/alpha/kernel/osf_sys.c
+++ b/arch/alpha/kernel/osf_sys.c
@@ -1183,13 +1183,10 @@ SYSCALL_DEFINE2(osf_getrusage, int, who,
 SYSCALL_DEFINE4(osf_wait4, pid_t, pid, int __user *, ustatus, int, options,
 		struct rusage32 __user *, ur)
 {
-	unsigned int status = 0;
 	struct rusage r;
-	long err = kernel_wait4(pid, &status, options, &r);
+	long err = kernel_wait4(pid, ustatus, options, &r);
 	if (err <= 0)
 		return err;
-	if (put_user(status, ustatus))
-		return -EFAULT;
 	if (!ur)
 		return err;
 	if (put_tv_to_tv32(&ur->ru_utime, &r.ru_utime))
--- a/include/linux/sched/task.h
+++ b/include/linux/sched/task.h
@@ -75,7 +75,7 @@ extern long _do_fork(unsigned long, unsi
 extern long do_fork(unsigned long, unsigned long, unsigned long, int __user *, int __user *);
 struct task_struct *fork_idle(int);
 extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
-extern long kernel_wait4(pid_t, int *, int, struct rusage *);
+extern long kernel_wait4(pid_t, int __user *, int, struct rusage *);
 
 extern void free_task(struct task_struct *tsk);
 



  parent reply	other threads:[~2018-07-23 12:28 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-23 12:24 [PATCH 4.17 00/63] 4.17.10-stable review Greg Kroah-Hartman
2018-07-23 12:24 ` [PATCH 4.17 01/63] scsi: sd_zbc: Fix variable type and bogus comment Greg Kroah-Hartman
2018-07-23 12:24 ` [PATCH 4.17 02/63] scsi: qla2xxx: Fix inconsistent DMA mem alloc/free Greg Kroah-Hartman
2018-07-23 12:24 ` [PATCH 4.17 03/63] scsi: qla2xxx: Fix kernel crash due to late workqueue allocation Greg Kroah-Hartman
2018-07-23 12:24 ` [PATCH 4.17 04/63] scsi: qla2xxx: Fix NULL pointer dereference for fcport search Greg Kroah-Hartman
2018-07-23 12:24 ` [PATCH 4.17 06/63] KVM: irqfd: fix race between EPOLLHUP and irq_bypass_register_consumer Greg Kroah-Hartman
2018-07-23 12:24 ` [PATCH 4.17 07/63] KVM: VMX: Mark VMXArea with revision_id of physical CPU even when eVMCS enabled Greg Kroah-Hartman
2018-07-23 12:24 ` [PATCH 4.17 08/63] x86/kvm/vmx: dont read current->thread.{fs,gs}base of legacy tasks Greg Kroah-Hartman
2018-07-23 12:24 ` [PATCH 4.17 11/63] x86/events/intel/ds: Fix bts_interrupt_threshold alignment Greg Kroah-Hartman
2018-07-23 12:24 ` [PATCH 4.17 12/63] x86/MCE: Remove min interval polling limitation Greg Kroah-Hartman
2018-07-23 12:24 ` [PATCH 4.17 13/63] fat: fix memory allocation failure handling of match_strdup() Greg Kroah-Hartman
2018-07-23 12:24 ` [PATCH 4.17 14/63] ALSA: rawmidi: Change resized buffers atomically Greg Kroah-Hartman
2018-07-23 12:24 ` [PATCH 4.17 15/63] ALSA: hda/realtek - Add Panasonic CF-SZ6 headset jack quirk Greg Kroah-Hartman
2018-07-23 12:24 ` [PATCH 4.17 16/63] ALSA: hda/realtek - Yet another Clevo P950 quirk entry Greg Kroah-Hartman
2018-07-23 12:24 ` [PATCH 4.17 17/63] ALSA: hda: add mute led support for HP ProBook 455 G5 Greg Kroah-Hartman
2018-07-23 12:24 ` [PATCH 4.17 18/63] ARCv2: [plat-hsdk]: Save accl reg pair by default Greg Kroah-Hartman
2018-07-23 12:24 ` [PATCH 4.17 19/63] ARC: Fix CONFIG_SWAP Greg Kroah-Hartman
2018-07-23 12:24 ` [PATCH 4.17 20/63] ARC: configs: Remove CONFIG_INITRAMFS_SOURCE from defconfigs Greg Kroah-Hartman
2018-07-23 12:24 ` [PATCH 4.17 21/63] ARC: mm: allow mprotect to make stack mappings executable Greg Kroah-Hartman
2018-07-23 12:24 ` [PATCH 4.17 22/63] mm: memcg: fix use after free in mem_cgroup_iter() Greg Kroah-Hartman
2018-07-23 12:24 ` [PATCH 4.17 23/63] mm/huge_memory.c: fix data loss when splitting a file pmd Greg Kroah-Hartman
2018-07-23 12:24 ` [PATCH 4.17 24/63] cpufreq: intel_pstate: Register when ACPI PCCH is present Greg Kroah-Hartman
2018-07-23 12:24 ` [PATCH 4.17 25/63] vfio/pci: Fix potential Spectre v1 Greg Kroah-Hartman
2018-07-23 12:24 ` [PATCH 4.17 26/63] vfio/spapr: Use IOMMU pageshift rather than pagesize Greg Kroah-Hartman
2018-07-23 12:24 ` [PATCH 4.17 27/63] stop_machine: Disable preemption when waking two stopper threads Greg Kroah-Hartman
2018-07-23 12:24 ` [PATCH 4.17 28/63] powerpc/powernv: Fix save/restore of SPRG3 on entry/exit from stop (idle) Greg Kroah-Hartman
2018-07-23 12:24 ` [PATCH 4.17 31/63] Revert "drm/amd/display: Dont return ddc result and read_bytes in same return value" Greg Kroah-Hartman
2018-07-23 12:24 ` [PATCH 4.17 32/63] drm/nouveau: Remove bogus crtc check in pmops_runtime_idle Greg Kroah-Hartman
2018-07-23 12:24 ` [PATCH 4.17 33/63] drm/nouveau: Use drm_connector_list_iter_* for iterating connectors Greg Kroah-Hartman
2018-07-23 12:24 ` [PATCH 4.17 34/63] drm/nouveau: Avoid looping through fake MST connectors Greg Kroah-Hartman
2018-07-23 12:24 ` [PATCH 4.17 36/63] ipv4: Return EINVAL when ping_group_range sysctl doesnt map to user ns Greg Kroah-Hartman
2018-07-23 12:24 ` [PATCH 4.17 37/63] ipv6: fix useless rol32 call on hash Greg Kroah-Hartman
2018-07-23 12:24 ` [PATCH 4.17 38/63] ipv6: ila: select CONFIG_DST_CACHE Greg Kroah-Hartman
2018-07-23 12:24 ` [PATCH 4.17 39/63] lib/rhashtable: consider param->min_size when setting initial table size Greg Kroah-Hartman
2018-07-23 12:24 ` [PATCH 4.17 40/63] net: diag: Dont double-free TCP_NEW_SYN_RECV sockets in tcp_abort Greg Kroah-Hartman
2018-07-23 12:24 ` [PATCH 4.17 41/63] net: Dont copy pfmemalloc flag in __copy_skb_header() Greg Kroah-Hartman
2018-07-23 12:24 ` [PATCH 4.17 42/63] skbuff: Unconditionally copy pfmemalloc in __skb_clone() Greg Kroah-Hartman
2018-07-23 12:24 ` [PATCH 4.17 43/63] net/ipv4: Set oif in fib_compute_spec_dst Greg Kroah-Hartman
2018-07-23 12:24 ` [PATCH 4.17 44/63] net/ipv6: Do not allow device only routes via the multipath API Greg Kroah-Hartman
2018-07-23 12:24 ` [PATCH 4.17 45/63] net: phy: fix flag masking in __set_phy_supported Greg Kroah-Hartman
2018-07-23 12:24 ` [PATCH 4.17 46/63] ptp: fix missing break in switch Greg Kroah-Hartman
2018-07-23 12:24 ` [PATCH 4.17 48/63] rhashtable: add restart routine in rhashtable_free_and_destroy() Greg Kroah-Hartman
2018-07-23 12:24 ` [PATCH 4.17 49/63] sch_fq_codel: zero q->flows_cnt when fq_codel_init fails Greg Kroah-Hartman
2018-07-23 12:24 ` [PATCH 4.17 50/63] tg3: Add higher cpu clock for 5762 Greg Kroah-Hartman
2018-07-23 12:24 ` [PATCH 4.17 51/63] net: ip6_gre: get ipv6hdr after skb_cow_head() Greg Kroah-Hartman
2018-07-23 12:24 ` [PATCH 4.17 52/63] sctp: introduce sctp_dst_mtu Greg Kroah-Hartman
2018-07-25 19:19   ` Marcelo Ricardo Leitner
2018-07-23 12:24 ` [PATCH 4.17 53/63] sctp: fix the issue that pathmtu may be set lower than MINSEGMENT Greg Kroah-Hartman
2018-07-23 12:25 ` [PATCH 4.17 54/63] hv_netvsc: Fix napi reschedule while receive completion is busy Greg Kroah-Hartman
2018-07-23 12:25 ` [PATCH 4.17 55/63] net: aquantia: vlan unicast address list correct handling Greg Kroah-Hartman
2018-07-23 12:25 ` [PATCH 4.17 56/63] net/mlx4_en: Dont reuse RX page when XDP is set Greg Kroah-Hartman
2018-07-23 12:25 ` [PATCH 4.17 57/63] net: systemport: Fix CRC forwarding check for SYSTEMPORT Lite Greg Kroah-Hartman
2018-07-23 12:25 ` [PATCH 4.17 58/63] ipv6: make DAD fail with enhanced DAD when nonce length differs Greg Kroah-Hartman
2018-07-23 12:25 ` [PATCH 4.17 59/63] net: usb: asix: replace mii_nway_restart in resume path Greg Kroah-Hartman
2018-07-23 12:25 ` Greg Kroah-Hartman [this message]
2018-07-23 12:25 ` [PATCH 4.17 61/63] drm_mode_create_lease_ioctl(): fix open-coded filp_clone_open() Greg Kroah-Hartman
2018-07-23 12:25 ` [PATCH 4.17 62/63] cxl_getfile(): fix double-iput() on alloc_file() failures Greg Kroah-Hartman
2018-07-23 12:25 ` [PATCH 4.17 63/63] xhci: Fix perceived dead host due to runtime suspend race with event handler Greg Kroah-Hartman
2018-07-24  7:38 ` [PATCH 4.17 00/63] 4.17.10-stable review Naresh Kamboju
2018-07-24  8:58   ` Greg Kroah-Hartman
2018-07-24 15:58 ` Guenter Roeck
2018-07-25  7:46   ` Greg Kroah-Hartman

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=20180723122448.624282129@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    /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).