Re: [PATCH] vhost/scsi: Fix improper cleanup in vhost_scsi_set_endpoint()

2025-01-10 Thread Kuan-Wei Chiu
Hi Haoran, On Sat, Jan 11, 2025 at 11:34:18AM +0800, Haoran Zhang wrote: > Since commit 3f8ca2e115e55 ("vhost scsi: alloc cmds per vq instead of > session"), a bug can be triggered when the host sends a duplicate > VHOST_SCSI_SET_ENDPOINT ioctl command. > > In vhost_scsi_set_endpoint(), if the

Re: [PATCH] checkpatch: Remove migrated RCU APIs from deprecated_apis

2025-01-08 Thread Kuan-Wei Chiu
t waste > time looking for them, and so readers of checkpatch looking for deprecated > APIs don't waste time searching for them. > > Link: > https://lore.kernel.org/all/2018192904.3199-13-paul...@linux.ibm.com/ [1] > > Signed-off-by: David Reaver LGTM. Thanks! Reviewed-by: Kuan-Wei Chiu Regards, Kuan-Wei

Re: [PATCH v7] lib/math: Add int_sqrt test suite

2024-12-14 Thread Kuan-Wei Chiu
. Feel free to add: Reviewed-by: Kuan-Wei Chiu Regards, Kuan-Wei > --- > lib/Kconfig.debug | 15 > lib/math/Makefile | 1 + > lib/math/tests/Makefile | 1 + > lib/math/tests/int_sqrt_kunit.c | 66 +

Re: [PATCH v2] kunit: string-stream: Fix a UAF bug in kunit_init_suite()

2024-11-18 Thread Kuan-Wei Chiu
.constprop.0+0x160/0x22c >do_el0_svc+0x44/0x5c >el0_svc+0x48/0xb8 >el0t_64_sync_handler+0x13c/0x158 >el0t_64_sync+0x190/0x194 > Code: f9400753 d2dff800 f2fbffe0 d343fe7c (38e06b80) > ---[ end trace 00000000 ]--- > Kernel

Re: [GIT PULL] KUnit update for Linux 6.13-rc1

2024-11-18 Thread Kuan-Wei Chiu
Hi Shuah, On Mon, Nov 18, 2024 at 12:19:50PM -0700, Shuah Khan wrote: > Hi Linus, > > Please pull the following kunit update for Linux 6.13-rc1. > > kunit update for Linux 6.13-rc1 > > -- fixes user-after-free (UAF) bug in kunit_init_suite() > > -- adds option to kunit tool to print just the s

[PATCH] kunit: debugfs: Use IS_ERR() for alloc_string_stream() error check

2024-11-14 Thread Kuan-Wei Chiu
change avoids any ambiguity regarding the function's return behavior. Link: https://lore.kernel.org/lkml/Zy9deU5VK3YR+r9N@visitorckw-System-Product-Name Signed-off-by: Kuan-Wei Chiu --- lib/kunit/debugfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/kunit/debu

Re: [PATCH v2] kunit: string-stream: Fix a UAF bug in kunit_init_suite()

2024-11-12 Thread Kuan-Wei Chiu
/0x194 > Code: f9400753 d2dff800 f2fbffe0 d343fe7c (38e06b80) > ---[ end trace 00000000 ]--- > Kernel panic - not syncing: Oops: Fatal exception > > Cc: sta...@vger.kernel.org > Fixes: a3fdf784780c ("kunit: string-stream: Decouple string_stream from >

Re: [PATCH] kunit: skb: add gfp to kernel doc for kunit_zalloc_skb()

2024-11-11 Thread Kuan-Wei Chiu
On Mon, Nov 11, 2024 at 01:54:09PM +0300, Dan Carpenter wrote: > Kuan-Wei Chiu pointed out that the kernel doc for kunit_zalloc_skb() > needs to include the @gfp information. Add it. > > Reported-by: Kuan-Wei Chiu > Closes: > https://lore.kernel.org/all/Zy+VIXDPuU613fFd

Re: [PATCH] kunit: skb: use "gfp" variable instead of hardcoding GFP_KERNEL

2024-11-09 Thread Kuan-Wei Chiu
KERNEL with @gfp. It might be better to fix both issues in the comment together. With the above corrections: Reviewed-by: Kuan-Wei Chiu Regards, Kuan-Wei > --- > include/kunit/skbuff.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/kunit/skbuff.h b

Re: [PATCH] kunit: string-stream: Fix a UAF bug in kunit_init_suite()

2024-11-09 Thread Kuan-Wei Chiu
On Sat, Nov 09, 2024 at 08:40:30PM +0800, Kuan-Wei Chiu wrote: > Hi Jinjie, > > On Thu, Oct 24, 2024 at 05:43:03PM +0800, Jinjie Ruan wrote: > > In kunit_debugfs_create_suite(), if alloc_string_stream() fails in the > > kunit_suite_for_each_test_case() loop, the "su

Re: [PATCH] kunit: string-stream: Fix a UAF bug in kunit_init_suite()

2024-11-09 Thread Kuan-Wei Chiu
Hi Jinjie, On Thu, Oct 24, 2024 at 05:43:03PM +0800, Jinjie Ruan wrote: > In kunit_debugfs_create_suite(), if alloc_string_stream() fails in the > kunit_suite_for_each_test_case() loop, the "suite->log = stream" > has assigned before, and the error path only free the suite->log's stream > memory b

Re: [RESEND PATCH v4] list: test: Check the size of every lists for list_cut_position*()

2024-10-08 Thread Kuan-Wei Chiu
Hi I Hsin, On Tue, Oct 08, 2024 at 02:51:23PM +0800, I Hsin Cheng wrote: > Check the total number of elements in both resultant lists are correct > within list_cut_position*(). Previously, only the first list's size was > checked. wo additional elements in the second list would not have been > cau

Re: [PATCH v2] ACPI: NFIT: Optimize nfit_mem_cmp() for efficiency

2023-10-18 Thread Kuan-Wei Chiu
On Wed, Oct 18, 2023 at 01:17:31PM +0200, Rafael J. Wysocki wrote: > On Fri, Oct 13, 2023 at 2:22 PM Kuan-Wei Chiu wrote: > > > > The original code used conditional branching in the nfit_mem_cmp > > function to compare two values and return -1, 1, or 0 based on the >

[PATCH v2] ACPI: NFIT: Optimize nfit_mem_cmp() for efficiency

2023-10-13 Thread Kuan-Wei Chiu
roving efficiency and reducing code size. This change reduces the number of comparison operations from 1-2 to a single subtraction operation, thereby saving the number of instructions. Signed-off-by: Kuan-Wei Chiu --- v1 -> v2: - Add explicit type cast in case the sizes of u32 and int differ. dri

[PATCH] ACPI: NFIT: Optimize nfit_mem_cmp() for efficiency

2023-10-12 Thread Kuan-Wei Chiu
roving efficiency and reducing code size. This change reduces the number of comparison operations from 1-2 to a single subtraction operation, thereby saving the number of instructions. Signed-off-by: Kuan-Wei Chiu --- drivers/acpi/nfit/core.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-)