[PATCH] net/mlx5: fix kfree mismatch in indir_table.c

2021-04-04 Thread Xiaoming Ni
Memory allocated by kvzalloc() should be freed by kvfree(). Fixes: 34ca65352ddf2 ("net/mlx5: E-Switch, Indirect table infrastructur") Signed-off-by: Xiaoming Ni --- .../net/ethernet/mellanox/mlx5/core/esw/indir_table.c | 10 +- 1 file changed, 5 insertions(+), 5 deletion

[PATCH resend 3/4] nfc: fix memory leak in llcp_sock_connect()

2021-03-24 Thread Xiaoming Ni
support") Reported-by: "kiyin(尹亮)" Link: https://www.openwall.com/lists/oss-security/2020/11/01/1 Cc: #v3.3 Signed-off-by: Xiaoming Ni --- net/nfc/llcp_sock.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/nfc/llcp_sock.c b/net/nfc/llcp_sock.c index 9e2799ee1595..59172614b249

[PATCH resend 0/4] nfc: fix Resource leakage and endless loop

2021-03-24 Thread Xiaoming Ni
fix Resource leakage and endless loop in net/nfc/llcp_sock.c, reported by "kiyin(尹亮)". Link: https://www.openwall.com/lists/oss-security/2020/11/01/1 Xiaoming Ni (4): nfc: fix refcount leak in llcp_sock_bind() nfc: fix refcount leak in llcp_sock_connect() nfc: fix m

[PATCH resend 1/4] nfc: fix refcount leak in llcp_sock_bind()

2021-03-24 Thread Xiaoming Ni
inter when creating a socket") Reported-by: "kiyin(尹亮)" Link: https://www.openwall.com/lists/oss-security/2020/11/01/1 Cc: #v3.6 Signed-off-by: Xiaoming Ni --- net/nfc/llcp_sock.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/nfc/llcp_sock.c b/net/nfc/llcp_sock.

[PATCH resend 2/4] nfc: fix refcount leak in llcp_sock_connect()

2021-03-24 Thread Xiaoming Ni
local pointer when creating a socket") Reported-by: "kiyin(尹亮)" Link: https://www.openwall.com/lists/oss-security/2020/11/01/1 Cc: #v3.6 Signed-off-by: Xiaoming Ni --- net/nfc/llcp_sock.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/nfc/llcp_sock.c b/net/nfc/llcp_sock.

[PATCH resend 4/4] nfc: Avoid endless loops caused by repeated llcp_sock_connect()

2021-03-24 Thread Xiaoming Ni
-security/2020/11/01/1 Cc: #v3.11 Signed-off-by: Xiaoming Ni --- net/nfc/llcp_sock.c | 4 1 file changed, 4 insertions(+) diff --git a/net/nfc/llcp_sock.c b/net/nfc/llcp_sock.c index 59172614b249..a3b46f03 100644 --- a/net/nfc/llcp_sock.c +++ b/net/nfc/llcp_sock.c @@ -673,6 +673,10

Re: [PATCH 4/4] nfc: Avoid endless loops caused by repeated llcp_sock_connect()(Internet mail)

2021-03-04 Thread Xiaoming Ni
ins unchanged. Therefore, when llcp_sock_connect() is invoked again, resources such as llcp_sock->service_name are not repeatedly applied because sk_state is set to LLCP_CONNECTING. In this way, the repeated invoking of llcp_sock_connect() does not repeatedly leak resources. Thanks Xiaom

[PATCH 1/4] nfc: fix refcount leak in llcp_sock_bind()

2021-03-03 Thread Xiaoming Ni
inter when creating a socket") Reported-by: "kiyin(尹亮)" Link: https://www.openwall.com/lists/oss-security/2020/11/01/1 Cc: #v3.6 Signed-off-by: Xiaoming Ni --- net/nfc/llcp_sock.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/nfc/llcp_sock.c b/net/nfc/llcp_sock.

[PATCH 3/4] nfc: fix memory leak in llcp_sock_connect()

2021-03-03 Thread Xiaoming Ni
support") Reported-by: "kiyin(尹亮)" Link: https://www.openwall.com/lists/oss-security/2020/11/01/1 Cc: #v3.3 Signed-off-by: Xiaoming Ni --- net/nfc/llcp_sock.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/nfc/llcp_sock.c b/net/nfc/llcp_sock.c index 9e2799ee1595..59172614b249

[PATCH 0/4] nfc: fix Resource leakage and endless loop

2021-03-03 Thread Xiaoming Ni
fix Resource leakage and endless loop in net/nfc/llcp_sock.c, reported by "kiyin(尹亮)". Link: https://www.openwall.com/lists/oss-security/2020/11/01/1 Xiaoming Ni (4): nfc: fix refcount leak in llcp_sock_bind() nfc: fix refcount leak in llcp_sock_connect() nfc: fix m

[PATCH 2/4] nfc: fix refcount leak in llcp_sock_connect()

2021-03-03 Thread Xiaoming Ni
local pointer when creating a socket") Reported-by: "kiyin(尹亮)" Link: https://www.openwall.com/lists/oss-security/2020/11/01/1 Cc: #v3.6 Signed-off-by: Xiaoming Ni --- net/nfc/llcp_sock.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/nfc/llcp_sock.c b/net/nfc/llcp_sock.

[PATCH 4/4] nfc: Avoid endless loops caused by repeated llcp_sock_connect()

2021-03-03 Thread Xiaoming Ni
enwall.com/lists/oss-security/2020/11/01/1 Cc: #v3.11 Signed-off-by: Xiaoming Ni --- net/nfc/llcp_sock.c | 4 1 file changed, 4 insertions(+) diff --git a/net/nfc/llcp_sock.c b/net/nfc/llcp_sock.c index 59172614b249..a3b46f03 100644 --- a/net/nfc/llcp_sock.c +++ b/net/nf

