[PATCH] fs/ext4: prevent the CPU from being 100% occupied in ext4_mb_discard_group_preallocations

2021-04-18 Thread Wen Yang
why IO has not returned here is that the process handling IO in the BM hypervisor has failed. The cpu resources of the cloud server are precious, and the server cannot be restarted after running for a long time. So it's slightly optimized here to prevent the CPU from being 100% occupied. Signed-off-by: We

Re: [PATCH] ext4: add a configurable parameter to prevent endless loop in ext4_mb_discard_group_p

2021-04-15 Thread Wen Yang
在 2021/4/11 下午12:25, Theodore Ts'o 写道: On Sun, Apr 11, 2021 at 03:45:01AM +0800, Wen Yang wrote: At this time, some logs are lost. It is suspected that the hard disk itself is faulty. If you have a kernel crash dump, that means you can extract out the dmesg buffer, correct? Is there any I

Re: [PATCH] ext4: add a configurable parameter to prevent endless loop in ext4_mb_discard_group_p

2021-04-10 Thread Wen Yang
在 2021/4/9 下午1:47, riteshh 写道: On 21/04/09 02:50AM, Wen Yang wrote: On Apr 7, 2021, at 5:16 AM, riteshh wrote: On 21/04/07 03:01PM, Wen Yang wrote: From: Wen Yang The kworker has occupied 100% of the CPU for several days: PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 68086

Re: [PATCH] ext4: add a configurable parameter to prevent endless loop in ext4_mb_discard_group_p

2021-04-08 Thread Wen Yang
> On Apr 7, 2021, at 5:16 AM, riteshh wrote: >> >> On 21/04/07 03:01PM, Wen Yang wrote: >>> From: Wen Yang >>> >>> The kworker has occupied 100% of the CPU for several days: >>> PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND >

[PATCH] ext4: add a configurable parameter to prevent endless loop in ext4_mb_discard_group_preallocations

2021-04-07 Thread Wen Yang
From: Wen Yang The kworker has occupied 100% of the CPU for several days: PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 68086 root 20 0 00 0 R 100.0 0.0 9718:18 kworker/u64:11 And the stack obtained through sysrq is as follows: [20613144.850426] task: 8800b5e08000

Re: [PATCH v2 4.9 00/10] fix a race in release_task when flushing the dentry

2021-01-07 Thread Wen Yang
在 2021/1/8 上午2:28, Greg Kroah-Hartman 写道: On Fri, Jan 08, 2021 at 12:21:38AM +0800, Wen Yang wrote: 在 2021/1/7 下午8:17, Greg Kroah-Hartman 写道: On Thu, Jan 07, 2021 at 03:52:12PM +0800, Wen Yang wrote: The dentries such as /proc//ns/ have the DCACHE_OP_DELETE flag, they should be deleted

Re: [PATCH v2 4.9 00/10] fix a race in release_task when flushing the dentry

2021-01-07 Thread Wen Yang
在 2021/1/7 下午8:17, Greg Kroah-Hartman 写道: On Thu, Jan 07, 2021 at 03:52:12PM +0800, Wen Yang wrote: The dentries such as /proc//ns/ have the DCACHE_OP_DELETE flag, they should be deleted when the process exits. Suppose the following race appears: release_task dput

[PATCH 4.19 1/7] clone: add CLONE_PIDFD

2021-01-06 Thread Wen Yang
ees Cook Cc: Thomas Gleixner Cc: David Howells Cc: "Michael Kerrisk (man-pages)" Cc: Andy Lutomirsky Cc: Andrew Morton Cc: Aleksa Sarai Cc: Linus Torvalds Cc: Al Viro Cc: # 4.19.x (clone: fix up cherry-pick conflicts for b3e583825266) Signed-off-by: Wen Yang --- include/linux

[PATCH 4.19 5/7] proc: Clear the pieces of proc_inode that proc_evict_inode cares about

2021-01-06 Thread Wen Yang
Cc: # 4.19.x Signed-off-by: Wen Yang --- fs/proc/inode.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/fs/proc/inode.c b/fs/proc/inode.c index fffc7e4..45b4344 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c @@ -34,21 +34,27 @@ static void proc_evic

[PATCH 4.19 6/7] proc: Use d_invalidate in proc_prune_siblings_dcache

2021-01-06 Thread Wen Yang
. To make this code robust to future changes in proc. Signed-off-by: "Eric W. Biederman" Cc: # 4.19.x Signed-off-by: Wen Yang --- fs/proc/inode.c | 16 ++-- fs/proc/internal.h| 2 +- fs/proc/proc_sysctl.c | 8 3 files changed, 19 insertions(+), 7 deletions

[PATCH 4.19 2/7] pidfd: add polling support

2021-01-06 Thread Wen Yang
sterov Cc: kernel-t...@android.com Reviewed-by: Oleg Nesterov Co-developed-by: Daniel Colascione Signed-off-by: Daniel Colascione Signed-off-by: Joel Fernandes (Google) Signed-off-by: Christian Brauner Cc: # 4.19.x Signed-off-by: Wen Yang --- include/linux/pid.h | 3 +++ kernel/fork.c

[PATCH 4.19 3/7] proc: Rename in proc_inode rename sysctl_inodes sibling_inodes

2021-01-06 Thread Wen Yang
a generic name so it is clear that it is no longer sysctl specific. Also for good measure initialize sibling_inodes when proc_inode is initialized. Signed-off-by: Eric W. Biederman Cc: # 4.19.x Signed-off-by: Wen Yang --- fs/proc/inode.c | 1 + fs/proc/internal.h| 2 +- fs/proc/pro

