[PATCH v3 07/11] drivers/android/binder: convert stats, transaction_log to counter_atomic32

2020-10-09 Thread Shuah Khan
an Brauner Signed-off-by: Shuah Khan --- drivers/android/binder.c | 41 --- drivers/android/binder_internal.h | 3 ++- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/drivers/android/binder.c b/drivers/android/binder.c index f936530a19b0..52

[PATCH v3 06/11] drivers/acpi/apei: convert seqno counter_atomic32

2020-10-09 Thread Shuah Khan
to tag the log messages and nothing more. Convert it to use counter_atomic32. This conversion doesn't change the overflow wrap around behavior. Acked-by: Rafael J. Wysocki Acked-by: Borislav Petkov Reviewed-by: Kees Cook Signed-off-by: Shuah Khan --- drivers/acpi/apei/ghes.c | 5 +++-- 1

[PATCH v3 00/11] Introduce Simple atomic counters

2020-10-09 Thread Shuah Khan
-- We discussed if binder counters can be non-atomic. For now I left them the same as the RFC patch - using counter_atomic32 -- Unrelated to this patch series: The patch series review uncovered improvements could be made to test_async_driver_probe and vmw_vmci/vmci_guest. I will track t

Re: KASAN: null-ptr-deref Write in event_handler

2020-10-09 Thread Shuah Khan
On 10/7/20 4:30 AM, Hillf Danton wrote: Mon, 05 Oct 2020 06:59:19 syzbot found the following issue on: HEAD commit:d3d45f82 Merge tag 'pinctrl-v5.9-2' of git://git.kernel.or.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=15781d8f90 kernel config:

Re: [PATCH v2 01/11] counters: Introduce counter_atomic* counters

2020-10-08 Thread Shuah Khan
On 10/7/20 3:04 AM, Greg KH wrote: On Tue, Oct 06, 2020 at 02:44:32PM -0600, Shuah Khan wrote: Introduce Simple atomic counters. There are a number of atomic_t usages in the kernel where atomic_t api is used strictly for counting and not for managing object lifetime. In some cases, atomic_t

Re: [PATCH v2 10/11] drivers/misc/vmw_vmci: convert num guest devices counter to counter_atomic32

2020-10-08 Thread Shuah Khan
On 10/7/20 12:27 PM, Kees Cook wrote: On Tue, Oct 06, 2020 at 02:44:41PM -0600, Shuah Khan wrote: counter_atomic* is introduced to be used when a variable is used as a simple counter and doesn't guard object lifetimes. This clearly differentiates atomic_t usages that guard object life

Re: [PATCH v2 04/11] drivers/base/devcoredump: convert devcd_count to counter_atomic32

2020-10-07 Thread Shuah Khan
On 10/7/20 1:38 PM, Johannes Berg wrote: On Wed, 2020-10-07 at 13:33 -0600, Shuah Khan wrote: On 10/7/20 12:15 PM, Kees Cook wrote: On Tue, Oct 06, 2020 at 02:44:35PM -0600, Shuah Khan wrote: counter_atomic* is introduced to be used when a variable is used as a simple counter and doesn&#

Re: [PATCH v2 04/11] drivers/base/devcoredump: convert devcd_count to counter_atomic32

2020-10-07 Thread Shuah Khan
On 10/7/20 12:15 PM, Kees Cook wrote: On Tue, Oct 06, 2020 at 02:44:35PM -0600, Shuah Khan wrote: counter_atomic* is introduced to be used when a variable is used as a simple counter and doesn't guard object lifetimes. This clearly differentiates atomic_t usages that guard object life

Re: [PATCH v2 01/11] counters: Introduce counter_atomic* counters

2020-10-07 Thread Shuah Khan
On 10/7/20 12:11 PM, Kees Cook wrote: On Tue, Oct 06, 2020 at 02:44:32PM -0600, Shuah Khan wrote: Introduce Simple atomic counters. There are a number of atomic_t usages in the kernel where atomic_t api is used strictly for counting and not for managing object lifetime. In some cases, atomic_t

Re: KASAN: null-ptr-deref Write in event_handler

2020-10-07 Thread Shuah Khan
On 10/7/20 8:28 AM, Andrey Konovalov wrote: On Wed, Oct 7, 2020 at 3:56 PM Shuah Khan wrote: On 10/5/20 2:44 PM, Shuah Khan wrote: On 10/5/20 8:04 AM, Andrey Konovalov wrote: On Mon, Oct 5, 2020 at 3:59 PM syzbot wrote: Hello, syzbot found the following issue on: HEAD commit

Re: KASAN: null-ptr-deref Write in event_handler

2020-10-07 Thread Shuah Khan
On 10/5/20 2:44 PM, Shuah Khan wrote: On 10/5/20 8:04 AM, Andrey Konovalov wrote: On Mon, Oct 5, 2020 at 3:59 PM syzbot wrote: Hello, syzbot found the following issue on: HEAD commit:    d3d45f82 Merge tag 'pinctrl-v5.9-2' of git://git.kernel.or.. git tree:   upstream cons

[PATCH v2] usbip: vhci_hcd: fix calling usb_hcd_giveback_urb() with irqs enabled