Re: [PATCH] futex: fix dead code in attach_to_pi_owner()

2021-02-25 Thread Xiaoming Ni
On 2021/2/25 16:25, Greg KH wrote: On Mon, Feb 22, 2021 at 08:53:52PM +0800, Xiaoming Ni wrote: From: Thomas Gleixner The handle_exit_race() function is defined in commit c158b461306df82 ("futex: Cure exit race"), which never returns -EBUSY. This results in a small piece of

Re: [PATCH stable-rc queue/4.9 1/1] futex: Provide distinct return value when owner is exiting

2021-02-24 Thread Xiaoming Ni
On 2021/2/24 15:47, Greg KH wrote: On Wed, Feb 24, 2021 at 09:41:01AM +0800, Xiaoming Ni wrote: On 2021/2/23 21:00, Greg KH wrote: On Mon, Feb 22, 2021 at 10:11:37PM +0800, Xiaoming Ni wrote: On 2021/2/22 20:09, Greg KH wrote: On Mon, Feb 22, 2021 at 06:54:06PM +0800, Xiaoming Ni wrote

[PATCH 4.9.258] futex: fix dead code in attach_to_pi_owner()

2021-02-24 Thread Xiaoming Ni
t race") Cc: sta...@vger.kernel.org # v4.9.258 Signed-off-by: Xiaoming Ni --- kernel/futex.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/futex.c b/kernel/futex.c index b65dbb5d60bb..0fd785410150 100644 --- a/kernel/futex.c +++ b/kernel/futex.c @@ -1207,11

Re: [PATCH stable-rc queue/4.9 1/1] futex: Provide distinct return value when owner is exiting

2021-02-23 Thread Xiaoming Ni
On 2021/2/23 21:00, Greg KH wrote: On Mon, Feb 22, 2021 at 10:11:37PM +0800, Xiaoming Ni wrote: On 2021/2/22 20:09, Greg KH wrote: On Mon, Feb 22, 2021 at 06:54:06PM +0800, Xiaoming Ni wrote: On 2021/2/22 18:16, Greg KH wrote: On Mon, Feb 22, 2021 at 03:03:28PM +0800, Xiaoming Ni wrote

Re: [PATCH stable-rc queue/4.9 1/1] futex: Provide distinct return value when owner is exiting

2021-02-22 Thread Xiaoming Ni
On 2021/2/22 20:09, Greg KH wrote: On Mon, Feb 22, 2021 at 06:54:06PM +0800, Xiaoming Ni wrote: On 2021/2/22 18:16, Greg KH wrote: On Mon, Feb 22, 2021 at 03:03:28PM +0800, Xiaoming Ni wrote: From: Thomas Gleixner commit ac31c7ff8624409ba3c4901df9237a616c187a5d upstream. This commit

[PATCH] futex: fix dead code in attach_to_pi_owner()

2021-02-22 Thread Xiaoming Ni
b461306df82 ("futex: Cure exit race") Cc: sta...@vger.kernel.org # 4.9.258-rc1 Signed-off-by: Xiaoming Ni --- kernel/futex.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/futex.c b/kernel/futex.c index b65dbb5d60bb..0fd785410150 100644 --- a/kernel/

Re: [PATCH stable-rc queue/4.9 1/1] futex: Provide distinct return value when owner is exiting

2021-02-22 Thread Xiaoming Ni
On 2021/2/22 18:16, Greg KH wrote: On Mon, Feb 22, 2021 at 03:03:28PM +0800, Xiaoming Ni wrote: From: Thomas Gleixner commit ac31c7ff8624409ba3c4901df9237a616c187a5d upstream. This commit is already in the 4.9 tree. If the backport was incorrect, say that here, and describe what went wrong

[PATCH stable-rc queue/4.9 0/1] repatch

2021-02-21 Thread Xiaoming Ni
I found a dead code in the queue/4.9 branch of the stable-rc repository. 2021-02-03: commit c27f392040e2f6 ("futex: Provide distinct return value when owner is exiting") The function handle_exit_race does not exist. Therefore, the change in handle_exit_race() is ignored in the

[PATCH stable-rc queue/4.9 1/1] futex: Provide distinct return value when owner is exiting

2021-02-21 Thread Xiaoming Ni
://lkml.kernel.org/r/20191106224556.935606...@linutronix.de [nixiaoming: Modify handle_exit_race() to avoid dead code.] Cc: sta...@vger.kernel.org # queue/4.9 Signed-off-by: Xiaoming Ni --- kernel/futex.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/futex.c b/kernel

[PATCH v4] proc_sysctl: fix oops caused by incorrect command parameters.

2021-01-18 Thread Xiaoming Ni
empty when "phram" is a sysctl field. Error codes are returned in the failure branch, and error logs are generated by parse_args(). Fixes: 3db978d480e2843 ("kernel/sysctl: support setting sysctl parameters from kernel command line") Cc: sta...@kernel.org # v5.8-rc1+ Signed-off-by:

Re: [PATCH v3] proc_sysctl: fix oops caused by incorrect command parameters.

2021-01-16 Thread Xiaoming Ni
new fix patch based on the current code of linux-next. - Develop a new V4 patch: Use V2 to discuss how to use the Patch4 solution. https://lore.kernel.org/linux-fsdevel/bc098af4-c0cd-212e-d09d-46d617d0a...@huawei.com/#t Thanks Xiaoming Ni

Re: [PATCH v3] proc_sysctl: fix oops caused by incorrect command parameters.