[PATCH 4.19 7/7] proc: Use a list of inodes to flush from proc

2021-01-06 Thread Wen Yang
rune_dcache into proc_prune_siblings_dcache Cc: # 4.19.x: 71448011ea2a: proc: Clear the pieces of proc_inode that proc_evict_inode cares about Cc: # 4.19.x: f90f3cafe8d5: Use d_invalidate in proc_prune_siblings_dcache Cc: # 4.19.x Signed-off-by: Wen Yang --- fs/proc/base.c | 111 ++

[PATCH 4.19 4/7] proc: Generalize proc_sys_prune_dcache into proc_prune_siblings_dcache

2021-01-06 Thread Wen Yang
From: "Eric W. Biederman" [ Upstream commit 26dbc60f385ff9cff475ea2a3bad02e80fd6fa43 ] This prepares the way for allowing the pid part of proc to use this dcache pruning code as well. Signed-off-by: Eric W. Biederman Cc: # 4.19.x Signed-off-by: Wen Yang --- fs/proc/inode.c

[PATCH v2 4.9 04/10] proc: Better ownership of files for non-dumpable tasks in user namespaces

2021-01-06 Thread Wen Yang
ot to have things work as expected in a container. Signed-off-by: "Eric W. Biederman" Cc: # 4.9.x Signed-off-by: Wen Yang --- fs/proc/base.c | 102 ++--- fs/proc/fd.c | 12 +-- fs/proc/internal.h | 16 ++--- 3 files ch

[PATCH 4.19 0/7] fix a race in release_task when flushing the dentry

2021-01-06 Thread Wen Yang
The dentries such as /proc//ns/ have the DCACHE_OP_DELETE flag, they should be deleted when the process exits. Suppose the following race appears: release_task dput -> proc_flush_task -> dentry->d_op->d_delete(dentry) -> __exit_signal

[PATCH v2 4.9 05/10] proc: use %u for pid printing and slightly less stack

2021-01-06 Thread Wen Yang
1120203005.GA27743@avx2 Signed-off-by: Alexey Dobriyan Cc: Alexander Viro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Cc: # 4.9.x Signed-off-by: Wen Yang --- fs/proc/base.c| 16 fs/proc/fd.c | 2 +- fs/proc/self.c| 6 +++--

[PATCH v2 4.9 08/10] proc: Clear the pieces of proc_inode that proc_evict_inode cares about

2021-01-06 Thread Wen Yang
Cc: # 4.9.x Signed-off-by: Wen Yang --- fs/proc/inode.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/fs/proc/inode.c b/fs/proc/inode.c index 920c761..739fb9c 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c @@ -32,21 +32,27 @@ static void proc_evict_inode

[PATCH v2 4.9 10/10] proc: Use a list of inodes to flush from proc

2021-01-06 Thread Wen Yang
# 4.9.x: 71448011ea2a: proc: Clear the pieces of proc_inode that proc_evict_inode cares about Cc: # 4.9.x: f90f3cafe8d5: Use d_invalidate in proc_prune_siblings_dcache Cc: # 4.9.x (proc: fix up cherry-pick conflicts for 7bc3e6e55acf) Signed-off-by

[PATCH v2 4.9 01/10] clone: add CLONE_PIDFD

2021-01-06 Thread Wen Yang
ees Cook Cc: Thomas Gleixner Cc: David Howells Cc: "Michael Kerrisk (man-pages)" Cc: Andy Lutomirsky Cc: Andrew Morton Cc: Aleksa Sarai Cc: Linus Torvalds Cc: Al Viro Cc: # 4.9.x (clone: fix up cherry-pick conflicts for b3e583825266) Signed-off-by: Wen Yang --- include/linux

[PATCH v2 4.9 07/10] proc: Generalize proc_sys_prune_dcache into proc_prune_siblings_dcache

2021-01-06 Thread Wen Yang
5f) Signed-off-by: Wen Yang --- fs/proc/inode.c | 38 ++ fs/proc/internal.h| 1 + fs/proc/proc_sysctl.c | 35 +-- 3 files changed, 40 insertions(+), 34 deletions(-) diff --git a/fs/proc/inode.c b/fs/proc/inode.c ind

[PATCH v2 4.9 06/10] proc: Rename in proc_inode rename sysctl_inodes sibling_inodes

2021-01-06 Thread Wen Yang
a generic name so it is clear that it is no longer sysctl specific. Also for good measure initialize sibling_inodes when proc_inode is initialized. Signed-off-by: Eric W. Biederman Cc: # 4.9.x Signed-off-by: Wen Yang --- fs/proc/inode.c | 1 + fs/proc/internal.h| 2 +- fs/proc/pro

[PATCH v2 4.9 09/10] proc: Use d_invalidate in proc_prune_siblings_dcache

2021-01-06 Thread Wen Yang
. To make this code robust to future changes in proc. Signed-off-by: "Eric W. Biederman" Cc: # 4.9.x (proc: fix up cherry-pick conflicts for f90f3cafe8d5) Signed-off-by: Wen Yang --- fs/proc/inode.c | 16 ++-- fs/proc/internal.h| 2 +- fs/proc/proc_sysctl.c |

[PATCH v2 4.9 03/10] proc: Pass file mode to proc_pid_make_inode