2020-10-06 Thread Shuah Khan
ed to xmit the urb and can give it back. This path runs in task context. Disable irqs around usb_hcd_giveback_urb() call. Reported-by: Andrey Konovalov Suggested-by: Alan Stern Signed-off-by: Shuah Khan --- Changes in v2: Changelog updated with correct information. drivers/usb/usbip/vhci

Re: [PATCH] usbip: vhci_hcd: fix calling usb_hcd_giveback_urb() with irqs enabled

2020-10-06 Thread Shuah Khan
On 10/6/20 4:16 PM, Andrey Konovalov wrote: On Tue, Oct 6, 2020 at 11:51 PM Shuah Khan wrote: Fix the following warning from kcov regarding usb_hcd_giveback_urb() call being made without disabling interrupts. Hi Shuah, This won't fix the kcov warning, as it still requires its ow

[PATCH] usbip: vhci_hcd: fix calling usb_hcd_giveback_urb() with irqs enabled

2020-10-06 Thread Shuah Khan
el/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 Dumping ftrace buffer: (ftrace buffer empty) Kernel Offset: disabled Rebooting in 1 seconds.. Reported-by: Andrey Konovalov Suggested-by: Alan Stern Signed-off-by: Shuah Khan --- drivers/usb/usbip/vhci_hcd.c | 8 +++- 1

[PATCH v2 05/11] drivers/acpi: convert seqno counter_atomic32

2020-10-06 Thread Shuah Khan
ag the log messages and nothing more. Convert it to use counter_atomic32. This conversion doesn't change the overflow wrap around behavior. Acked-by: Rafael J. Wysocki Signed-off-by: Shuah Khan --- drivers/acpi/acpi_extlog.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-

[PATCH v2 10/11] drivers/misc/vmw_vmci: convert num guest devices counter to counter_atomic32

2020-10-06 Thread Shuah Khan
se. Convert it to use counter_atomic32. This conversion doesn't change the overflow wrap around behavior. Reviewed-by: Greg Kroah-Hartman Signed-off-by: Shuah Khan --- drivers/misc/vmw_vmci/vmci_guest.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/d

[PATCH v2 08/11] drivers/base/test/test_async_driver_probe: convert to use counter_atomic32

2020-10-06 Thread Shuah Khan
ow to hold them to upper bounds. Overflow and wrap around doesn't impact errors, and warns. Convert them to use counter_atomic32. This conversion doesn't change the overflow wrap around behavior. Reviewed-by: Greg Kroah-Hartman Signed-off-by: Shuah Khan --- drivers/base/test/test_async

[PATCH v2 06/11] drivers/acpi/apei: convert seqno counter_atomic32

2020-10-06 Thread Shuah Khan
ag the log messages and nothing more. Convert it to use counter_atomic32. This conversion doesn't change the overflow wrap around behavior. Acked-by: Rafael J. Wysocki Acked-by: Borislav Petkov Signed-off-by: Shuah Khan --- drivers/acpi/apei/ghes.c | 5 +++-- 1 file changed, 3 i

[PATCH v2 11/11] drivers/edac: convert pci counters to counter_atomic32

2020-10-06 Thread Shuah Khan
o the conversion. Acked-by: Borislav Petkov Signed-off-by: Shuah Khan --- drivers/edac/edac_pci.h | 5 +++-- drivers/edac/edac_pci_sysfs.c | 28 ++-- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/drivers/edac/edac_pci.h b/drivers/edac/edac_pci.h

[PATCH v2 07/11] drivers/android/binder: convert stats, transaction_log to counter_atomic32

2020-10-06 Thread Shuah Khan
keep track of the current log entry location. Overflow is handled in the code. Since it is used as a counter, convert it to use counter_atomic32. This conversion doesn't change the overflow wrap around behavior. Reviewed-by: Joel Fernandes (Google) Signed-off-by: Shuah Khan --- drivers/androi

[PATCH v2 04/11] drivers/base/devcoredump: convert devcd_count to counter_atomic32

2020-10-06 Thread Shuah Khan
chance of this counter overflowing. Convert it to use counter_atomic32. This conversion doesn't change the overflow wrap around behavior. Reviewed-by: Greg Kroah-Hartman Signed-off-by: Shuah Khan --- drivers/base/devcoredump.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff

[PATCH v2 03/11] drivers/base: convert deferred_trigger_count and probe_count to counter_atomic32

2020-10-06 Thread Shuah Khan
lowing. This counter controls the wait for known devices to complete their probing, and probe_count == 0 ends the wait. Other than that it meets the other criteria to be converted. Convert it to use counter_atomic32. Reviewed-by: Greg Kroah-Hartman Signed-off-by: Shuah Khan --- dr

[PATCH v2 09/11] drivers/char/ipmi: convert stats to use counter_atomic32

2020-10-06 Thread Shuah Khan
igned-off-by: Shuah Khan --- drivers/char/ipmi/ipmi_msghandler.c | 9 + drivers/char/ipmi/ipmi_si_intf.c| 9 + 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c index 737c0b6b24ea..36c0b1b

[PATCH v2 02/11] selftests:lib:test_counters: add new test for counters

2020-10-06 Thread Shuah Khan
guard resource lifetimes, device usage and open counts that control state changes, and pm states. Using counter_atomic* to guard lifetimes could lead to use-after free when it overflows and undefined behavior when used to manage state changes and device usage/open states. Signed-off-by: Shuah