2021-01-11 Thread Xiaoming Ni
On 2021/1/12 12:33, Andrew Morton wrote: On Tue, 12 Jan 2021 11:31:55 +0800 Xiaoming Ni wrote: The process_sysctl_arg() does not check whether val is empty before invoking strlen(val). If the command line parameter () is incorrectly configured and val is empty, oops is triggered

[PATCH v3] proc_sysctl: fix oops caused by incorrect command parameters.

2021-01-11 Thread Xiaoming Ni
empty when "phram" is a sysctl field. Error codes are returned in the failure branch, and error logs are generated by parse_args(). Fixes: 3db978d480e2843 ("kernel/sysctl: support setting sysctl parameters from kernel command line") Signed-off-by: Xiaoming Ni - v3: Retu

Re: [PATCH v2] proc_sysctl: fix oops caused by incorrect command parameters.

2021-01-10 Thread Xiaoming Ni
param += sizeof("sysctl") - 1; sysctl log for patch3: no log When process_sysctl_arg() is called, the param parameter may not be the sysctl parameter. Patch3 or patch4, which is better? Thanks Xiaoming Ni

Re: [PATCH v2] proc_sysctl: fix oops caused by incorrect command parameters.

2021-01-10 Thread Xiaoming Ni
On 2021/1/9 17:10, Andy Shevchenko wrote: On Friday, January 8, 2021, Xiaoming Ni <mailto:nixiaom...@huawei.com>> wrote: The process_sysctl_arg() does not check whether val is empty before  invoking strlen(val). If the command line parameter () is incorrectly  c

Re: [PATCH v2] proc_sysctl: fix oops caused by incorrect command parameters.

2021-01-08 Thread Xiaoming Ni
On 2021/1/8 17:21, Michal Hocko wrote: On Fri 08-01-21 10:33:39, Xiaoming Ni wrote: The process_sysctl_arg() does not check whether val is empty before invoking strlen(val). If the command line parameter () is incorrectly configured and val is empty, oops is triggered. For example

[PATCH v2] proc_sysctl: fix oops caused by incorrect command parameters.

2021-01-07 Thread Xiaoming Ni
xes: 3db978d480e2843 ("kernel/sysctl: support setting sysctl parameters from kernel command line") Signed-off-by: Xiaoming Ni - v2: Added log output of the failure branch based on the review comments of Kees Cook. v1: https://lore.kernel.org/lkml/20201224074256.

Re: [PATCH] proc_sysclt: fix oops caused by incorrect command parameters.

2021-01-06 Thread Xiaoming Ni
On 2021/1/7 7:46, Kees Cook wrote: subject typo: "sysclt" -> "sysctl" On Thu, Dec 24, 2020 at 03:42:56PM +0800, Xiaoming Ni wrote: The process_sysctl_arg() does not check whether val is empty before invoking strlen(val). If the command line parameter () is incorrect

ping //Re: [PATCH] proc_sysclt: fix oops caused by incorrect command parameters.

2021-01-03 Thread Xiaoming Ni
ping On 2020/12/24 15:42, Xiaoming Ni wrote: The process_sysctl_arg() does not check whether val is empty before invoking strlen(val). If the command line parameter () is incorrectly configured and val is empty, oops is triggered. For example, "hung_task_panic=1" is incorrect

[PATCH] proc_sysclt: fix oops caused by incorrect command parameters.

2020-12-23 Thread Xiaoming Ni
xes: 3db978d480e2843 ("kernel/sysctl: support setting sysctl parameters from kernel command line") Signed-off-by: Xiaoming Ni --- fs/proc/proc_sysctl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index 317899222d7f..451

Re: [PATCH] powerpc:Don't print raw EIP/LR hex values in dump_stack() and show_regs()

2020-12-22 Thread Xiaoming Ni
On 2020/12/22 1:12, Segher Boessenkool wrote: On Mon, Dec 21, 2020 at 04:42:23PM +, David Laight wrote: From: Segher Boessenkool Sent: 21 December 2020 16:32 On Mon, Dec 21, 2020 at 04:17:21PM +0100, Christophe Leroy wrote: Le 21/12/2020 à 04:27, Xiaoming Ni a écrit : Since the commit

[PATCH] powerpc:Don't print raw EIP/LR hex values in dump_stack() and show_regs()

2020-12-20 Thread Xiaoming Ni
nd arm64's lead: commit a25ffd3a6302a6 ("arm64: traps: Don't print stack or raw PC/LR values in backtraces") commit bb5e5ce545f203 ("x86/dumpstack: Remove kernel text addresses from stack dump") Signed-off-by: Xiaoming Ni --- arch/powerpc/kernel/process.c | 12 +

[PATCH v2 0/4] panic: Add new API in_panic_state()

2020-12-19 Thread Xiaoming Ni
: Rename api to in_panic_state as recommended by Pavel Machek, Tetsuo Handa, Randy Dunlap. v1: https://lore.kernel.org/lkml/20201218114406.61906-1-nixiaom...@huawei.com/ API name: is_being_panic Xiaoming Ni (4): panic: Add new API in_panic_state() hung_task: Replace

[PATCH v2 4/4] leds:trigger:ledtrig-heartbeat: Replace "panic_heartbeats" with in_panic_state()

2020-12-19 Thread Xiaoming Ni
Replace the global variable "panic_heartbeats" with in_panic_state() Signed-off-by: Xiaoming Ni --- drivers/leds/trigger/ledtrig-heartbeat.c | 19 +-- 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/drivers/leds/trigger/ledtrig-heartbeat.c b/drivers/le

[PATCH v2 3/4] leds:trigger:ledtrig-activity Replace "panic_detected" with in_panic_state()