2021-01-06 Thread Wen Yang
sclass right away without introducing "half-initialized" inode security structs. Signed-off-by: Andreas Gruenbacher Signed-off-by: Paul Moore Cc: # 4.9.x Signed-off-by: Wen Yang --- fs/proc/base.c | 23 +-- fs/proc/fd.c | 6 ++ fs/proc/inter

[PATCH v2 4.9 02/10] pidfd: add polling support

2021-01-06 Thread Wen Yang
sterov Cc: kernel-t...@android.com Reviewed-by: Oleg Nesterov Co-developed-by: Daniel Colascione Signed-off-by: Daniel Colascione Signed-off-by: Joel Fernandes (Google) Signed-off-by: Christian Brauner Cc: # 4.9.x (pidfd: fix up cherry-pick conflicts for b53b0b9d9a61) Signed-off-by

[PATCH v2 4.9 00/10] fix a race in release_task when flushing the dentry

2021-01-06 Thread Wen Yang
The dentries such as /proc//ns/ have the DCACHE_OP_DELETE flag, they should be deleted when the process exits. Suppose the following race appears: release_task dput -> proc_flush_task -> dentry->d_op->d_delete(dentry) -> __exit_signal

[PATCH v2 4.9 00/10] fix a race in release_task when flushing the dentry

2021-01-06 Thread Wen Yang
The dentries such as /proc//ns/ have the DCACHE_OP_DELETE flag, they should be deleted when the process exits. Suppose the following race appears: release_task dput -> proc_flush_task -> dentry->d_op->d_delete(dentry) -> __exit_signal

Re: [PATCH 00/10] Cover letter: fix a race in release_task when flushing the dentry

2021-01-03 Thread Wen Yang
在 2020/12/31 下午5:22, Greg Kroah-Hartman 写道: On Thu, Dec 17, 2020 at 10:26:23AM +0800, Wen Yang wrote: 在 2020/12/4 上午2:31, Wen Yang 写道: The dentries such as /proc//ns/ have the DCACHE_OP_DELETE flag, they should be deleted when the process exits. Suppose the following race appears

Re: [PATCH 00/10] Cover letter: fix a race in release_task when flushing the dentry

2020-12-16 Thread Wen Yang
在 2020/12/4 上午2:31, Wen Yang 写道: The dentries such as /proc//ns/ have the DCACHE_OP_DELETE flag, they should be deleted when the process exits. Suppose the following race appears: release_task     dput -> proc_flush_task    -> dentry->d_op-

[PATCH 10/10] proc: Use a list of inodes to flush from proc

2020-12-03 Thread Wen Yang
7144801: proc: Clear the pieces of proc_inode that proc_evict_inode cares about Cc: # 4.9.x: f90f3ca: Use d_invalidate in proc_prune_siblings_dcache Cc: # 4.9.x (proc: fix up cherry-pick conflicts for 7bc3e6e55acf) Signed-off-by: Wen Yang --- fs/proc/base.c | 111

[PATCH 09/10] proc: Use d_invalidate in proc_prune_siblings_dcache

2020-12-03 Thread Wen Yang
. To make this code robust to future changes in proc. Signed-off-by: "Eric W. Biederman" Cc: # 4.9.x (proc: fix up cherry-pick conflicts for f90f3cafe8d5) Signed-off-by: Wen Yang --- fs/proc/inode.c | 16 ++-- fs/proc/internal.h| 2 +- fs/proc/proc_sysctl.c |

[PATCH 07/10] proc: Generalize proc_sys_prune_dcache into proc_prune_siblings_dcache

2020-12-03 Thread Wen Yang
5f) Signed-off-by: Wen Yang --- fs/proc/inode.c | 38 ++ fs/proc/internal.h| 1 + fs/proc/proc_sysctl.c | 35 +-- 3 files changed, 40 insertions(+), 34 deletions(-) diff --git a/fs/proc/inode.c b/fs/proc/inode.c ind

[PATCH 08/10] proc: Clear the pieces of proc_inode that proc_evict_inode cares about

2020-12-03 Thread Wen Yang
Cc: # 4.9.x Signed-off-by: Wen Yang --- fs/proc/inode.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/fs/proc/inode.c b/fs/proc/inode.c index 920c761..739fb9c 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c @@ -32,21 +32,27 @@ static void proc_evict_inode

[PATCH 05/10] proc: use %u for pid printing and slightly less stack

2020-12-03 Thread Wen Yang
1120203005.GA27743@avx2 Signed-off-by: Alexey Dobriyan Cc: Alexander Viro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Cc: # 4.9.x Signed-off-by: Wen Yang --- fs/proc/base.c| 16 fs/proc/fd.c | 2 +- fs/proc/self.c| 6 +++--

[PATCH 06/10] proc: Rename in proc_inode rename sysctl_inodes sibling_inodes

2020-12-03 Thread Wen Yang
a generic name so it is clear that it is no longer sysctl specific. Also for good measure initialize sibling_inodes when proc_inode is initialized. Signed-off-by: Eric W. Biederman Cc: # 4.9.x Signed-off-by: Wen Yang --- fs/proc/inode.c | 1 + fs/proc/internal.h| 2 +- fs/proc/pro

[PATCH 04/10] proc: Better ownership of files for non-dumpable tasks in user namespaces

2020-12-03 Thread Wen Yang
ot to have things work as expected in a container. Signed-off-by: "Eric W. Biederman" Cc: # 4.9.x Signed-off-by: Wen Yang --- fs/proc/base.c | 102 ++--- fs/proc/fd.c | 12 +-- fs/proc/internal.h | 16 ++--- 3 files ch

