LTS Refresh: Merge upto 022052551c82c246b380ac496f261b66cd72a011 (buildnumber: 17800.436.0) from main-R109-cos-6.1 to release-R109-cos-6.1.
BUG=b/388081071
TEST=presubmit
RELEASE_NOTE=LTS Refresh from main-R109-cos-6.1 to release-R109-cos-6.1
Change-Id: I5fda25841f69180095de1600aaac219bdd3af0eb
diff --git a/kernel/fork.c b/kernel/fork.c
index 5db5259..9256632 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -663,6 +663,15 @@ static __latent_entropy int dup_mmap(struct mm_struct *mm,
} else if (anon_vma_fork(tmp, mpnt))
goto fail_nomem_anon_vma_fork;
tmp->vm_flags &= ~(VM_LOCKED | VM_LOCKONFAULT);
+ /*
+ * Copy/update hugetlb private vma information.
+ */
+ if (is_vm_hugetlb_page(tmp))
+ hugetlb_dup_vma_private(tmp);
+
+ if (tmp->vm_ops && tmp->vm_ops->open)
+ tmp->vm_ops->open(tmp);
+
file = tmp->vm_file;
if (file) {
struct address_space *mapping = file->f_mapping;
@@ -679,12 +688,6 @@ static __latent_entropy int dup_mmap(struct mm_struct *mm,
i_mmap_unlock_write(mapping);
}
- /*
- * Copy/update hugetlb private vma information.
- */
- if (is_vm_hugetlb_page(tmp))
- hugetlb_dup_vma_private(tmp);
-
/* Link the vma into the MT */
mas.index = tmp->vm_start;
mas.last = tmp->vm_end - 1;
@@ -696,9 +699,6 @@ static __latent_entropy int dup_mmap(struct mm_struct *mm,
if (!(tmp->vm_flags & VM_WIPEONFORK))
retval = copy_page_range(tmp, mpnt);
- if (tmp->vm_ops && tmp->vm_ops->open)
- tmp->vm_ops->open(tmp);
-
if (retval)
goto loop_out;
}
diff --git a/kernel/time/posix-clock.c b/kernel/time/posix-clock.c
index 05e73d2..31762a9 100644
--- a/kernel/time/posix-clock.c
+++ b/kernel/time/posix-clock.c
@@ -302,6 +302,9 @@ static int pc_clock_settime(clockid_t id, const struct timespec64 *ts)
goto out;
}
+ if (!timespec64_valid_strict(ts))
+ return -EINVAL;
+
if (cd.clk->ops.clock_settime)
err = cd.clk->ops.clock_settime(cd.clk, ts);
else
diff --git a/net/ipv4/fou.c b/net/ipv4/fou.c
index c29c976..04dabee 100644
--- a/net/ipv4/fou.c
+++ b/net/ipv4/fou.c
@@ -334,6 +334,9 @@ static struct sk_buff *gue_gro_receive(struct sock *sk,
struct gro_remcsum grc;
u8 proto;
+ if (!fou)
+ goto out;
+
skb_gro_remcsum_init(&grc);
if (!fou)