2020-12-19 Thread Xiaoming Ni
Replace the global variable "panic_detected" with in_panic_state() Signed-off-by: Xiaoming Ni --- drivers/leds/trigger/ledtrig-activity.c | 19 +-- 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/drivers/leds/trigger/ledtrig-activity.c b/drivers/le

[PATCH v2 2/4] hung_task: Replace "did_panic" with in_panic_state()

2020-12-19 Thread Xiaoming Ni
Replace the global variable "did_panic" with in_panic_state() Signed-off-by: Xiaoming Ni --- kernel/hung_task.c | 17 + 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/kernel/hung_task.c b/kernel/hung_task.c index bb2e3e15c84c..2747cd6dd35e 100644 --

[PATCH v2 1/4] panic: Add new API in_panic_state()

2020-12-19 Thread Xiaoming Ni
-by: Xiaoming Ni --- include/linux/kernel.h | 1 + kernel/panic.c | 6 ++ 2 files changed, 7 insertions(+) diff --git a/include/linux/kernel.h b/include/linux/kernel.h index f7902d8c1048..c9a9078157b6 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -167,6 +167,7 @@ void

Re: [PATCH 2/4] hung_task: Replace "did_panic" with is_be_panic()

2020-12-19 Thread Xiaoming Ni
On 2020/12/19 1:06, Randy Dunlap wrote: On 12/18/20 6:36 AM, Tetsuo Handa wrote: On 2020/12/18 21:59, Pavel Machek wrote: On Fri 2020-12-18 19:44:04, Xiaoming Ni wrote: Plus.. is_being_panic is not really english. "is_paniccing" would be closer...? Or in_panic() ? Yes, or in_p

[PATCH 3/4] leds:trigger:ledtrig-activity Replace "panic_detected" with is_be_panic()

2020-12-18 Thread Xiaoming Ni
Replace the global variable "panic_detected" with is_be_panic() Signed-off-by: Xiaoming Ni --- drivers/leds/trigger/ledtrig-activity.c | 19 +-- 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/drivers/leds/trigger/ledtrig-activity.c b/drivers/leds/trigg

[PATCH 0/4] Add new API is_being_panic()

2020-12-18 Thread Xiaoming Ni
Add is_being_panic() to check whether the system is in panic state. Used to replace the global variable used to determine the panic status in other features: hung_task ledtrig-activity ledtrig-heartbeat Xiaoming Ni (4): panic: Add new API is_being_panic() hung_task: Replace "did_

[PATCH 2/4] hung_task: Replace "did_panic" with is_be_panic()

2020-12-18 Thread Xiaoming Ni
Replace the global variable "did_panic" with is_be_panic() Signed-off-by: Xiaoming Ni --- kernel/hung_task.c | 17 + 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/kernel/hung_task.c b/kernel/hung_task.c index bb2e3e15c84c..3374b993da4c 100644 --

[PATCH 4/4] leds:trigger:ledtrig-heartbeat: Replace "panic_heartbeats" with is_be_panic()

2020-12-18 Thread Xiaoming Ni
Replace the global variable "panic_heartbeats" with is_be_panic() Signed-off-by: Xiaoming Ni --- drivers/leds/trigger/ledtrig-heartbeat.c | 19 +-- 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/drivers/leds/trigger/ledtrig-heartbeat.c b/drivers/le

[PATCH 1/4] panic: Add new API is_being_panic()

2020-12-18 Thread Xiaoming Ni
Add is_being_panic() to check whether the system is in panic state. Used to replace the global variable used to determine the panic status in other features: hung_task ledtrig-activity ledtrig-heartbeat Signed-off-by: Xiaoming Ni --- include/linux/kernel.h | 1 + kernel/panic.c | 6

[PATCH] dma/qcom/gpi: Fixes a format mismatch

2020-12-18 Thread Xiaoming Ni
unsigned int', but argument 5 has type 'phys_addr_t {aka unsigned int}' [-Wformat=] Signed-off-by: Xiaoming Ni --- drivers/dma/qcom/gpi.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/dma/qcom/gpi.c b/drivers/dma/qcom/gpi.c index d2334f535de2..556c070a514c

Re: ping // [PATCH] mtd:cfi_cmdset_0002: fix atomic sleep bug when CONFIG_MTD_XIP=y

2020-12-07 Thread Xiaoming Ni
On 2020/12/8 2:59, Vignesh Raghavendra wrote: Hi Xiaoming, On 12/7/20 4:23 PM, Miquel Raynal wrote: Hi Xiaoming, Xiaoming Ni wrote on Mon, 7 Dec 2020 18:48:33 +0800: ping On 2020/11/27 21:07, Xiaoming Ni wrote: When CONFIG_MTD_XIP=y, local_irq_disable() is called in xip_disable

ping // [PATCH] mtd:cfi_cmdset_0002: fix atomic sleep bug when CONFIG_MTD_XIP=y

2020-12-07 Thread Xiaoming Ni
ping On 2020/11/27 21:07, Xiaoming Ni wrote: When CONFIG_MTD_XIP=y, local_irq_disable() is called in xip_disable(). To avoid sleep in interrupt context, we need to call local_irq_enable() before schedule(). The problem call stack is as follows: bug1: do_write_oneword_retry

[PATCH] mtd:cfi_cmdset_0002: fix atomic sleep bug when CONFIG_MTD_XIP=y

2020-11-27 Thread Xiaoming Ni
;) Cc: sta...@vger.kernel.org # v2.6.13 Signed-off-by: Xiaoming Ni --- drivers/mtd/chips/cfi_cmdset_0002.c | 16 1 file changed, 16 insertions(+) diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c index a1f3e1031c3d..12c3776f093a 100644 --- a/d