[PATCH 03/10] proc: Pass file mode to proc_pid_make_inode

2020-12-03 Thread Wen Yang
sclass right away without introducing "half-initialized" inode security structs. Signed-off-by: Andreas Gruenbacher Signed-off-by: Paul Moore Cc: # 4.9.x Signed-off-by: Wen Yang --- fs/proc/base.c | 23 +-- fs/proc/fd.c | 6 ++ fs/proc/inter

[PATCH 01/10] clone: add CLONE_PIDFD

2020-12-03 Thread Wen Yang
ees Cook Cc: Thomas Gleixner Cc: David Howells Cc: "Michael Kerrisk (man-pages)" Cc: Andy Lutomirsky Cc: Andrew Morton Cc: Aleksa Sarai Cc: Linus Torvalds Cc: Al Viro Cc: # 4.9.x (clone: fix up cherry-pick conflicts for b3e583825266) Signed-off-by: Wen Yang --- include/linux

[PATCH 02/10] pidfd: add polling support

2020-12-03 Thread Wen Yang
conflicts for b53b0b9d9a61) Signed-off-by: Wen Yang --- include/linux/pid.h | 3 +++ kernel/fork.c | 26 ++ kernel/pid.c| 2 ++ kernel/signal.c | 11 +++ 4 files changed, 42 insertions(+) diff --git a/include/linux/pid.h b/include/linux/pid.h ind

[PATCH 00/10] Cover letter: fix a race in release_task when flushing the dentry

2020-12-03 Thread Wen Yang
.extra1 = , + }, + { + .procname = "dentry_debug_pid", + .data = _dentry_debug_pid, + .maxlen = sizeof(sysctl_dentry_debug_pid), + .mode = 0644, + .proc_handler

Re: [PATCH] exit: fix a race in release_task when flushing the dentry

2020-11-29 Thread Wen Yang
在 2020/11/29 下午2:05, Greg Kroah-Hartman 写道: On Sat, Nov 28, 2020 at 11:28:53PM +0800, Wen Yang wrote: 在 2020/11/28 下午10:05, Greg Kroah-Hartman 写道: On Sat, Nov 28, 2020 at 09:59:09PM +0800, Wen Yang wrote: 在 2020/11/28 下午4:06, Greg Kroah-Hartman 写道: On Sat, Nov 28, 2020 at 02:47:22PM

[PATCH] proc: add locking checks in proc_inode_is_dead

2020-11-28 Thread Wen Yang
The proc_inode_is_dead function might race with __unhash_process. This will result in a whole bunch of stale proc entries being cached. To prevent that, add the required locking. Signed-off-by: Wen Yang Cc: Oleg Nesterov Cc: "Eric W. Biederman" Cc: Alexey Dobriyan Cc: Christian B

Stable backport request for fixing the issue of not being able to create a new pid_ns

2020-10-08 Thread Wen Yang
ngs_dcache") f90f3cafe8d5 ("proc: Use d_invalidate in proc_prune_siblings_dcache") Signed-off-by: Wen Yang Cc: Eric W. Biederman Cc: sta...@vger.kernel.org Cc: linux-kernel@vger.kernel.org

Re: [PATCH] net: core: explicitly call linkwatch_fire_event to speed up the startup of network services

2020-09-15 Thread Wen Yang
on 2020/8/6 PM5:09, Wen Yang wrote: 在 2020/8/5 上午6:58, David Miller 写道: From: Wen Yang Date: Sat,  1 Aug 2020 16:58:45 +0800 diff --git a/net/core/link_watch.c b/net/core/link_watch.c index 75431ca..6b9d44b 100644 --- a/net/core/link_watch.c +++ b/net/core/link_watch.c @@ -98,6 +98,9

Re: [PATCH] net: core: explicitly call linkwatch_fire_event to speed up the startup of network services

2020-08-06 Thread Wen Yang
在 2020/8/5 上午6:58, David Miller 写道: From: Wen Yang Date: Sat, 1 Aug 2020 16:58:45 +0800 diff --git a/net/core/link_watch.c b/net/core/link_watch.c index 75431ca..6b9d44b 100644 --- a/net/core/link_watch.c +++ b/net/core/link_watch.c @@ -98,6 +98,9 @@ static bool linkwatch_urgent_event

[PATCH] net: core: explicitly call linkwatch_fire_event to speed up the startup of network services

2020-08-01 Thread Wen Yang
. Signed-off-by: Wen Yang Cc: "David S. Miller" Cc: Jakub Kicinski Cc: Andrew Lunn Cc: Eric Dumazet Cc: Jiri Pirko Cc: Leon Romanovsky Cc: Julian Wiedmann Cc: net...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- net/core/link_watch.c | 3 +++ net/core/rtnetlink.c | 1 + 2 files

Re: [PATCH] usb: roles: Switch on role-switch uevent reporting

2020-05-08 Thread Wen Yang
DEVTYPE=usb_role_switch USB_ROLE_SWITCH=ci_hdrc.0-role-switch SEQNUM=2432 Cc: Heikki Krogerus Cc: Greg Kroah-Hartman Cc: Chunfeng Yun Cc: Suzuki K Poulose Cc: Alexandre Belloni Cc: Wen Yang Cc: chenqiwu Cc: linux-kernel@vger.kernel.org Signed-off-by: Bryan O'Donoghue --- drivers/usb/roles

[PATCH] checkpatch: add checks for fixes tags

2019-10-17 Thread Wen Yang
-by: Wen Yang Cc: Andy Whitcroft (maintainer:CHECKPATCH) Cc: Joe Perches (maintainer:CHECKPATCH) Cc: Stephen Rothwell Cc: "David S. Miller" Cc: linux-kernel@vger.kernel.org (open list) --- scripts/checkpatch.pl | 21 - 1 file changed, 20 insertions(+), 1 deletio

Re: [PATCH] net: dsa: rtl8366rb: add missing of_node_put after calling of_get_child_by_name

2019-10-16 Thread Wen Yang
On 2019/10/2 1:03 上午, David Miller wrote: From: Wen Yang Date: Sun, 29 Sep 2019 15:00:47 +0800 of_node_put needs to be called when the device node which is got from of_get_child_by_name finished using. irq_domain_add_linear() also calls of_node_get() to increase refcount, so irq_domain

Re: [PATCH] net: mscc: ocelot: add missing of_node_put after calling of_get_child_by_name

2019-10-16 Thread Wen Yang
On 2019/10/2 1:02 上午, David Miller wrote: From: Wen Yang Date: Sun, 29 Sep 2019 14:54:24 +0800 of_node_put needs to be called when the device node which is got from of_get_child_by_name finished using. In both cases of success and failure, we need to release 'ports', so clean up the code

[PATCH] net: dsa: rtl8366rb: add missing of_node_put after calling of_get_child_by_name

2019-09-29 Thread Wen Yang
k SMI driver") Signed-off-by: Wen Yang Cc: Linus Walleij Cc: Andrew Lunn Cc: Vivien Didelot Cc: Florian Fainelli Cc: "David S. Miller" Cc: net...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/net/dsa/rtl8366rb.c | 16 ++-- 1 file changed, 10 insert

[PATCH] net: mscc: ocelot: add missing of_node_put after calling of_get_child_by_name

2019-09-29 Thread Wen Yang
of_node_put needs to be called when the device node which is got from of_get_child_by_name finished using. In both cases of success and failure, we need to release 'ports', so clean up the code using goto. fixes: a556c76adc05 ("net: mscc: Add initial Ocelot switch support") Signed-o

[PATCH] can: dev: add missing of_node_put after calling of_get_child_by_name

2019-09-28 Thread Wen Yang
of_node_put needs to be called when the device node which is got from of_get_child_by_name finished using. fixes: 2290aefa2e90 ("can: dev: Add support for limiting configured bitrate") Signed-off-by: Wen Yang Cc: Wolfgang Grandegger Cc: Marc Kleine-Budde Cc: "David S. Miller&q

[PATCH v7] cpufreq/pasemi: fix an use-after-free in pas_cpufreq_cpu_init()

2019-07-16 Thread Wen Yang
The cpu variable is still being used in the of_get_property() call after the of_node_put() call, which may result in use-after-free. Fixes: a9acc26b75f6 ("cpufreq/pasemi: fix possible object reference leak") Signed-off-by: Wen Yang Cc: "Rafael J. Wysocki" Cc: Viresh Kumar

[PATCH v3] coccinelle: semantic code search for missing of_node_put

2019-07-15 Thread Wen Yang
d by the r_use_after_put rule) Suggested-by: Julia Lawall Signed-off-by: Wen Yang Cc: Julia Lawall Cc: Gilles Muller Cc: Nicolas Palix Cc: Michal Marek Cc: Masahiro Yamada Cc: Wen Yang Cc: Markus Elfring Cc: co...@systeme.lip6.fr --- v3: delete the global set, add a rule that checks fo