[PATCH v2 01/11] counters: Introduce counter_atomic* counters

2020-10-06 Thread Shuah Khan
times could lead to use-after free when it overflows and undefined behavior when used to manage state changes and device usage/open states. Reviewed-by: Greg Kroah-Hartman Signed-off-by: Shuah Khan --- Documentation/core-api/counters.rst | 103 + MAINTAINERS

[PATCH v2 00/11] Introduce Simple atomic counters

2020-10-06 Thread Shuah Khan
patch series review uncovered improvements could be made to test_async_driver_probe and vmw_vmci/vmci_guest. I will track these for fixing later. Shuah Khan (11): counters: Introduce counter_atomic* counters selftests:lib:test_counters: add new test for counters drivers/base: convert deferred_tr

Re: linux-next: manual merge of the akpm tree with the kselftest-fixes tree

2020-10-06 Thread Shuah Khan
On 10/6/20 5:07 AM, Stephen Rothwell wrote: Hi all, Today's linux-next merge of the akpm tree got a conflict in: tools/testing/selftests/vm/gup_test.c between commit: aa803771a80a ("tools: Avoid comma separated statements") from the kselftest-fixes tree and commit: 5c64830675a6 ("m

Re: [PATCH 00/11] Introduce Simple atomic and non-atomic counters

2020-10-06 Thread Shuah Khan
On 9/28/20 5:13 PM, Kees Cook wrote: On Mon, Sep 28, 2020 at 04:41:47PM -0600, Shuah Khan wrote: On 9/26/20 10:29 AM, Kees Cook wrote: On Fri, Sep 25, 2020 at 05:47:14PM -0600, Shuah Khan wrote: 7. Verified that the test module compiles in kunit env. and test module can be loaded

Re: [PATCH 4.19 00/38] 4.19.150-rc1 review

2020-10-05 Thread Shuah Khan
/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.19.y and the diffstat can be found below. thanks, greg k-h Compiled and booted on my test system. No dmesg regressions. Tested-by: Shuah Khan thanks, -- Shuah

Re: [PATCH 5.4 00/57] 5.4.70-rc1 review

2020-10-05 Thread Shuah Khan
/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.4.y and the diffstat can be found below. thanks, greg k-h Compiled and booted on my test system. No dmesg regressions. Tested-by: Shuah Khan thanks, -- Shuah

Re: [PATCH 5.8 00/85] 5.8.14-rc1 review

2020-10-05 Thread Shuah Khan
/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.8.y and the diffstat can be found below. thanks, greg k-h Compiled and booted on my test system. No dmesg regressions. Tested-by: Shuah Khan thanks, -- Shuah

Re: Is usb_hcd_giveback_urb() allowed in task context?

2020-10-05 Thread Shuah Khan
On 10/5/20 9:25 AM, Alan Stern wrote: On Mon, Oct 05, 2020 at 05:21:30PM +0200, Andrey Konovalov wrote: On Mon, Oct 5, 2020 at 5:18 PM Greg Kroah-Hartman wrote: On Mon, Oct 05, 2020 at 05:08:11PM +0200, Andrey Konovalov wrote: Dear USB and USB/IP maintainers, While fuzzing the USB/IP stack

Re: KASAN: null-ptr-deref Write in event_handler

2020-10-05 Thread Shuah Khan
On 10/5/20 8:04 AM, Andrey Konovalov wrote: On Mon, Oct 5, 2020 at 3:59 PM syzbot wrote: Hello, syzbot found the following issue on: HEAD commit:d3d45f82 Merge tag 'pinctrl-v5.9-2' of git://git.kernel.or.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x

Re: drivers/block/rbd.c: atomic_inc_return_safe() & atomic_dec_return_safe()

2020-10-02 Thread Shuah Khan
On 10/2/20 5:44 PM, Jens Axboe wrote: On 10/2/20 4:34 PM, Shuah Khan wrote: All, I came across these atomic_inc_return_safe() & atomic_dec_return_safe() functions that hold the counters at safe values. atomic_inc_return_safe() If the counter is already 0 it will not be incremented. If

drivers/block/rbd.c: atomic_inc_return_safe() & atomic_dec_return_safe()

2020-10-02 Thread Shuah Khan
All, I came across these atomic_inc_return_safe() & atomic_dec_return_safe() functions that hold the counters at safe values. atomic_inc_return_safe() If the counter is already 0 it will not be incremented. If the counter is already at its maximum value returns -EINVAL without updating it. ato

drivers/char/ppdev -

2020-10-02 Thread Shuah Khan
Hi Sudip, While looking at atomic_t usages and noticed a few potential problem the way struct pp_struct: atomic_t irqc field - There is inconsistencies the lock hold in this driver. pp_do_mutex is help before pp_do_ioctl() is called. static int pp_do_ioctl() pp_do_mutex case PPCLRI

Re: [PATCH v2] cpupower: Provide online and offline CPU information

2020-10-02 Thread Shuah Khan
On 9/29/20 7:11 AM, Brahadambal Srinivasan wrote: When a user tries to modify cpuidle or cpufreq properties on offline CPUs, the tool returns success (exit status 0) but also does not provide any warning message regarding offline cpus that may have been specified but left unchanged. In case of al