ping //Re: [PATCH v2] arm:traps: Don't print stack or raw PC/LR hex values in backtraces

2020-10-26 Thread Xiaoming Ni
ping On 2020/10/16 10:31, Xiaoming Ni wrote: Printing raw pointer values in backtraces has potential security implications and are of questionable value anyway. This patch follows x86 and arm64's lead and removes the "Exception stack:" dump from kernel backtraces: commit a25f

[PATCH] arm:traps:Don't dump the memory in non-system reset scenarios

2020-10-26 Thread Xiaoming Ni
PC/LR values in backtraces") commit 0ee1dd9f5e7eae ("x86/dumpstack: Remove raw stack dump") Signed-off-by: Xiaoming Ni --- arch/arm/kernel/traps.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/arch/arm/kernel/traps.c b/arch/arm/ker

[PATCH v2] arm:traps: Don't print stack or raw PC/LR hex values in backtraces

2020-10-15 Thread Xiaoming Ni
nt stack or raw PC/LR values in backtraces") commit bb5e5ce545f203 ("x86/dumpstack: Remove kernel text addresses from stack dump") Signed-off-by: Xiaoming Ni --- v2: Delete [] from the stack according to the email discussion in patch V1, Other informatio

Re: [PATCH] arm:traps: Don't print stack or raw PC/LR values in backtraces

2020-10-11 Thread Xiaoming Ni
l stack contains kernel module symbols. Delete the PC/LR address and retain the sysbol+offset. The kernel can still be debugged. Thanks Xiaoming Ni

Re: [PATCH] arm:traps: Don't print stack or raw PC/LR values in backtraces

2020-10-09 Thread Xiaoming Ni
Yes, only %08lx was deleted, but %ps is still retained. - printk("%s[<%08lx>] (%ps) from [<%08lx>] (%pS)\n", - loglvl, where, (void *)where, from, (void *)from); + printk("%s (%ps) from (%pS)\n", + loglvl, (void *)where, (void *)from); Thanks Xiaoming Ni

[PATCH] efi:mokvar-table: fix build error

2020-10-09 Thread Xiaoming Ni
'devm_memremap'? [-Werror=implicit-function-declaration] add #include to fix this build error Signed-off-by: Xiaoming Ni --- drivers/firmware/efi/mokvar-table.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/firmware/efi/mokvar-table.c b/drivers/firmware/efi/mokvar-table.c index

[PATCH] arm:traps: Don't print stack or raw PC/LR values in backtraces

2020-10-09 Thread Xiaoming Ni
nt stack or raw PC/LR values in backtraces") commit 0ee1dd9f5e7eae ("x86/dumpstack: Remove raw stack dump") commit bb5e5ce545f203 ("x86/dumpstack: Remove kernel text addresses from stack dump") Signed-off-by: Xiaoming Ni --- arch/arm/kernel/pro

Re: Question: Why is there no notification when a file is opened using filp_open()?

2020-09-09 Thread Xiaoming Ni
On 2020/9/9 11:44, Amir Goldstein wrote: On Tue, Sep 8, 2020 at 8:19 PM Matthew Wilcox wrote: On Tue, Sep 08, 2020 at 04:18:29PM +0300, Amir Goldstein wrote: On Tue, Sep 8, 2020 at 3:53 PM Xiaoming Ni wrote: For example, in fs/coredump.c, do_coredump() calls filp_open() to generate core

Re: Question: Why is there no notification when a file is opened using filp_open()?

2020-09-08 Thread Xiaoming Ni
On 2020/9/8 18:06, Amir Goldstein wrote: On Tue, Sep 8, 2020 at 11:02 AM Xiaoming Ni wrote: The file opening action on the system may be from user-mode sys_open() or kernel-mode filp_open(). Currently, fsnotify_open() is invoked in do_sys_openat2(). But filp_open() is not notified. Why

Question: Why is there no notification when a file is opened using filp_open()?

2020-09-08 Thread Xiaoming Ni
() to ensure that both user-mode and kernel-mode file opening operations can be notified? Thanks Xiaoming Ni

ping//Re: [PATCH] security: fix some spelling mistakes in the comments by codespell

2020-08-30 Thread Xiaoming Ni
ping On 2020/8/22 11:05, Xiaoming Ni wrote: ecurity/commoncap.c: capabilties ==> capabilities security/lsm_audit.c: programers ==> programmers security/tomoyo/audit.c: stuct ==> struct security/tomoyo/common.c: Poiter ==> Pointer security/smack/smack_lsm.c: overriden ==> overri

[PATCH] arm64: fix some spelling mistakes in the comments by codespell

2020-08-27 Thread Xiaoming Ni
spin_table.c:86: endianess ==> endianness arch/arm64/kernel/smp_spin_table.c:88: endianess ==> endianness arch/arm64/kvm/vgic/vgic-mmio-v3.c:1004: targetting ==> targeting arch/arm64/kvm/vgic/vgic-mmio-v3.c:1005: targetting ==> targeting Signed-off-by: Xiaoming Ni --- arch/arm64/incl

[PATCH] security: fix some spelling mistakes in the comments by codespell

2020-08-21 Thread Xiaoming Ni
fs.c: overriden ==> overridden security/integrity/ima/ima_template_lib.c: algoritm ==> algorithm Signed-off-by: Xiaoming Ni --- security/commoncap.c | 2 +- security/integrity/ima/ima_template_lib.c | 2 +- security/lsm_audit.c | 2 +- security/smack/smack_lsm

[PATCH v2] s390: fix build error for sys_call_table_emu