[PATCH 0/2] ASoC: samsung: odroid: fix err handling of odroid_audio_probe

2019-07-12 Thread Wen Yang
We developed a coccinelle SmPL to detect sound/soc/samsung/odroid.c and found some use-after-free problems. This patch series fixes those problems. Wen Yang (2): ASoC: samsung: odroid: fix an use-after-free issue for codec ASoC: samsung: odroid: fix a double-free issue for cpu_dai sound/soc

[PATCH 2/2] ASoC: samsung: odroid: fix a double-free issue for cpu_dai

2019-07-12 Thread Wen Yang
> jump to err_put_clk_i2s ... err_put_clk_i2s: clk_put(priv->clk_i2s_bus); err_put_sclk: clk_put(priv->sclk_i2s); err_put_cpu_dai: of_node_put(cpu_dai);--> double-free here Fixes: d832d2b246c5 ("ASoC: samsung: odroid: Fix of_node refcount unbalan

[PATCH 1/2] ASoC: samsung: odroid: fix an use-after-free issue for codec

2019-07-12 Thread Wen Yang
The codec variable is still being used after the of_node_put() call, which may result in use-after-free. Fixes: bc3cf17b575a ("ASoC: samsung: odroid: Add support for secondary CPU DAI") Signed-off-by: Wen Yang Cc: Krzysztof Kozlowski Cc: Sangbeom Kim Cc: Sylwester Nawrocki Cc: Lia

[PATCH v6] cpufreq/pasemi: fix an use-after-free in pas_cpufreq_cpu_init()

2019-07-11 Thread Wen Yang
The cpu variable is still being used in the of_get_property() call after the of_node_put() call, which may result in use-after-free. Fixes: a9acc26b75f6 ("cpufreq/pasemi: fix possible object reference leak") Signed-off-by: Wen Yang Cc: "Rafael J. Wysocki" Cc: Viresh Kumar

[PATCH 1/4] ASoC: simple-card: fix an use-after-free in simple_dai_link_of_dpcm()

2019-07-10 Thread Wen Yang
The node variable is still being used after the of_node_put() call, which may result in use-after-free. Fixes: cfc652a73331 ("ASoC: simple-card: tidyup prefix for snd_soc_codec_conf") Signed-off-by: Wen Yang Cc: Liam Girdwood Cc: Mark Brown Cc: Jaroslav Kysela Cc: Takashi Iwai Cc

[PATCH 0/4] Fix some use-after-free problems in sound/soc/generic

2019-07-10 Thread Wen Yang
We developed a coccinelle SmPL to detect sound/sooc/generic code and found some use-after-free problems. This patch series fixes those problems. Wen Yang (4): ASoC: simple-card: fix an use-after-free in simple_dai_link_of_dpcm() ASoC: simple-card: fix an use-after-free in simple_for_each_link

[PATCH 3/4] ASoC: audio-graph-card: fix use-after-free in graph_dai_link_of_dpcm()

2019-07-10 Thread Wen Yang
After calling of_node_put() on the ports, port, and node variables, they are still being used, which may result in use-after-free. Fix this issue by calling of_node_put() after the last usage. Fixes: dd98fbc558a0 ("ASoC: audio-graph-card: cleanup DAI link loop method - step1") Signed-o

[PATCH 2/4] ASoC: simple-card: fix an use-after-free in simple_for_each_link()

2019-07-10 Thread Wen Yang
The codec variable is still being used after the of_node_put() call, which may result in use-after-free. Fixes: d947cdfd4be2 ("ASoC: simple-card: cleanup DAI link loop method - step1") Signed-off-by: Wen Yang Cc: Liam Girdwood Cc: Mark Brown Cc: Jaroslav Kysela Cc: Takashi Iwai Cc

[PATCH 4/4] ASoC: audio-graph-card: fix an use-after-free in graph_get_dai_id()

2019-07-10 Thread Wen Yang
After calling of_node_put() on the node variable, it is still being used, which may result in use-after-free. Fix this issue by calling of_node_put() after the last usage. Fixes: a0c426fe1433 ("ASoC: simple-card-utils: check "reg" property on asoc_simple_card_get_dai_id()"

[tip:irq/urgent] irqchip/renesas-rza1: Prevent use-after-free in rza1_irqc_probe()

2019-07-09 Thread tip-bot for Wen Yang
Commit-ID: 7c8e90ddf02f139a90bc29c04302e9914818f0c8 Gitweb: https://git.kernel.org/tip/7c8e90ddf02f139a90bc29c04302e9914818f0c8 Author: Wen Yang AuthorDate: Mon, 8 Jul 2019 14:19:04 +0800 Committer: Thomas Gleixner CommitDate: Tue, 9 Jul 2019 14:53:50 +0200 irqchip/renesas-rza1

[PATCH 2/2] powerpc/83xx: cleanup error paths in mpc831x_usb_cfg()

2019-07-09 Thread Wen Yang
Rename the jump labels according to the cleanup they perform, and move reference handling to simplify cleanup. Signed-off-by: Wen Yang Cc: Scott Wood Cc: Kumar Gala Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Markus Elfring Cc: linuxppc-...@lists.ozlabs.org Cc

[PATCH 1/2] powerpc/83xx: fix use-after-free in mpc831x_usb_cfg()

2019-07-09 Thread Wen Yang
The immr_node variable is still being used after the of_node_put() call, which may result in use-after-free. Fix this issue by calling of_node_put() after the last usage. Fixes: fd066e850351 ("powerpc/mpc8308: fix USB DR controller initialization") Signed-off-by: Wen Yang Cc: Scot

[PATCH 0/2] fix use-after-free in mpc831x_usb_cfg() and do some cleanups

2019-07-09 Thread Wen Yang
Fix use-after-free in mpc831x_usb_cfg() and do some cleanups. According to Markus's suggestion, split it into two small patches: https://lkml.org/lkml/2019/7/8/520 Wen Yang (2): powerpc/83xx: fix use-after-free in mpc831x_usb_cfg() powerpc/83xx: cleanup error paths in mpc831x_usb_cfg() arch

[PATCH v5] cpufreq/pasemi: fix an use-after-free in pas_cpufreq_cpu_init()

2019-07-09 Thread Wen Yang
The cpu variable is still being used in the of_get_property() call after the of_node_put() call, which may result in use-after-free. Fixes: a9acc26b75f ("cpufreq/pasemi: fix possible object reference leak") Signed-off-by: Wen Yang Cc: "Rafael J. Wysocki" Cc: Viresh Kumar

[PATCH v4] cpufreq/pasemi: fix an use-after-free in pas_cpufreq_cpu_init()

2019-07-08 Thread Wen Yang
The cpu variable is still being used in the of_get_property() call after the of_node_put() call, which may result in use-after-free. Fixes: a9acc26b75f ("cpufreq/pasemi: fix possible object reference leak") Signed-off-by: Wen Yang Cc: "Rafael J. Wysocki" Cc: Viresh

[PATCH v3] cpufreq/pasemi: fix an use-after-free in pas_cpufreq_cpu_init()

2019-07-08 Thread Wen Yang
The cpu variable is still being used in the of_get_property() call after the of_node_put() call, which may result in use-after-free. Fixes: a9acc26b75f ("cpufreq/pasemi: fix possible object reference leak") Signed-off-by: Wen Yang Cc: "Rafael J. Wysocki" Cc: Viresh

[PATCH v2] cpufreq/pasemi: fix an use-after-free in pas_cpufreq_cpu_init()

2019-07-08 Thread Wen Yang
The cpu variable is still being used in the of_get_property() call after the of_node_put() call, which may result in use-after-free. Fixes: a9acc26b75f ("cpufreq/pasemi: fix possible object reference leak") Signed-off-by: Wen Yang Cc: "Rafael J. Wysocki" Cc: Viresh

[PATCH] irqchip: renesas-rza1: fix an use-after-free in rza1_irqc_probe()

2019-07-08 Thread Wen Yang
The gic_node is still being used in the rza1_irqc_parse_map() call after the of_node_put() call, which may result in use-after-free. Fixes: a644ccb819bc ("irqchip: Add Renesas RZ/A1 Interrupt Controller driver") Signed-off-by: Wen Yang Cc: Thomas Gleixner Cc: Jason Cooper Cc: Marc Z

[PATCH] phy: ti: am654-serdes: fix an use-after-free in serdes_am654_clk_register()

2019-07-08 Thread Wen Yang
The regmap_node variable is still being used in the syscon_node_to_regmap() call after the of_node_put() call, which may result in use-after-free. Fixes: 71e2f5c5c224 ("phy: ti: Add a new SERDES driver for TI's AM654x SoC") Signed-off-by: Wen Yang Cc: Kishon Vijay Abraham I Cc: Rog

[PATCH] cpufreq/pasemi: fix an use-after-free in pas_cpufreq_cpu_init()

2019-07-08 Thread Wen Yang
The cpu variable is still being used in the of_get_property() call after the of_node_put() call, which may result in use-after-free. Fixes: a9acc26b75f ("cpufreq/pasemi: fix possible object reference leak") Signed-off-by: Wen Yang Cc: "Rafael J. Wysocki" Cc: Viresh

[PATCH] net: pasemi: fix an use-after-free in pasemi_mac_phy_init()

2019-07-05 Thread Wen Yang
The phy_dn variable is still being used in of_phy_connect() after the of_node_put() call, which may result in use-after-free. Fixes: 1dd2d06c0459 ("net: Rework pasemi_mac driver to use of_mdio infrastructure") Signed-off-by: Wen Yang Cc: "David S. Miller" Cc: Thoma

[PATCH] net: axienet: fix a potential double free in axienet_probe()

2019-07-05 Thread Wen Yang
axistream-connected attribute optional") Signed-off-by: Wen Yang Cc: Anirudha Sarangi Cc: John Linn Cc: "David S. Miller" Cc: Michal Simek Cc: Robert Hancock Cc: net...@vger.kernel.org Cc: linux-arm-ker...@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- drivers/net/ethern

[PATCH] can: flexcan: fix an use-after-free in flexcan_setup_stop_mode()

2019-07-05 Thread Wen Yang
The gpr_np variable is still being used in dev_dbg() after the of_node_put() call, which may result in use-after-free. Fixes: de3578c198c6 ("can: flexcan: add self wakeup support") Signed-off-by: Wen Yang Cc: Wolfgang Grandegger Cc: Marc Kleine-Budde Cc: "David S. Mil

[PATCH] powerpc/prom: fix use-after-free on cpu_to_chip_id()

2019-07-05 Thread Wen Yang
The np variable is still being used after the of_node_put() call, which may result in use-after-free. We fix this issue by calling of_node_put() after the last usage. Fixes: 3eb906c6b6c1 ("powerpc: Make cpu_to_chip_id() available when SMP=n") Signed-off-by: Wen Yang Cc: Benjamin Her

[PATCH] powerpc: fix use-after-free on fixup_port_irq()

2019-07-05 Thread Wen Yang
; dereferenced here ... 484 #endif 485 } We solve this problem by introducing a new parent_np variable. Fixes: 9deaa53ac7fa ("serial: add irq handler for Freescale 16550 errata.") Signed-off-by: Wen Yang Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Rob Herring

[PATCH] powerpc/83xx: fix use-after-free on mpc831x_usb_cfg()

2019-07-05 Thread Wen Yang
Signed-off-by: Wen Yang Cc: Scott Wood Cc: Kumar Gala Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: linuxppc-...@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org --- arch/powerpc/platforms/83xx/usb.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-)

[PATCH] ASoC: audio-graph-card: fix use-after-free in graph_for_each_link

2019-07-04 Thread Wen Yang
Signed-off-by: Wen Yang Cc: Liam Girdwood Cc: Mark Brown Cc: Jaroslav Kysela Cc: Takashi Iwai Cc: Kuninori Morimoto Cc: alsa-de...@alsa-project.org Cc: linux-kernel@vger.kernel.org --- sound/soc/generic/audio-graph-card.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a

[PATCH v2] media: xilinx: fix leaked of_node references

2019-07-01 Thread Wen Yang
a corresponding object release within this function. drivers/media/platform/xilinx/xilinx-tpg.c:764:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 717, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Patrice

[PATCH 1/3] media: xilinx: fix leaked of_node references

2019-06-27 Thread Wen Yang
a corresponding object release within this function. drivers/media/platform/xilinx/xilinx-tpg.c:764:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 717, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Patrice

[PATCH 0/3] fix leaked of_node references in drivers/media

2019-06-27 Thread Wen Yang
issues. Wen Yang (3): media: xilinx: fix leaked of_node references media: exynos4-is: fix leaked of_node references media: ti-vpe: fix leaked of_node references drivers/media/platform/exynos4-is/fimc-is.c | 1 + drivers/media/platform/exynos4-is/media-dev.c | 2 ++ drivers/media

[PATCH 3/3] media: ti-vpe: fix leaked of_node references

2019-06-27 Thread Wen Yang
with refcount incremented on line 1607, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Benoit Parrot Cc: Mauro Carvalho Chehab Cc: linux-me...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/media/platform/ti-vpe/cal.c | 1 + 1 file changed, 1

[PATCH 2/3] media: exynos4-is: fix leaked of_node references

2019-06-27 Thread Wen Yang
, but without a corresponding object release within this function. drivers/media/platform/exynos4-is/media-dev.c:534:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 499, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc

[PATCH 0/4] fix leaked of_node references in drivers/media

2019-05-06 Thread Wen Yang
issues. Wen Yang (4): media: venus: firmware: fix leaked of_node references media: mtk-vpu: fix leaked of_node references media: mtk-vcodec: fix leaked of_node references media: xilinx: fix leaked of_node references drivers/media/platform/exynos4-is/fimc-is.c | 1 + drivers

[PATCH v3] ARM: rockchip: fix a leaked reference by adding missing of_node_put

2019-04-26 Thread Wen Yang
/arm/mach-rockchip/platsmp.c:303:3-9: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 294, but without a corresponding object release within this function. Signed-off-by: Wen Yang Reviewed-by: Florian Fainelli Suggested-by: Heiko Stuebner Cc: Russell King

[PATCH] fpga: stratix10-soc: fix use-after-free on s10_init()

2019-04-23 Thread Wen Yang
Signed-off-by: Wen Yang Cc: Alan Tull Cc: Moritz Fischer Cc: Nicolas Saenz Julienne Cc: linux-f...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/fpga/stratix10-soc.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/fpga/stratix10-soc.c b/drivers/fpga

[PATCH 0/3] fix leaked of_node references in drivers/firmware

2019-04-16 Thread Wen Yang
issues. Wen Yang (3): firmware: arm_sdei: fix leaked of_node references firmware: psci: fix leaked of_node references firmware: stratix10-svc: fix leaked of_node references drivers/firmware/arm_sdei.c | 1 + drivers/firmware/psci.c | 4 +++- drivers/firmware/stratix10-svc.c

[PATCH 1/3] firmware: arm_sdei: fix leaked of_node references

2019-04-16 Thread Wen Yang
:1091:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 1082, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: James Morse Cc: linux-arm-ker...@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- drivers

[PATCH 2/3] firmware: psci: fix leaked of_node references

2019-04-16 Thread Wen Yang
680 if (!np || !of_device_is_available(np)) 682 return -ENODEV; ---> leaked here ... 686 return init_fn(np); ---> released here 687 } Detected by using coccinelle. Signed-off-by: Wen Yang Cc: Mark Rutland Cc: Lorenzo Pieralisi Cc: linux-a