Re: [PATCH 00/18] use semicolons rather than commas to separate statements

2020-10-02 Thread Shuah Khan
On 9/29/20 7:42 AM, Shuah Khan wrote: On 9/29/20 7:34 AM, Joe Perches wrote: On Tue, 2020-09-29 at 14:47 +0200, Julia Lawall wrote: On Tue, 29 Sep 2020, Dan Carpenter wrote: The times where commas are used deliberately to replace curly braces are just evil.  Either way the code is cleaner

Re: [PATCH 4.4 00/85] 4.4.238-rc1 review

2020-09-30 Thread Shuah Khan
/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.4.y and the diffstat can be found below. thanks, greg k-h Compiled and booted on my test system. No dmesg regressions. Tested-by: Shuah Khan thanks, -- Shuah

Re: [PATCH 4.9 000/121] 4.9.238-rc1 review

2020-09-30 Thread Shuah Khan
/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.9.y and the diffstat can be found below. thanks, greg k-h Compiled and booted on my test system. No dmesg regressions. Tested-by: Shuah Khan thanks, -- Shuah

Re: [PATCH 4.14 000/166] 4.14.200-rc1 review

2020-09-30 Thread Shuah Khan
/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.14.y and the diffstat can be found below. thanks, greg k-h Compiled and booted on my test system. No dmesg regressions. Tested-by: Shuah Khan thanks, -- Shuah

Re: [PATCH 4.19 000/244] 4.19.149-rc2 review

2020-09-30 Thread Shuah Khan
/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.19.y and the diffstat can be found below. thanks, greg k-h Compiled and booted on my test system. No dmesg regressions. Tested-by: Shuah Khan thanks, -- Shuah

Re: [PATCH 5.4 000/388] 5.4.69-rc1 review

2020-09-30 Thread Shuah Khan
/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.4.y and the diffstat can be found below. thanks, greg k-h Compiled and booted on my test system. No dmesg regressions. Tested-by: Shuah Khan thanks, -- Shuah

Re: [PATCH 5.8 00/99] 5.8.13-rc1 review

2020-09-30 Thread Shuah Khan
/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.8.y and the diffstat can be found below. thanks, greg k-h Compiled and booted on my test system. No dmesg regressions. Tested-by: Shuah Khan thanks, -- Shuah

Re: [PATCH 2/8] selftests/vm: use a common gup_test.h

2020-09-29 Thread Shuah Khan
On 9/29/20 2:11 PM, John Hubbard wrote: On 9/29/20 1:00 PM, Shuah Khan wrote: On 9/29/20 1:53 PM, Jason Gunthorpe wrote: I only remarked because I didn't know it wasn't using kbuild. I thought it would have used the existing HOSTCC stuff, not sure why it is special. The only inves

Re: [PATCH 2/8] selftests/vm: use a common gup_test.h

2020-09-29 Thread Shuah Khan
On 9/29/20 1:53 PM, Jason Gunthorpe wrote: On Tue, Sep 29, 2020 at 12:48:43PM -0700, John Hubbard wrote: On 9/29/20 12:08 PM, Jason Gunthorpe wrote: On Tue, Sep 29, 2020 at 11:59:55AM -0700, John Hubbard wrote: On 9/29/20 10:55 AM, Jason Gunthorpe wrote: On Tue, Sep 29, 2020 at 10:44:31AM -07

Re: [PATCH 00/18] use semicolons rather than commas to separate statements

2020-09-29 Thread Shuah Khan
On 9/29/20 7:34 AM, Joe Perches wrote: On Tue, 2020-09-29 at 14:47 +0200, Julia Lawall wrote: On Tue, 29 Sep 2020, Dan Carpenter wrote: The times where commas are used deliberately to replace curly braces are just evil. Either way the code is cleaner with semi-colons. I also found exaamples

Re: [PATCH 00/11] Introduce Simple atomic and non-atomic counters

2020-09-28 Thread Shuah Khan
On 9/26/20 10:33 AM, Kees Cook wrote: On Fri, Sep 25, 2020 at 06:13:37PM -0600, Shuah Khan wrote: On 9/25/20 5:52 PM, Kees Cook wrote: On Fri, Sep 25, 2020 at 05:47:14PM -0600, Shuah Khan wrote: -- Addressed Kees's comments: 1. Non-atomic counters renamed to counter_simple3

Re: [PATCH 00/11] Introduce Simple atomic and non-atomic counters

2020-09-28 Thread Shuah Khan
On 9/28/20 3:17 PM, Joel Fernandes wrote: On Mon, Sep 28, 2020 at 01:34:31PM -0700, Kees Cook wrote: On Sun, Sep 27, 2020 at 07:35:26PM -0400, Joel Fernandes wrote: On Fri, Sep 25, 2020 at 05:47:14PM -0600, Shuah Khan wrote: This patch series is a result of discussion at the refcount_t BOF

Re: [PATCH 00/11] Introduce Simple atomic and non-atomic counters