2020-06-18 Thread Xiaoming Ni
milarly, modify tools/perf/arch/s390/entry/syscalls/syscall.tbl. Fixes: ("All arch: remove system call sys_sysctl") Fixes: https://lore.kernel.org/linuxppc-dev/20200616030734.87257-1-nixiaom...@huawei.com/ Reported-by: kernel test robot Signed-off-by: Xiaoming Ni changes in v2:

Re: [PATCH] s390: fix build error for sys_call_table_emu

2020-06-18 Thread Xiaoming Ni
On 2020/6/18 19:27, Heiko Carstens wrote: On Thu, Jun 18, 2020 at 07:03:20PM +0800, Xiaoming Ni wrote: Build error on s390: arch/s390/kernel/entry.o: in function `sys_call_table_emu': >> (.rodata+0x1288): undefined reference to `__s390_' In commit ("All arch: remove

[PATCH] s390: fix build error for sys_call_table_emu

2020-06-18 Thread Xiaoming Ni
ot;) Fixes: https://lore.kernel.org/linuxppc-dev/20200616030734.87257-1-nixiaom...@huawei.com/ Reported-by: kernel test robot Signed-off-by: Xiaoming Ni --- arch/s390/kernel/syscalls/syscall.tbl | 1 - tools/perf/arch/s390/entry/syscalls/syscall.tbl | 1 - 2 files changed, 2 deletio

Re: [PATCH 0/3] Convert nsproxy, groups, and creds to refcount_t

2020-06-14 Thread Xiaoming Ni
->mm_users also be replaced by refcount_t? In addition, is it better to change all variables that use atomic_dec_and_test to control the release process to refconut_t? Thanks Xiaoming Ni

Re: [PATCH 3/3] creds: convert cred.usage to refcount_t

2020-06-14 Thread Xiaoming Ni
Liljestrand Link: https://lore.kernel.org/r/20190306110549.7628-4-elena.reshet...@intel.com Signed-off-by: Kees Cook Currently this patch is better than my RFC patch Looks good to me. Thanks Xiaoming Ni

[PATCH RFC] cred: Add WARN to detect wrong use of get/put_cred

2020-06-12 Thread Xiaoming Ni
in the panic call stack... So, add WARN() in get_cred()/put_cred(), and pray to catch the murderer at the first scene. Signed-off-by: Xiaoming Ni --- include/linux/cred.h | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/include/linux/cred.h b/include/linux/c

Re: [PATCH] sysctl: Delete the code of sys_sysctl

2020-06-10 Thread Xiaoming Ni
On 2020/6/10 3:20, Eric W. Biederman wrote: Xiaoming Ni writes: Since the commit 61a47c1ad3a4dc ("sysctl: Remove the sysctl system call"), sys_sysctl has lost its actual role: any input can only return an error. The remaining code does have a role. It reports programs that atte

Re: [PATCH] sysctl: Delete the code of sys_sysctl

2020-06-10 Thread Xiaoming Ni
On 2020/6/9 23:40, Kees Cook wrote: On Tue, Jun 09, 2020 at 02:20:05PM +0800, Xiaoming Ni wrote: Since the commit 61a47c1ad3a4dc ("sysctl: Remove the sysctl system call"), sys_sysctl has lost its actual role: any input can only return an error. Delete the code and return -ENOSY

[PATCH] sysctl: Delete the code of sys_sysctl

2020-06-09 Thread Xiaoming Ni
Since the commit 61a47c1ad3a4dc ("sysctl: Remove the sysctl system call"), sys_sysctl has lost its actual role: any input can only return an error. Delete the code and return -ENOSYS directly at the function entry Signed-off-by: Xiaoming Ni --- kernel/sysctl_bina

[PATCH] ASoC: max98390: fix build warning detected by -Wformat

2020-06-04 Thread Xiaoming Ni
Fix build warning: sound/soc/codecs/max98390.c:781:3: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'size_t {aka const unsigned int}' [-Wformat=] Signed-off-by: Xiaoming Ni --- sound/soc/codecs/max98390.c | 2 +- 1 file changed, 1

Re: [PATCH 13/13] fs: move binfmt_misc sysctl to its own file

