diff options
author | Greg Kroah-Hartman <gregkh@google.com> | 2021-02-03 23:41:54 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2021-02-03 23:41:54 +0100 |
commit | 0566f6529a7b8d15d8ff50797331717b346f9aa4 (patch) | |
tree | 7fb77dcd3f01a54edbefea3ea6c0ba532bd8986d /kernel/fork.c | |
parent | fb6ba6381a886f38b90016f3ab8ba725a63792eb (diff) | |
parent | 2f9c581dbde4e48aa0c002ddf3892d6bcd89c1a2 (diff) |
Merge 4.4.255 into android-4.4-p
Changes in 4.4.255
ACPI: sysfs: Prefer "compatible" modalias
wext: fix NULL-ptr-dereference with cfg80211's lack of commit()
net: usb: qmi_wwan: added support for Thales Cinterion PLSx3 modem family
KVM: x86/pmu: Fix HW_REF_CPU_CYCLES event pseudo-encoding in intel_arch_events[]
mt7601u: fix kernel crash unplugging the device
mt7601u: fix rx buffer refcounting
y2038: futex: Move compat implementation into futex.c
futex: Move futex exit handling into futex code
futex: Replace PF_EXITPIDONE with a state
exit/exec: Seperate mm_release()
futex: Split futex_mm_release() for exit/exec
futex: Set task::futex_state to DEAD right after handling futex exit
futex: Mark the begin of futex exit explicitly
futex: Sanitize exit state handling
futex: Provide state handling for exec() as well
futex: Add mutex around futex exit
futex: Provide distinct return value when owner is exiting
futex: Prevent exit livelock
ARM: imx: build suspend-imx6.S with arm instruction set
netfilter: nft_dynset: add timeout extension to template
xfrm: Fix oops in xfrm_replay_advance_bmp
RDMA/cxgb4: Fix the reported max_recv_sge value
mac80211: pause TX while changing interface type
can: dev: prevent potential information leak in can_fill_info()
iommu/vt-d: Gracefully handle DMAR units with no supported address widths
iommu/vt-d: Don't dereference iommu_device if IOMMU_API is not built
NFC: fix resource leak when target index is invalid
NFC: fix possible resource leak
Linux 4.4.255
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I33bac27670b3cd649e2c8c1ce42efff148f8f202
Diffstat (limited to 'kernel/fork.c')
-rw-r--r-- | kernel/fork.c | 40 |
1 files changed, 15 insertions, 25 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index f7e3c2721238..56fda05f5137 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -914,24 +914,8 @@ static int wait_for_vfork_done(struct task_struct *child, * restoring the old one. . . * Eric Biederman 10 January 1998 */ -void mm_release(struct task_struct *tsk, struct mm_struct *mm) +static void mm_release(struct task_struct *tsk, struct mm_struct *mm) { - /* Get rid of any futexes when releasing the mm */ -#ifdef CONFIG_FUTEX - if (unlikely(tsk->robust_list)) { - exit_robust_list(tsk); - tsk->robust_list = NULL; - } -#ifdef CONFIG_COMPAT - if (unlikely(tsk->compat_robust_list)) { - compat_exit_robust_list(tsk); - tsk->compat_robust_list = NULL; - } -#endif - if (unlikely(!list_empty(&tsk->pi_state_list))) - exit_pi_state_list(tsk); -#endif - uprobe_free_utask(tsk); /* Get rid of any cached register state */ @@ -964,6 +948,18 @@ void mm_release(struct task_struct *tsk, struct mm_struct *mm) complete_vfork_done(tsk); } +void exit_mm_release(struct task_struct *tsk, struct mm_struct *mm) +{ + futex_exit_release(tsk); + mm_release(tsk, mm); +} + +void exec_mm_release(struct task_struct *tsk, struct mm_struct *mm) +{ + futex_exec_release(tsk); + mm_release(tsk, mm); +} + /* * Allocate a new mm structure and copy contents from the * mm structure of the passed in task structure. @@ -1540,14 +1536,8 @@ static struct task_struct *copy_process(unsigned long clone_flags, #ifdef CONFIG_BLOCK p->plug = NULL; #endif -#ifdef CONFIG_FUTEX - p->robust_list = NULL; -#ifdef CONFIG_COMPAT - p->compat_robust_list = NULL; -#endif - INIT_LIST_HEAD(&p->pi_state_list); - p->pi_state_cache = NULL; -#endif + futex_init_task(p); + /* * sigaltstack should be cleared when sharing the same VM */ |