Re: [PATCH] ACPI: OSI: refactor deprecated strncpy

2023-09-21 Thread Rafael J. Wysocki
On Fri, Sep 15, 2023 at 5:16 AM Kees Cook wrote: > > On Mon, Sep 11, 2023 at 08:36:44PM +, Justin Stitt wrote: > > `strncpy` is deprecated for use on NUL-terminated destination strings [1]. > > > > We know `osi->string` is a NUL-terminated string due to its eventual use > > in `acpi_install_in

Re: [PATCH] ACPI: PRM: Annotate struct prm_module_info with __counted_by

2023-10-03 Thread Rafael J. Wysocki
> https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci > > > > Cc: "Rafael J. Wysocki" > > Cc: Len Brown > > Cc: linux-a...@vger.kernel.org > > Signed-off-by: Kees Cook > > Reviewed-by: Gustavo A. R. Silva Appli

Re: [PATCH] ACPI: replace deprecated strncpy with strscpy

2023-10-20 Thread Rafael J. Wysocki
On Fri, Oct 20, 2023 at 1:06 AM Kees Cook wrote: > > On Thu, Oct 19, 2023 at 10:47:58PM +, Justin Stitt wrote: > > strncpy() is deprecated for use on NUL-terminated destination strings > > [1] and as such we should prefer more robust and less ambiguous string > > interfaces. > > > > We know de

Re: [PATCH] PNP: replace deprecated strncpy with memcpy

2023-10-20 Thread Rafael J. Wysocki
On Fri, Oct 20, 2023 at 2:31 AM Kees Cook wrote: > > On Thu, Oct 19, 2023 at 11:28:32PM +, Justin Stitt wrote: > > strncpy() is deprecated for use on NUL-terminated destination strings > > [1] and as such we should prefer more robust and less ambiguous > > interfaces. > > > > After having prec

Re: [PATCH V2] ACPI: APEI: Use ERST timeout for slow devices

2023-10-24 Thread Rafael J. Wysocki
On Mon, Oct 23, 2023 at 5:45 PM Jeshua Smith wrote: > > Can we get this merged please, or at least instructions for what needs to > happen to get it merged? So there are 3 designated reviewers for APEI: Tony Luck, Borislav Petkov and James Morse. I need an ACK or Reviewed-by from one of them, s

Re: [PATCH V2] ACPI: APEI: Use ERST timeout for slow devices

2023-10-24 Thread Rafael J. Wysocki
On Tue, Oct 24, 2023 at 5:27 PM Tony Luck wrote: > > On Wed, Jul 12, 2023 at 10:34:48PM +, Jeshua Smith wrote: > > Slow devices such as flash may not meet the default 1ms timeout value, > > so use the ERST max execution time value that they provide as the > > timeout if it is larger. > > > > S

Re: [PATCH 03/30] ACPI: IORT: Make a iort_iommu_for_each_id()

2023-11-30 Thread Rafael J. Wysocki
gt; Signed-off-by: Jason Gunthorpe Acked-by: Rafael J. Wysocki > --- > drivers/acpi/arm64/iort.c | 118 -- > include/linux/acpi_iort.h | 12 > 2 files changed, 86 insertions(+), 44 deletions(-) > > diff --git a/drivers/acpi/arm64/

Re: [PATCH 02/30] ACPI: VIOT: Make a viot_iommu_for_each_id()

2023-11-30 Thread Rafael J. Wysocki
gt; Signed-off-by: Jason Gunthorpe Acked-by: Rafael J. Wysocki > --- > drivers/acpi/viot.c | 54 +++ > include/linux/acpi_viot.h | 11 > 2 files changed, 43 insertions(+), 22 deletions(-) > > diff --git a/drivers/acpi/viot.c b/

Re: [PATCH 04/30] ACPI: IORT: Remove fwspec from the reserved region code

2023-11-30 Thread Rafael J. Wysocki
gt; Signed-off-by: Jason Gunthorpe Acked-by: Rafael J. Wysocki > --- > drivers/acpi/arm64/iort.c | 88 --- > drivers/iommu/dma-iommu.c | 7 +++- > include/linux/acpi_iort.h | 8 +++- > 3 files changed, 65 insertions(+), 38 deletions(-) >

Re: [PATCH] PM / QOS: Use kcalloc() instead of kzalloc()

2024-01-09 Thread Rafael J. Wysocki
On Fri, Jan 5, 2024 at 7:17 PM Gustavo A. R. Silva wrote: > > > > On 1/5/24 12:11, Erick Archer wrote: > > Use 2-factor multiplication argument form kcalloc() instead > > of kzalloc(). > > > > Link: https://github.com/KSPP/linux/issues/162 > > Signed-off-by: Erick Archer > > Reviewed-by: Gustavo

Re: [PATCH 35/82] ACPI: custom_method: Refactor intentional wrap-around test

2024-01-24 Thread Rafael J. Wysocki
This paves the way to enabling the wrap-around sanitizers in the future. > > Link: https://git.kernel.org/linus/68df3755e383e6fecf2354a67b08f92f18536594 > [1] > Link: https://github.com/KSPP/linux/issues/26 [2] > Link: https://github.com/KSPP/linux/issues/27 [3] > Link: https://git

Re: [PATCH] PM: hibernate: Don't ignore return from set_memory_ro()

2024-02-22 Thread Rafael J. Wysocki
On Sun, Feb 18, 2024 at 10:07 AM Kees Cook wrote: > > On Sun, Feb 18, 2024 at 09:40:58AM +0100, Christophe Leroy wrote: > > set_memory_ro() and set_memory_rw() can fail, leaving memory > > unprotected. > > > > Take the returned value into account and abort in case of > > failure. > > > > Signed-of

Re: [PATCH] thermal: core: Move initial num_trips assignment before memcpy()

2024-02-27 Thread Rafael J. Wysocki
On Tue, Feb 27, 2024 at 3:08 AM Kees Cook wrote: > > On Mon, Feb 26, 2024 at 05:54:58PM -0700, Nathan Chancellor wrote: > > When booting a CONFIG_FORTIFY_SOURCE=y kernel compiled with a toolchain > > that supports __counted_by() (such as clang-18 and newer), there is a > > panic on boot: > > > >

Re: [PATCH] thermal: core: Move initial num_trips assignment before memcpy()

2024-02-27 Thread Rafael J. Wysocki
On Tue, Feb 27, 2024 at 11:14 AM Daniel Lezcano wrote: > > On 27/02/2024 01:54, Nathan Chancellor wrote: > > When booting a CONFIG_FORTIFY_SOURCE=y kernel compiled with a toolchain > > that supports __counted_by() (such as clang-18 and newer), there is a > > panic on boot: > > > >[2.913770

Re: [PATCH v3] driver core: Cancel scheduled pm_runtime_idle() on device removal

2024-02-29 Thread Rafael J. Wysocki
On Thu, Feb 29, 2024 at 8:21 PM Bjorn Helgaas wrote: > > [+to Rafael, can you comment on whether this is the right fix for the > .remove() vs .runtime_idle() race?] It doesn't seem so. pm_runtime_get_sync() is expected to cancel pending pm_runtime_idle() in all cases, so this looks like PM-runti

Re: [PATCH v3] driver core: Cancel scheduled pm_runtime_idle() on device removal

2024-03-04 Thread Rafael J. Wysocki
On Thu, Feb 29, 2024 at 7:23 AM Kai-Heng Feng wrote: > > When inserting an SD7.0 card to Realtek card reader, the card reader > unplugs itself and morph into a NVMe device. The slot Link down on hot > unplugged can cause the following error: > > pcieport :00:1c.0: pciehp: Slot(8): Link Down >

Re: [PATCH v3] driver core: Cancel scheduled pm_runtime_idle() on device removal

2024-03-04 Thread Rafael J. Wysocki
On Mon, Mar 4, 2024 at 4:51 PM Bjorn Helgaas wrote: > > On Mon, Mar 04, 2024 at 03:38:38PM +0100, Rafael J. Wysocki wrote: > > On Thu, Feb 29, 2024 at 7:23 AM Kai-Heng Feng > > wrote: > > > > > > When inserting an SD7.0 card to Realtek card reader, the card r

Re: [PATCH v3] driver core: Cancel scheduled pm_runtime_idle() on device removal

2024-03-04 Thread Rafael J. Wysocki
On Mon, Mar 4, 2024 at 5:41 PM Rafael J. Wysocki wrote: > > On Mon, Mar 4, 2024 at 4:51 PM Bjorn Helgaas wrote: > > > > On Mon, Mar 04, 2024 at 03:38:38PM +0100, Rafael J. Wysocki wrote: > > > On Thu, Feb 29, 2024 at 7:23 AM Kai-Heng Feng > > > wrote: >

Re: [PATCH v3] driver core: Cancel scheduled pm_runtime_idle() on device removal

2024-03-04 Thread Rafael J. Wysocki
On Mon, Mar 4, 2024 at 6:00 PM Rafael J. Wysocki wrote: > > On Mon, Mar 4, 2024 at 5:41 PM Rafael J. Wysocki wrote: > > > > On Mon, Mar 4, 2024 at 4:51 PM Bjorn Helgaas wrote: > > > > > > On Mon, Mar 04, 2024 at 03:38:38PM +0100, Rafael J. Wysocki wrote: >

Re: [PATCH v3] driver core: Cancel scheduled pm_runtime_idle() on device removal

2024-03-04 Thread Rafael J. Wysocki
On Mon, Mar 4, 2024 at 7:10 PM Rafael J. Wysocki wrote: > > On Mon, Mar 4, 2024 at 6:00 PM Rafael J. Wysocki wrote: > > > > On Mon, Mar 4, 2024 at 5:41 PM Rafael J. Wysocki wrote: > > > > > > On Mon, Mar 4, 2024 at 4:51 PM Bjorn Helgaas wrote: > > >

Re: [PATCH v3] driver core: Cancel scheduled pm_runtime_idle() on device removal

2024-03-05 Thread Rafael J. Wysocki
On Tue, Mar 5, 2024 at 8:20 AM Kai-Heng Feng wrote: > > On Tue, Mar 5, 2024 at 2:10 AM Rafael J. Wysocki wrote: > > > > On Mon, Mar 4, 2024 at 6:00 PM Rafael J. Wysocki wrote: > > > > > > On Mon, Mar 4, 2024 at 5:41 PM Rafael J. Wysocki > > > wr

Re: [PATCH v3] driver core: Cancel scheduled pm_runtime_idle() on device removal

2024-03-05 Thread Rafael J. Wysocki
On Tue, Mar 5, 2024 at 10:20 AM Ricky WU wrote: > > > On Mon, Mar 4, 2024 at 7:10 PM Rafael J. Wysocki > > wrote: > > > > > > On Mon, Mar 4, 2024 at 6:00 PM Rafael J. Wysocki > > wrote: > > > > > > > > On Mon, Mar 4, 2024 at 5:41 P

Re: [PATCH] thermal: intel: int340x_thermal: replace deprecated strncpy with strscpy

2024-03-19 Thread Rafael J. Wysocki
On Mon, Mar 18, 2024 at 11:36 PM Justin Stitt wrote: > > strncpy() is deprecated for use on NUL-terminated destination strings > [1] and as such we should prefer more robust and less ambiguous string > interfaces. > > psvt->limit.string can only be 8 bytes so let's use the appropriate size > macro

Re: [PATCH] thermal: intel: int340x_thermal: replace deprecated strncpy with strscpy

2024-03-27 Thread Rafael J. Wysocki
On Tue, Mar 19, 2024 at 5:20 PM srinivas pandruvada wrote: > > On Tue, 2024-03-19 at 12:39 +0100, Rafael J. Wysocki wrote: > > On Mon, Mar 18, 2024 at 11:36 PM Justin Stitt > > wrote: > > > > > > strncpy() is deprecated for use on NUL-terminated destination &g

Re: [PATCH] PM: hibernate: replace deprecated strncpy with strscpy

2024-04-30 Thread Rafael J. Wysocki
On Tue, Apr 30, 2024 at 11:36 AM Dhruva Gole wrote: > > On Apr 29, 2024 at 20:50:30 +, Justin Stitt wrote: > > strncpy() is deprecated for use on NUL-terminated destination strings > > [1] and as such we should prefer more robust and less ambiguous string > > interfaces. > > > > This kernel co

Re: [PATCH] thermal: int3400: Use sizeof(*pointer) instead of sizeof(type)

2024-06-07 Thread Rafael J. Wysocki
On Thu, Jun 6, 2024 at 7:21 PM Erick Archer wrote: > > It is preferred to use sizeof(*pointer) instead of sizeof(type) > due to the type of the variable can change and one needs not > change the former (unlike the latter). This patch has no effect > on runtime behavior. > > Signed-off-by: Erick Ar

Re: [PATCH] thermal/debugfs: replace kzalloc() with kcalloc() in thermal_debug_tz_add()

2025-02-26 Thread Rafael J. Wysocki
On Sat, Feb 22, 2025 at 9:02 PM Ethan Carter Edwards wrote: > > We are trying to get rid of all multiplications from allocation > functions to prevent integer overflows[1]. Here the multiplication is > obviously safe, but using kcalloc() is more appropriate and improves > readability. This patch h

Re: [PATCH] PNP: Expand length of fixup id string

2025-03-12 Thread Rafael J. Wysocki
used in > (debugging) format strings that expect a properly formed C string. > > Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117178 [1] > Cc: "Rafael J. Wysocki" > Cc: linux-a...@vger.kernel.org > Signed-off-by: Kees Cook > --- > include/linux/pnp.h |