2020-06-04 Thread Xiaoming Ni
44 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -2853,6 +2853,7 @@ void register_sysctl_empty_subdir(const char *base, { register_sysctl_subdir(base, subdir, sysctl_mount_point); } +EXPORT_SYMBOL_GPL(register_sysctl_empty_subdir); #endif /* CONFIG_SYSCTL */ Thanks Xiaoming Ni

Re: [PATCH 11/13] random: simplify sysctl declaration with register_sysctl_subdir()

2020-05-29 Thread Xiaoming Ni
On 2020/5/29 18:26, Greg KH wrote: On Fri, May 29, 2020 at 07:41:06AM +, Luis Chamberlain wrote: From: Xiaoming Ni Move random_table sysctl from kernel/sysctl.c to drivers/char/random.c and use register_sysctl_subdir() to help remove the clutter out of kernel/sysctl.c. Signed-off

Re: [PATCH 09/13] firmware_loader: simplify sysctl declaration with register_sysctl_subdir()

2020-05-29 Thread Xiaoming Ni
On 2020/5/29 18:26, Greg KH wrote: On Fri, May 29, 2020 at 07:41:04AM +, Luis Chamberlain wrote: From: Xiaoming Ni Move the firmware config sysctl table to fallback_table.c and use the new register_sysctl_subdir() helper. This removes the clutter from kernel/sysctl.c. Signed-off

Re: [PATCH v4 1/4] sysctl: Add register_sysctl_init() interface

2020-05-29 Thread Xiaoming Ni
On 2020/5/29 15:36, Luis Chamberlain wrote: On Fri, May 29, 2020 at 03:27:22PM +0800, Xiaoming Ni wrote: On 2020/5/29 15:09, Luis Chamberlain wrote: On Tue, May 19, 2020 at 11:31:08AM +0800, Xiaoming Ni wrote: --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -3358,6 +3358,25 @@ int __init

Re: [PATCH v4 1/4] sysctl: Add register_sysctl_init() interface

2020-05-29 Thread Xiaoming Ni
On 2020/5/29 15:09, Luis Chamberlain wrote: On Tue, May 19, 2020 at 11:31:08AM +0800, Xiaoming Ni wrote: --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -3358,6 +3358,25 @@ int __init sysctl_init(void) kmemleak_not_leak(hdr); return 0; } + +/* + * The sysctl interface is used

Re: [PATCH v2 1/1] userfaultfd/sysctl: add vm.unprivileged_userfaultfd

2020-05-28 Thread Xiaoming Ni
On 2020/5/27 22:21, Peter Xu wrote: On Wed, May 27, 2020 at 02:54:13PM +0800, Xiaoming Ni wrote: On Tue, Mar 19, 2019 at 11:07:22AM +0800, Peter Xu wrote: Add a global sysctl knob "vm.unprivileged_userfaultfd" to control whether userfaultfd is allowed by unprivileged users. When t

Re: [PATCH v2 1/1] userfaultfd/sysctl: add vm.unprivileged_userfaultfd

2020-05-27 Thread Xiaoming Ni
alds/linux.git/commit/?id=cefdca0a86be517bc390fc4541e3674b8e7803b0 Thanks Xiaoming Ni

Re: [PATCH v4 0/4] cleaning up the sysctls table (hung_task watchdog)

2020-05-19 Thread Xiaoming Ni
On 2020/5/20 11:31, Andrew Morton wrote: On Tue, 19 May 2020 11:31:07 +0800 Xiaoming Ni wrote: Kernel/sysctl.c eek! fs/proc/proc_sysctl.c| 2 +- include/linux/sched/sysctl.h | 14 +-- include/linux/sysctl.h | 13 ++- kernel/hung_task.c | 77

Re: [PATCH v4 2/4] sysctl: Move some boundary constants form sysctl.c to sysctl_vals

2020-05-19 Thread Xiaoming Ni
On 2020/5/19 12:44, Tetsuo Handa wrote: On 2020/05/19 12:31, Xiaoming Ni wrote: Some boundary (.extra1 .extra2) constants (E.g: neg_one two) in sysctl.c are used in multiple features. Move these variables to sysctl_vals to avoid adding duplicate variables when cleaning up sysctls table. Signed

[PATCH v4 0/4] cleaning up the sysctls table (hung_task watchdog)

2020-05-18 Thread Xiaoming Ni
23928-1-git-send-email-nixiaom...@huawei.com/ Xiaoming Ni (4): sysctl: Add register_sysctl_init() interface sysctl: Move some boundary constants form sysctl.c to sysctl_vals hung_task: Move hung_task sysctl interface to hung_task.c watchdog: move watchdog sysctl interface to watchdog.c fs/p

[PATCH v4 1/4] sysctl: Add register_sysctl_init() interface

2020-05-18 Thread Xiaoming Ni
In order to eliminate the duplicate code for registering the sysctl interface during the initialization of each feature, add the register_sysctl_init() interface Signed-off-by: Xiaoming Ni Reviewed-by: Kees Cook --- include/linux/sysctl.h | 2 ++ kernel/sysctl.c| 19

[PATCH v4 2/4] sysctl: Move some boundary constants form sysctl.c to sysctl_vals

2020-05-18 Thread Xiaoming Ni
Some boundary (.extra1 .extra2) constants (E.g: neg_one two) in sysctl.c are used in multiple features. Move these variables to sysctl_vals to avoid adding duplicate variables when cleaning up sysctls table. Signed-off-by: Xiaoming Ni Reviewed-by: Kees Cook --- fs/proc/proc_sysctl.c | 2

[PATCH v4 4/4] watchdog: move watchdog sysctl interface to watchdog.c

2020-05-18 Thread Xiaoming Ni
Move watchdog syscl interface to watchdog.c. Use register_sysctl() to register the sysctl interface to avoid merge conflicts when different features modify sysctl.c at the same time. Signed-off-by: Xiaoming Ni Reviewed-by: Kees Cook --- kernel/sysctl.c | 96

[PATCH v4 3/4] hung_task: Move hung_task sysctl interface to hung_task.c

2020-05-18 Thread Xiaoming Ni
Move hung_task sysctl interface to hung_task.c. Use register_sysctl() to register the sysctl interface to avoid merge conflicts when different features modify sysctl.c at the same time. Signed-off-by: Xiaoming Ni Reviewed-by: Kees Cook --- include/linux/sched/sysctl.h | 14 +--- kernel

Re: [PATCH v3 0/4] cleaning up the sysctls table (hung_task watchdog)

2020-05-18 Thread Xiaoming Ni
On 2020/5/19 1:16, Luis Chamberlain wrote: On Mon, May 18, 2020 at 11:59:53AM +0800, Xiaoming Ni wrote: Kernel/sysctl.c contains more than 190 interface files, and there are a large number of config macro controls. When modifying the sysctl interface directly in kernel/sysctl.c, conflicts

[PATCH v3 4/4] watchdog: move watchdog sysctl interface to watchdog.c

2020-05-17 Thread Xiaoming Ni
Move watchdog syscl interface to watchdog.c. Use register_sysctl() to register the sysctl interface to avoid merge conflicts when different features modify sysctl.c at the same time. Signed-off-by: Xiaoming Ni Reviewed-by: Kees Cook --- kernel/sysctl.c | 96

[PATCH v3 0/4] cleaning up the sysctls table (hung_task watchdog)

2020-05-17 Thread Xiaoming Ni
eature code movement 2. Move hung_task sysctl to hung_task.c instead of adding new file 3. Extract multiple common variables instead of only neg_one, and keep the order of member values in sysctl_vals 4. Add const modification to the variable sixty in watchdog sysctl V1: https://lkml.org/lkm

[PATCH v3 3/4] hung_task: Move hung_task sysctl interface to hung_task.c

2020-05-17 Thread Xiaoming Ni
Move hung_task sysctl interface to hung_task.c. Use register_sysctl() to register the sysctl interface to avoid merge conflicts when different features modify sysctl.c at the same time. Signed-off-by: Xiaoming Ni Reviewed-by: Kees Cook --- include/linux/sched/sysctl.h | 8 +- kernel

[PATCH v3 1/4] sysctl: Add register_sysctl_init() interface

2020-05-17 Thread Xiaoming Ni
In order to eliminate the duplicate code for registering the sysctl interface during the initialization of each feature, add the register_sysctl_init() interface Signed-off-by: Xiaoming Ni Reviewed-by: Kees Cook --- include/linux/sysctl.h | 2 ++ kernel/sysctl.c| 19

[PATCH v3 2/4] sysctl: Move some boundary constants form sysctl.c to sysctl_vals

2020-05-17 Thread Xiaoming Ni
Some boundary (.extra1 .extra2) constants (E.g: neg_one two) in sysctl.c are used in multiple features. Move these variables to sysctl_vals to avoid adding duplicate variables when cleaning up sysctls table. Signed-off-by: Xiaoming Ni Reviewed-by: Kees Cook --- fs/proc/proc_sysctl.c | 2

Re: [PATCH v2 3/4] hung_task: Move hung_task sysctl interface to hung_task.c

2020-05-16 Thread Xiaoming Ni
On 2020/5/17 10:43, Kees Cook wrote: On Sat, May 16, 2020 at 04:55:14PM +0800, Xiaoming Ni wrote: +/* + * This is needed for proc_doulongvec_minmax of sysctl_hung_task_timeout_secs + * and hung_task_check_interval_secs + */ +static unsigned long hung_task_timeout_max = (LONG_MAX / HZ); Please