2020-09-28 Thread Shuah Khan
On 9/26/20 10:29 AM, Kees Cook wrote: On Fri, Sep 25, 2020 at 05:47:14PM -0600, Shuah Khan wrote: 7. Verified that the test module compiles in kunit env. and test module can be loaded to run the test. I meant write it using KUnit interfaces (e.g. KUNIT_EXPECT*(), kunit_test_suite

Re: [PATCH 00/11] Introduce Simple atomic and non-atomic counters

2020-09-28 Thread Shuah Khan
On 9/26/20 10:22 AM, Kees Cook wrote: On Fri, Sep 25, 2020 at 05:47:14PM -0600, Shuah Khan wrote: This patch series is a result of discussion at the refcount_t BOF the Linux Plumbers Conference. In this discussion, we identified a need for looking closely and investigating atomic_t usages in

Re: [PATCH 09/11] drivers/char/ipmi: convert stats to use counter_atomic32

2020-09-25 Thread Shuah Khan
On 9/25/20 6:15 PM, Corey Minyard wrote: On Fri, Sep 25, 2020 at 05:47:23PM -0600, Shuah Khan wrote: counter_atomic* is introduced to be used when a variable is used as a simple counter and doesn't guard object lifetimes. This clearly differentiates atomic_t usages that guard object life

Re: [PATCH 00/11] Introduce Simple atomic and non-atomic counters

2020-09-25 Thread Shuah Khan
On 9/25/20 5:52 PM, Kees Cook wrote: On Fri, Sep 25, 2020 at 05:47:14PM -0600, Shuah Khan wrote: -- Addressed Kees's comments: 1. Non-atomic counters renamed to counter_simple32 and counter_simple64 to clearly indicate size. 2. Added warning for counter_simple* usage a

[PATCH 06/11] drivers/acpi/apei: convert seqno counter_atomic32

2020-09-25 Thread Shuah Khan
ag the log messages and nothing more. Convert it to use counter_atomic32. This conversion doesn't change the overflow wrap around behavior. Acked-by: Rafael J. Wysocki Signed-off-by: Shuah Khan --- drivers/acpi/apei/ghes.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff

[PATCH 11/11] drivers/edac: convert pci counters to counter_atomic32

2020-09-25 Thread Shuah Khan
o the conversion. Signed-off-by: Shuah Khan --- drivers/edac/edac_pci.h | 5 +++-- drivers/edac/edac_pci_sysfs.c | 28 ++-- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/drivers/edac/edac_pci.h b/drivers/edac/edac_pci.h index 5175f5724cfa..797b25a6afc0 1

[PATCH 09/11] drivers/char/ipmi: convert stats to use counter_atomic32

2020-09-25 Thread Shuah Khan
guard resource lifetimes, device usage and open counts that control state changes, and pm states. atomic_t variables used for stats are atomic counters. Overflow will wrap around and reset the stats and no change with the conversion. Convert them to use counter_atomic32. Signed-off-by: Shuah

[PATCH 10/11] drivers/misc/vmw_vmci: convert num guest devices counter to counter_atomic32

2020-09-25 Thread Shuah Khan
se. Convert it to use counter_atomic32. This conversion doesn't change the overflow wrap around behavior. Reviewed-by: Greg Kroah-Hartman Signed-off-by: Shuah Khan --- drivers/misc/vmw_vmci/vmci_guest.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/d

[PATCH 07/11] drivers/android/binder: convert stats, transaction_log to counter_atomic32

2020-09-25 Thread Shuah Khan
keep track of the current log entry location. Overflow is handled in the code. Since it is used as a counter, convert it to use counter_atomic32. This conversion doesn't change the overflow wrap around behavior. Signed-off-by: Shuah Khan --- drivers/android/binder.c

[PATCH 05/11] drivers/acpi: convert seqno counter_atomic32

2020-09-25 Thread Shuah Khan
ag the log messages and nothing more. Convert it to use counter_atomic32. This conversion doesn't change the overflow wrap around behavior. Acked-by: Rafael J. Wysocki Signed-off-by: Shuah Khan --- drivers/acpi/acpi_extlog.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-

[PATCH 08/11] drivers/base/test/test_async_driver_probe: convert to use counter_atomic32

2020-09-25 Thread Shuah Khan
ow to hold them to upper bounds. Overflow and wrap around doesn't impact errors, and warns. Convert them to use counter_atomic32. This conversion doesn't change the overflow wrap around behavior. Reviewed-by: Greg Kroah-Hartman Signed-off-by: Shuah Khan --- drivers/base/test/test_async

[PATCH 04/11] drivers/base/devcoredump: convert devcd_count to counter_atomic32

2020-09-25 Thread Shuah Khan
chance of this counter overflowing. Convert it to use counter_atomic32. This conversion doesn't change the overflow wrap around behavior. Reviewed-by: Greg Kroah-Hartman Signed-off-by: Shuah Khan --- drivers/base/devcoredump.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff

[PATCH 03/11] drivers/base: convert deferred_trigger_count and probe_count to counter_atomic32

2020-09-25 Thread Shuah Khan
lowing. This counter controls the wait for known devices to complete their probing, and probe_count == 0 ends the wait. Other than that it meets the other criteria to be converted. Convert it to use counter_atomic32. Reviewed-by: Greg Kroah-Hartman Signed-off-by: Shuah Khan --- dr

[PATCH 02/11] selftests:lib:test_counters: add new test for counters

2020-09-25 Thread Shuah Khan
free when it overflows and undefined behavior when used to manage state changes and device usage/open states. Signed-off-by: Shuah Khan --- MAINTAINERS | 1 + tools/testing/selftests/lib/Makefile | 1 + tools/testing/selftests/lib/config |

[PATCH 00/11] Introduce Simple atomic and non-atomic counters

2020-09-25 Thread Shuah Khan
driver_probe and vmw_vmci/vmci_guest. I will track these for fixing later. Shuah Khan (11): counters: Introduce counter_simple* and counter_atomic* counters selftests:lib:test_counters: add new test for counters drivers/base: convert deferred_trigger_count and probe_count to counter_atomic32

[PATCH 01/11] counters: Introduce counter_simple* and counter_atomic* counters

2020-09-25 Thread Shuah Khan
an Signed-off-by: Shuah Khan --- Documentation/core-api/counters.rst | 174 ++ MAINTAINERS | 7 + include/linux/counters.h| 350 lib/Kconfig | 10 + lib/Makefile|

Re: [PATCHv5 kselftest next] selftests/run_kselftest.sh: make each test individually selectable

2020-09-25 Thread Shuah Khan
On 9/25/20 3:16 PM, Kees Cook wrote: On Fri, Sep 25, 2020 at 01:51:53PM +0530, Naresh Kamboju wrote: On Mon, 14 Sep 2020 at 07:53, Hangbin Liu wrote: Currently, after generating run_kselftest.sh, there is no way to choose which test we could run. All the tests are listed together and we have

Re: [PATCHv5 kselftest next] selftests/run_kselftest.sh: make each test individually selectable

2020-09-25 Thread Shuah Khan
On 9/25/20 3:16 PM, Kees Cook wrote: On Fri, Sep 25, 2020 at 01:51:53PM +0530, Naresh Kamboju wrote: On Mon, 14 Sep 2020 at 07:53, Hangbin Liu wrote: Currently, after generating run_kselftest.sh, there is no way to choose which test we could run. All the tests are listed together and we have

Re: [PATCH 5.4 00/43] 5.4.68-rc1 review

2020-09-25 Thread Shuah Khan
/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.4.y and the diffstat can be found below. thanks, greg k-h Compiled and booted on my test system. No dmesg regressions. Tested-by: Shuah Khan thanks, -- Shuah

Re: [PATCH 5.8 00/56] 5.8.12-rc1 review

2020-09-25 Thread Shuah Khan
/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.8.y and the diffstat can be found below. thanks, greg k-h Compiled and booted on my test system. No dmesg regressions. Tested-by: Shuah Khan thanks, -- Shuah

Re: [PATCH 4.19 00/37] 4.19.148-rc1 review

2020-09-25 Thread Shuah Khan
/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.19.y and the diffstat can be found below. thanks, greg k-h Compiled and booted on my test system. No dmesg regressions. Tested-by: Shuah Khan thanks, -- Shuah

Re: [Linux-kernel-mentees] Help wanted in LED subsystem

2020-09-25 Thread Shuah Khan
Hi Pavel, On 9/25/20 4:47 AM, Pavel Machek wrote: Hi! In linux-next, I published TODO list for LED subsystem. Is that something linux-kernel-mentees could help with? Best regards, Pavel Thanks for putting this list together. Will you b

Re: [RFC PATCH 05/11] drivers/acpi: convert seqno counter_atomic

2020-09-24 Thread Shuah Khan
On 9/24/20 5:13 AM, Rafael J. Wysocki wrote: On Wed, Sep 23, 2020 at 3:44 AM Shuah Khan wrote: counter_atomic is introduced to be used when a variable is used as a simple counter and doesn't guard object lifetimes. This clearly differentiates atomic_t usages that guard object life

Re: [PATCH v1] kunit: tool: fix --alltests flag

2020-09-23 Thread Shuah Khan
On 9/23/20 3:19 PM, Brendan Higgins wrote: Alltests flag evidently stopped working when run from outside of the root of the source tree, so fix that. Also add an additional broken config to the broken_on_uml config. Signed-off-by: Brendan Higgins --- tools/testing/kunit/configs/broken_on_uml.

Re: [RFC PATCH 01/11] counters: Introduce counter and counter_atomic

2020-09-23 Thread Shuah Khan
On 9/23/20 2:58 PM, Kees Cook wrote: On Wed, Sep 23, 2020 at 02:48:22PM -0600, Shuah Khan wrote: On 9/23/20 1:04 PM, Kees Cook wrote: On Tue, Sep 22, 2020 at 07:43:30PM -0600, Shuah Khan wrote: I would really like these APIs to be _impossible_ to use for object lifetime management. To that end

Re: [RFC PATCH 01/11] counters: Introduce counter and counter_atomic

2020-09-23 Thread Shuah Khan
On 9/23/20 1:04 PM, Kees Cook wrote: On Tue, Sep 22, 2020 at 07:43:30PM -0600, Shuah Khan wrote: Introduce Simple atomic and non-atomic counters. There are a number of atomic_t usages in the kernel where atomic_t api is used strictly for counting and not for managing object lifetime. In some

Re: drivers/misc/habanalabs: atomic_t api usage inconsistencies

2020-09-23 Thread Shuah Khan
On 9/23/20 2:41 AM, Oded Gabbay wrote: On Tue, Sep 22, 2020 at 1:08 AM Shuah Khan wrote: All, While I was looking at the atomic_t api usages for an unrelated issue, I noticed free_slots_cnt in struct hl_cq incerment/decrement/reads are not consistent. atomic_inc() and atomic_set() are used

[RFC PATCH 11/11] drivers/edac: convert pci counters to counter_atomic

2020-09-22 Thread Shuah Khan
guard resource lifetimes, device usage and open counts that control state changes, and pm states. atomic_t variables used for pci counters keep track of pci parity and non-parity errors. Overflow will wrap around and reset the counts as was the case prior to the conversion. Signed-off-by: Shuah

[RFC PATCH 09/11] drivers/char/ipmi: convert stats to use counter_atomic

2020-09-22 Thread Shuah Khan
guard resource lifetimes, device usage and open counts that control state changes, and pm states. atomic_t variables used for stats are atomic counters. Overflow will wrap around and reset the stats and no change with the conversion. Convert them to use counter_atomic. Signed-off-by: Shuah Khan --- dr

[RFC PATCH 04/11] drivers/base/devcoredump: convert devcd_count to counter_atomic

2020-09-22 Thread Shuah Khan
ce of this counter overflowing. Convert it to use counter_atomic. This conversion doesn't change the oveflow wrap around behavior. Signed-off-by: Shuah Khan --- drivers/base/devcoredump.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/base/devcoredump.c

[RFC PATCH 02/11] selftests:lib: add new test for counters

2020-09-22 Thread Shuah Khan
ee when it overflows and undefined behavior when used to manage state changes and device usage/open states. Signed-off-by: Shuah Khan --- MAINTAINERS | 1 + tools/testing/selftests/lib/Makefile | 1 + tools/testing/selftests/lib/config | 1 + too

[RFC PATCH 07/11] drivers/android/binder: convert stats, transaction_log to counter_atomic

2020-09-22 Thread Shuah Khan
track of the current log entry location. Overflow is handled in the code. Since it is used as a counter, convert it to use counter_atomic. This conversion doesn't change the oveflow wrap around behavior. Signed-off-by: Shuah Khan --- drivers/android/binder.c

[RFC PATCH 05/11] drivers/acpi: convert seqno counter_atomic

2020-09-22 Thread Shuah Khan
ag the log messages and nothing more. Convert it to use counter_atomic. This conversion doesn't change the oveflow wrap around behavior. Signed-off-by: Shuah Khan --- drivers/acpi/acpi_extlog.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/acpi_ext

[RFC PATCH 10/11] drivers/misc/vmw_vmci: convert num guest devices counter to counter_atomic

2020-09-22 Thread Shuah Khan
se. Convert it to use counter_atomic. This conversion doesn't change the oveflow wrap around behavior. Signed-off-by: Shuah Khan --- drivers/misc/vmw_vmci/vmci_guest.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/misc/vmw_vmci/vmci_guest.c b/d

[RFC PATCH 01/11] counters: Introduce counter and counter_atomic

2020-09-22 Thread Shuah Khan
d resource lifetimes, device usage and open counts that control state changes, and pm states. Using counter_atomic to guard lifetimes could lead to use-after free when it overflows and undefined behavior when used to manage state changes and device usage/open states. Signed-off-by:

[RFC PATCH 03/11] drivers/base: convert deferred_trigger_count and probe_count to counter_atomic

2020-09-22 Thread Shuah Khan
lowing. This counter controls the wait for known devices to complete their probing, and probe_count == 0 ends the wait. Other than that it meets the other criteria to be converted. Convert it to use counter_atomic. Signed-off-by: Shuah Khan --- drivers/base/dd.c | 19 ++- 1 file ch

[RFC PATCH 06/11] drivers/acpi/apei: convert seqno counter_atomic

2020-09-22 Thread Shuah Khan
ag the log messages and nothing more. Convert it to use counter_atomic. This conversion doesn't change the oveflow wrap around behavior. Signed-off-by: Shuah Khan --- drivers/acpi/apei/ghes.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/apei/ghes.c

[RFC PATCH 08/11] drivers/base/test/test_async_driver_probe: convert to use counter_atomic

2020-09-22 Thread Shuah Khan
hold them to upper bounds. Overflow and wrap around doesn't impact errors, and warns. Convert them to use counter_atomic. This conversion doesn't change the oveflow wrap around behavior. Signed-off-by: Shuah Khan --- drivers/base/test/test_async_driver_probe.c | 23 --

[RFC PATCH 00/11] Introduce Simple atomic and non-atomic counters

2020-09-22 Thread Shuah Khan
device usage counts, device open counts, and pm states. 2. Variable is used for stats and counters. 3. The conversion doesn't change the overflow behavior. Please review and let me know if non-stat conversions e.g: probe_count, deferred_trigger_count make sense. Shuah Khan (11): counters: I

drivers/misc/habanalabs: atomic_t api usage inconsistencies

2020-09-21 Thread Shuah Khan
All, While I was looking at the atomic_t api usages for an unrelated issue, I noticed free_slots_cnt in struct hl_cq incerment/decrement/reads are not consistent. atomic_inc() and atomic_set() are used, however instead of atomic_read() the value is referenced directly in drivers/misc/habanalabs/

Re: [PATCH] selftests/harness: Flush stdout before forking

2020-09-18 Thread Shuah Khan
On 9/17/20 9:37 PM, Michael Ellerman wrote: Shuah Khan writes: On 9/16/20 10:53 PM, Max Filippov wrote: On Wed, Sep 16, 2020 at 9:16 PM Michael Ellerman wrote: The test harness forks() a child to run each test. Both the parent and the child print to stdout using libc functions. That can

bus/mhi/core: Double lock in mhi_device_put() and dev_wake inc/dec

2020-09-17 Thread Shuah Khan
While looking at this file for an unrelated issue, I happen to notice there is a double locking on mhi_cntrl->pm_lock in the mhi_device_put() when it gets called from mhi_driver_remove() The other two calls from mhi_driver_probe() don't hold the pm_lock. In addition, lock holding while dev_wake

Re: [PATCH] selftests/harness: Flush stdout before forking

2020-09-17 Thread Shuah Khan
On 9/17/20 6:58 AM, Shuah Khan wrote: On 9/16/20 10:53 PM, Max Filippov wrote: On Wed, Sep 16, 2020 at 9:16 PM Michael Ellerman wrote: The test harness forks() a child to run each test. Both the parent and the child print to stdout using libc functions. That can lead to duplicated (or more

Re: [PATCH 5.8 000/177] 5.8.10-rc1 review

2020-09-17 Thread Shuah Khan
On 9/17/20 8:46 AM, Greg Kroah-Hartman wrote: On Thu, Sep 17, 2020 at 08:34:58AM -0600, Shuah Khan wrote: On 9/16/20 11:25 AM, Greg Kroah-Hartman wrote: On Wed, Sep 16, 2020 at 09:34:52AM -0600, Shuah Khan wrote: On 9/16/20 9:26 AM, Greg Kroah-Hartman wrote: On Wed, Sep 16, 2020 at 08:26

Re: [PATCH 5.8 000/177] 5.8.10-rc1 review

2020-09-17 Thread Shuah Khan
On 9/16/20 11:25 AM, Greg Kroah-Hartman wrote: On Wed, Sep 16, 2020 at 09:34:52AM -0600, Shuah Khan wrote: On 9/16/20 9:26 AM, Greg Kroah-Hartman wrote: On Wed, Sep 16, 2020 at 08:26:48AM -0600, Shuah Khan wrote: On 9/16/20 12:29 AM, Greg Kroah-Hartman wrote: On Tue, Sep 15, 2020 at 08:54

Re: [PATCH] selftests/harness: Flush stdout before forking

2020-09-17 Thread Shuah Khan
On 9/16/20 10:53 PM, Max Filippov wrote: On Wed, Sep 16, 2020 at 9:16 PM Michael Ellerman wrote: The test harness forks() a child to run each test. Both the parent and the child print to stdout using libc functions. That can lead to duplicated (or more) output if the libc buffers are not flush

Re: [PATCH 5.8 000/177] 5.8.10-rc1 review

2020-09-16 Thread Shuah Khan
On 9/16/20 9:26 AM, Greg Kroah-Hartman wrote: On Wed, Sep 16, 2020 at 08:26:48AM -0600, Shuah Khan wrote: On 9/16/20 12:29 AM, Greg Kroah-Hartman wrote: On Tue, Sep 15, 2020 at 08:54:24PM -0600, Shuah Khan wrote: On 9/15/20 3:06 PM, Shuah Khan wrote: On 9/15/20 8:11 AM, Greg Kroah-Hartman

Re: [PATCH 5.8 000/177] 5.8.10-rc1 review

2020-09-16 Thread Shuah Khan
On 9/16/20 12:29 AM, Greg Kroah-Hartman wrote: On Tue, Sep 15, 2020 at 08:54:24PM -0600, Shuah Khan wrote: On 9/15/20 3:06 PM, Shuah Khan wrote: On 9/15/20 8:11 AM, Greg Kroah-Hartman wrote: This is the start of the stable review cycle for the 5.8.10 release. There are 177 patches in this

Re: [PATCH 5.8 000/177] 5.8.10-rc1 review

2020-09-15 Thread Shuah Khan
On 9/15/20 3:06 PM, Shuah Khan wrote: On 9/15/20 8:11 AM, Greg Kroah-Hartman wrote: This is the start of the stable review cycle for the 5.8.10 release. There are 177 patches in this series, all will be posted as a response to this one.  If anyone has any issues with these being applied, please

Re: [PATCH 4.19 00/78] 4.19.146-rc1 review

2020-09-15 Thread Shuah Khan
/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.19.y and the diffstat can be found below. thanks, greg k-h Compiled and booted on my test system. No dmesg regressions. Tested-by: Shuah Khan thanks, -- Shuah

Re: [PATCH 5.4 000/130] 5.4.66-rc2 review

2020-09-15 Thread Shuah Khan
/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.4.y and the diffstat can be found below. thanks, greg k-h Compiled and booted on my test system. No dmesg regressions. Tested-by: Shuah Khan thanks, -- Shuah

<    1   2   3   4   5   6   7   8   9   10   >