Hi Greg,
The backport of upstream commit 1bd6a1c4b80a ("powerpc/fadump: handle
crash memory ranges array index overflow") introduced a ppc build failure
on 4.4-stable and 4.9-stable when CONFIG_FA_DUMP is enabled:
arch/powerpc/kernel/fadump.c: In function ‘register_fadump’:
arch/powerpc/kernel/fadump.c:1015:10: error: ‘return’ with a value, in function returning void [-Werror]
return ret;
^~~
arch/powerpc/kernel/fadump.c:1000:13: note: declared here
static void register_fadump(void)
^~~~~~~~~~~~~~~
I am suggesting to fix it by backporting 98b8cd7f7564 ("powerpc/fadump:
Return error when fadump registration fails"), which is an earlier
commit that (among other things) set the return of register_fadump() to
int and has little functional changes. It was applied upstream for
v4.13, so 4.14-stable and later are already fixed.
Thanks,
Kleber
Michal Suchanek (1):
powerpc/fadump: Return error when fadump registration fails
arch/powerpc/kernel/fadump.c | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
--
2.17.1
The patch below does not apply to the 4.18-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable(a)vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From b45ba4a51cde29b2939365ef0c07ad34c8321789 Mon Sep 17 00:00:00 2001
From: Christophe Leroy <christophe.leroy(a)c-s.fr>
Date: Mon, 1 Oct 2018 12:21:10 +0000
Subject: [PATCH] powerpc/lib: fix book3s/32 boot failure due to code patching
Commit 51c3c62b58b3 ("powerpc: Avoid code patching freed init
sections") accesses 'init_mem_is_free' flag too early, before the
kernel is relocated. This provokes early boot failure (before the
console is active).
As it is not necessary to do this verification that early, this
patch moves the test into patch_instruction() instead of
__patch_instruction().
This modification also has the advantage of avoiding unnecessary
remappings.
Fixes: 51c3c62b58b3 ("powerpc: Avoid code patching freed init sections")
Cc: stable(a)vger.kernel.org # 4.13+
Signed-off-by: Christophe Leroy <christophe.leroy(a)c-s.fr>
Signed-off-by: Michael Ellerman <mpe(a)ellerman.id.au>
diff --git a/arch/powerpc/lib/code-patching.c b/arch/powerpc/lib/code-patching.c
index 6ae2777c220d..5ffee298745f 100644
--- a/arch/powerpc/lib/code-patching.c
+++ b/arch/powerpc/lib/code-patching.c
@@ -28,12 +28,6 @@ static int __patch_instruction(unsigned int *exec_addr, unsigned int instr,
{
int err;
- /* Make sure we aren't patching a freed init section */
- if (init_mem_is_free && init_section_contains(exec_addr, 4)) {
- pr_debug("Skipping init section patching addr: 0x%px\n", exec_addr);
- return 0;
- }
-
__put_user_size(instr, patch_addr, 4, err);
if (err)
return err;
@@ -148,7 +142,7 @@ static inline int unmap_patch_area(unsigned long addr)
return 0;
}
-int patch_instruction(unsigned int *addr, unsigned int instr)
+static int do_patch_instruction(unsigned int *addr, unsigned int instr)
{
int err;
unsigned int *patch_addr = NULL;
@@ -188,12 +182,22 @@ int patch_instruction(unsigned int *addr, unsigned int instr)
}
#else /* !CONFIG_STRICT_KERNEL_RWX */
-int patch_instruction(unsigned int *addr, unsigned int instr)
+static int do_patch_instruction(unsigned int *addr, unsigned int instr)
{
return raw_patch_instruction(addr, instr);
}
#endif /* CONFIG_STRICT_KERNEL_RWX */
+
+int patch_instruction(unsigned int *addr, unsigned int instr)
+{
+ /* Make sure we aren't patching a freed init section */
+ if (init_mem_is_free && init_section_contains(addr, 4)) {
+ pr_debug("Skipping init section patching addr: 0x%px\n", addr);
+ return 0;
+ }
+ return do_patch_instruction(addr, instr);
+}
NOKPROBE_SYMBOL(patch_instruction);
int patch_branch(unsigned int *addr, unsigned long target, int flags)
From: Prateek Sood <prsood(a)codeaurora.org>
commit 116d2f7496c51b2e02e8e4ecdd2bdf5fb9d5a641 upstream.
Deadlock during cgroup migration from cpu hotplug path when a task T is
being moved from source to destination cgroup.
kworker/0:0
cpuset_hotplug_workfn()
cpuset_hotplug_update_tasks()
hotplug_update_tasks_legacy()
remove_tasks_in_empty_cpuset()
cgroup_transfer_tasks() // stuck in iterator loop
cgroup_migrate()
cgroup_migrate_add_task()
In cgroup_migrate_add_task() it checks for PF_EXITING flag of task T.
Task T will not migrate to destination cgroup. css_task_iter_start()
will keep pointing to task T in loop waiting for task T cg_list node
to be removed.
Task T
do_exit()
exit_signals() // sets PF_EXITING
exit_task_namespaces()
switch_task_namespaces()
free_nsproxy()
put_mnt_ns()
drop_collected_mounts()
namespace_unlock()
synchronize_rcu()
_synchronize_rcu_expedited()
schedule_work() // on cpu0 low priority worker pool
wait_event() // waiting for work item to execute
Task T inserted a work item in the worklist of cpu0 low priority
worker pool. It is waiting for expedited grace period work item
to execute. This work item will only be executed once kworker/0:0
complete execution of cpuset_hotplug_workfn().
kworker/0:0 ==> Task T ==>kworker/0:0
In case of PF_EXITING task being migrated from source to destination
cgroup, migrate next available task in source cgroup.
Signed-off-by: Prateek Sood <prsood(a)codeaurora.org>
Signed-off-by: Tejun Heo <tj(a)kernel.org>
[AmitP: Upstream commit cherry-pick failed, so I picked the
backported changes from CAF/msm-4.9 tree instead:
https://source.codeaurora.org/quic/la/kernel/msm-4.9/commit/?id=49b74f16964…]
Signed-off-by: Amit Pundir <amit.pundir(a)linaro.org>
---
This patch can be cleanly applied and build tested on 4.4.y and 3.18.y
as well but I couldn't find it in msm-4.4 and msm-3.18 trees. So this
patch is really untested on those stable trees.
Build tested on 4.9.131, 4.4.159 and 3.18.123 for ARCH=arm/arm64 allmodconfig.
kernel/cgroup.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 4c233437ee1a..bb0cf1caf1cd 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -4386,7 +4386,11 @@ int cgroup_transfer_tasks(struct cgroup *to, struct cgroup *from)
*/
do {
css_task_iter_start(&from->self, &it);
- task = css_task_iter_next(&it);
+
+ do {
+ task = css_task_iter_next(&it);
+ } while (task && (task->flags & PF_EXITING));
+
if (task)
get_task_struct(task);
css_task_iter_end(&it);
--
2.7.4
This patch is aimed to fixing CVE-2018-10883 and is already in 4.14
stable. The upstream one has minor conflicts when backporting to 4.4
and 4.9 but it is trivial to resolve. I have tested the patch with
xfstests on kvm and there is no regression.
Theodore Ts'o (1):
ext4: avoid running out of journal credits when appending to an inline
file
fs/ext4/ext4.h | 3 ---
fs/ext4/inline.c | 38 +-------------------------------------
fs/ext4/xattr.c | 18 ++----------------
3 files changed, 3 insertions(+), 56 deletions(-)
--
2.19.0.605.g01d371f741-goog
A couple ext4-related CVE fixes were released to other kernels in
linux-stable, but didn't cleanly apply to 4.9.y. These are adjusted
cherry-picks of Ben Hutching's 3.16.y backports.
Theodore Ts'o (2):
ext4: add corruption check in ext4_xattr_set_entry()
ext4: always verify the magic number in xattr blocks
fs/ext4/xattr.c | 28 +++++++++++++++++-----------
1 file changed, 17 insertions(+), 11 deletions(-)
--
2.19.0.605.g01d371f741-goog
A couple ext4-related CVE fixes were released to other kernels in
linux-stable, but didn't cleanly apply to 4.4.y. These are adjusted
cherry-picks of Ben Hutching's 3.16.y backports.
Theodore Ts'o (2):
ext4: add corruption check in ext4_xattr_set_entry()
ext4: always verify the magic number in xattr blocks
fs/ext4/xattr.c | 28 +++++++++++++++++-----------
1 file changed, 17 insertions(+), 11 deletions(-)
--
2.19.0.605.g01d371f741-goog
Hi Marc,
Marc Zyngier <marc.zyngier(a)arm.com> wrote on Thu, 11 Oct 2018 09:36:04
+0100:
> Miquel,
>
> On Fri, 28 Sep 2018 16:10:29 +0100,
> Miquel Raynal <miquel.raynal(a)bootlin.com> wrote:
> >
> > Hi Marc,
> >
> > [...]
> >
> > > At that stage, you're better off just calling
> > >
> > > list_del(&desc->list);
> > > free_msi_entry(desc);
> > >
> > > I like this approach better as we only traverse the list once.
> >
> > Right.
> >
> > >
> > > > }
> > > > }
> > > > > /**
> > > > diff --git a/include/linux/msi.h b/include/linux/msi.h
> > > > index 5839d8062dfc..be8ec813dbfb 100644
> > > > --- a/include/linux/msi.h
> > > > +++ b/include/linux/msi.h
> > > > @@ -116,6 +116,8 @@ struct msi_desc {
> > > > list_first_entry(dev_to_msi_list((dev)), struct msi_desc, list)
> > > > #define for_each_msi_entry(desc, dev) \
> > > > list_for_each_entry((desc), dev_to_msi_list((dev)), list)
> > > > +#define for_each_msi_entry_safe(desc, tmp, dev) \
> > > > + list_for_each_entry_safe((desc), (tmp), dev_to_msi_list((dev)), list)
> > > > > #ifdef CONFIG_PCI_MSI
> > > > #define first_pci_msi_entry(pdev) first_msi_entry(&(pdev)->dev)
> > >
> > > If you repin this, I'll queue it right away.
> >
> > Let me test the new version to be sure I'm not breaking anything and
> > I'll send a v2.
>
> What is the status of this? Are you still planning to send a v2? I'd
> really like this fix to reach 4.19 before we put the last nail on it.
Sorry about that, I was sure I already sent the v2, now it's
done.
The changes in this v2 are that instead of creating a
platform_msi_domain_free_descs() helper that iterates over the list of
descriptors, the descriptor itself is removed from the list and destroyed
directly in platform_msi_domain_free(). The for_each_msi_entry() loop is
also transformed to use the "_safe" alternative.
Thanks,
Miquèl