[PATCH v2 1/4] sysctl: Add register_sysctl_init() interface

2020-05-16 Thread Xiaoming Ni
In order to eliminate the duplicate code for registering the sysctl interface during the initialization of each feature, add the register_sysctl_init() interface Signed-off-by: Xiaoming Ni --- include/linux/sysctl.h | 2 ++ kernel/sysctl.c| 19 +++ 2 files changed, 21

[PATCH v2 0/4] cleaning up the sysctls table (hung_task watchdog)

2020-05-16 Thread Xiaoming Ni
. Extract multiple common variables instead of only neg_one, and keep the order of member values in sysctl_vals 4. Add const modification to the variable sixty in watchdog sysctl V1: https://lkml.org/lkml/2020/5/15/17 Xiaoming Ni (4): sysctl: Add register_sysctl_init() interface sysctl

[PATCH v2 3/4] hung_task: Move hung_task sysctl interface to hung_task.c

2020-05-16 Thread Xiaoming Ni
Move hung_task sysctl interface to hung_task.c. Use register_sysctl() to register the sysctl interface to avoid merge conflicts when different features modify sysctl.c at the same time. Signed-off-by: Xiaoming Ni --- include/linux/sched/sysctl.h | 8 +- kernel/hung_task.c | 63

[PATCH v2 4/4] watchdog: move watchdog sysctl interface to watchdog.c

2020-05-16 Thread Xiaoming Ni
Move watchdog syscl interface to watchdog.c. Use register_sysctl() to register the sysctl interface to avoid merge conflicts when different features modify sysctl.c at the same time. Signed-off-by: Xiaoming Ni --- kernel/sysctl.c | 96

[PATCH v2 2/4] sysctl: Move some boundary constants form sysctl.c to sysctl_vals

2020-05-16 Thread Xiaoming Ni
Some boundary (.extra1 .extra2) constants (E.g: neg_one two) in sysctl.c are used in multiple features. Move these variables to sysctl_vals to avoid adding duplicate variables when cleaning up sysctls table. Signed-off-by: Xiaoming Ni --- fs/proc/proc_sysctl.c | 2 +- include/linux/sysctl.h

Re: [PATCH 2/4] proc/sysctl: add shared variables -1

2020-05-15 Thread Xiaoming Ni
On 2020/5/16 10:47, Kees Cook wrote: On Sat, May 16, 2020 at 10:32:19AM +0800, Xiaoming Ni wrote: On 2020/5/16 0:05, Kees Cook wrote: On Fri, May 15, 2020 at 05:06:28PM +0800, Xiaoming Ni wrote: On 2020/5/15 16:06, Kees Cook wrote: On Fri, May 15, 2020 at 12:33:42PM +0800, Xiaoming Ni wrote

Re: [PATCH 2/4] proc/sysctl: add shared variables -1

2020-05-15 Thread Xiaoming Ni
On 2020/5/16 0:05, Kees Cook wrote: On Fri, May 15, 2020 at 05:06:28PM +0800, Xiaoming Ni wrote: On 2020/5/15 16:06, Kees Cook wrote: On Fri, May 15, 2020 at 12:33:42PM +0800, Xiaoming Ni wrote: Add the shared variable SYSCTL_NEG_ONE to replace the variable neg_one used in both

  1   2   >