Re: [PATCH v2] PCI: Prevent device from doing RPM when it's unplugged

2023-12-21 Thread Kai-Heng Feng
Hi Bjorn, On Fri, Dec 15, 2023 at 1:16 AM Bjorn Helgaas wrote: > > [+cc Rafael, runtime PM expert :)] > > On Tue, Dec 12, 2023 at 12:38:07PM +0800, 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 sl

Re: [PATCH v3 3/3] kernfs: Convert kernfs_path_from_node_locked() from strlcpy() to strscpy()

2023-12-21 Thread Tejun Heo
Hello, On Tue, Dec 12, 2023 at 01:17:40PM -0800, Kees Cook wrote: ... > @@ -127,7 +127,7 @@ static struct kernfs_node *kernfs_common_ancestor(struct > kernfs_node *a, > * > * [3] when @kn_to is %NULL result will be "(null)" > * > - * Return: the length of the full path. If the full length

Re: [PATCH v3 2/3] kernfs: Convert kernfs_name_locked() from strlcpy() to strscpy()

2023-12-21 Thread Tejun Heo
On Tue, Dec 12, 2023 at 01:17:39PM -0800, Kees Cook wrote: > strlcpy() reads the entire source buffer first. This read may exceed > the destination size limit. This is both inefficient and can lead > to linear read overflows if a source string is not NUL-terminated[1]. > Additionally, it returns th

Re: [PATCH v3 1/3] kernfs: Convert kernfs_walk_ns() from strlcpy() to strscpy()

2023-12-21 Thread Tejun Heo
On Tue, Dec 12, 2023 at 01:17:38PM -0800, Kees Cook wrote: > strlcpy() reads the entire source buffer first. This read may exceed > the destination size limit. This is both inefficient and can lead > to linear read overflows if a source string is not NUL-terminated[1]. > Additionally, it returns th

Re: [PATCH] lsm: Add a __counted_by() annotation to lsm_ctx.ctx

2023-12-21 Thread Paul Moore
On Thu, Dec 21, 2023 at 3:39 PM Mark Brown wrote: > > The ctx in struct lsm_ctx is an array of size ctx_len, tell the compiler > about this using __counted_by() where supported to improve the ability to > detect overflow issues. > > Reported-by: Aishwarya TCV > Signed-off-by: Mark Brown > --- >

[PATCH] lsm: Add a __counted_by() annotation to lsm_ctx.ctx

2023-12-21 Thread Mark Brown
[]; + __u8 ctx[] __counted_by(ctx_len); }; /* --- base-commit: ec4e9d630a64df500641892f4e259e8149594a99 change-id: 20231221-lsm-fix-counted-by-f9fd827e26aa Best regards, -- Mark Brown

Re: [RFC PATCH 3/3] lsm: consolidate buffer size handling into lsm_fill_user_ctx()

2023-12-21 Thread Mark Brown
On Thu, Dec 21, 2023 at 10:21:04AM -0500, Paul Moore wrote: > On Thu, Dec 21, 2023 at 8:01 AM Mark Brown wrote: > > On Wed, Dec 20, 2023 at 08:40:24PM -0500, Paul Moore wrote: > > > Suggestions on how to annotate the struct, or the code doing the > > > memcpy() are welcome. > > You're looking fo

Re: [PATCH v3 2/2] lib/string: shrink lib/string.i via IWYU

2023-12-21 Thread Andy Shevchenko
On Tue, Dec 19, 2023 at 08:43:01AM -0800, Nick Desaulniers wrote: > On Tue, Dec 19, 2023 at 7:55 AM Andy Shevchenko wrote: > > On Mon, Dec 18, 2023 at 06:44:48PM +, tanz...@google.com wrote: ... > > > #define __NO_FORTIFY > > > #include > > > -#include > > > -#include > > > -#include >