[PATCH 3/3] firmware: stratix10-svc: fix leaked of_node references

2019-04-16 Thread Wen Yang
incremented on line 1014, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Greg Kroah-Hartman Cc: Alan Tull Cc: Richard Gong Cc: Nicolas Saenz Julienne Cc: linux-kernel@vger.kernel.org --- drivers/firmware/stratix10-svc.c | 14 ++ 1 file

[PATCH 1/2] power: supply: fix leaked of_node refs in ab8500_bm_of_probe

2019-04-16 Thread Wen Yang
wer/supply/ab8500_bmdata.c:511:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 502, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Sebastian Reichel Cc: linux...@vger.kernel.org Cc: linux-kernel@vger.ker

[PATCH 2/2] power: supply: fix leaked of_node refs in power_supply_get_battery_info

2019-04-16 Thread Wen Yang
:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 595, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Sebastian Reichel Cc: linux...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/power/supply

[PATCH 0/2] fix leaked of_node references in drivers/power

2019-04-16 Thread Wen Yang
issues. Cc: Sebastian Reichel Cc: linux...@vger.kernel.org Cc: linux-kernel@vger.kernel.org Wen Yang (2): power: supply: fix leaked of_node refs in ab8500_bm_of_probe power: supply: fix leaked of_node refs in power_supply_get_battery_info drivers/power/supply/ab8500_bmdata.c | 1

[PATCH v2] pinctrl: rockchip: fix leaked of_node references

2019-04-15 Thread Wen Yang
this function. Signed-off-by: Wen Yang Cc: Linus Walleij Cc: Heiko Stuebner Cc: linux-g...@vger.kernel.org Cc: linux-rockc...@lists.infradead.org Cc: linux-kernel@vger.kernel.org --- v2: - put of_node_put below the whole if clause. - In the if clause, since node is NULL, there is no need to call

[PATCH 3/5] pinctrl: st: fix leaked of_node references

2019-04-12 Thread Wen Yang
with refcount incremented on line 1175, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Patrice Chotard Cc: Linus Walleij Cc: linux-g...@vger.kernel.org Cc: linux-kernel@vger.kernel.org (open list) --- drivers/pinctrl/pinctrl-st.c | 15 ++- 1

[PATCH 1/5] pinctrl: pistachio: fix leaked of_node references

2019-04-12 Thread Wen Yang
with refcount incremented on line 1360, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Linus Walleij Cc: linux-g...@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/pinctrl/pinctrl-pistachio.c | 2 ++ 1 file changed, 2 insertions(+) diff

  1   2   3   >