> +++ b/drivers/gpu/drm/i915/i915_gpu_error.c
> @@ -1412,7 +1412,7 @@ static bool record_context(struct
> i915_gem_context_coredump *e,
> rcu_read_lock();
> task = pid_task(ctx->pid, PIDTYPE_PID);
> if (task) {
> - strcpy(e->comm, task->comm);
>
t.ipv6.neigh.%s.%s_ms instead\n",
> warncomm, func,
> dev_name, ctl->procname,
> --
> 2.43.5
>
>
Reviewed-by: Justin Stitt
Thanks
Justin
Hi,
On Wed, Aug 28, 2024 at 11:03:17AM GMT, Yafang Shao wrote:
> Let's explicitly ensure the destination string is NUL-terminated. This way,
> it won't be affected by changes to the source string.
>
> Signed-off-by: Yafang Shao
> Reviewed-by: Quentin Monnet
> ---
> tools/bpf/bpftool/pids.c | 2
mcpy(axp->target_comm[axp->pid_count], t->comm, TASK_COMM_LEN);
> + strscpy(axp->target_comm[axp->pid_count], t->comm);
> axp->pid_count++;
>
> return 0;
> --
> 2.43.5
>
Good usage of two-argument strscpy(). This helps towards [1].
Reviewed-by: Justin Stitt
[1]: https://github.com/KSPP/linux/issues/90
Thanks
Justin
On Tue, Aug 13, 2024 at 3:19 PM Justin Stitt wrote:
>
> Hi,
>
> On Mon, Aug 12, 2024 at 10:29:31AM GMT, Yafang Shao wrote:
> > Using strscpy() to read the task comm ensures that the name is
> > always NUL-terminated, regardless of the source string. This approach als
Hi,
On Mon, Aug 12, 2024 at 10:29:31AM GMT, Yafang Shao wrote:
> Using strscpy() to read the task comm ensures that the name is
> always NUL-terminated, regardless of the source string. This approach also
> facilitates future extensions to the task comm.
Thanks for sending patches replacing str{n
>
> Fixes: de8548813824 ("drm/panthor: Add the scheduler logical block")
> Signed-off-by: Nathan Chancellor
Reviewed-by: Justin Stitt
> ---
> drivers/gpu/drm/panthor/panthor_sched.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/driv
/linux/issues/90
Cc: linux-harden...@vger.kernel.org
Signed-off-by: Justin Stitt
---
Note: build-tested only.
Found with: $ rg "strncpy\("
---
drivers/video/hdmi.c | 10 ++
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/video/hdmi.c b/drivers/video/hd
ps://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings
[1]
Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html
Link: https://github.com/KSPP/linux/issues/90
Cc: linux-harden...@vger.kernel.org
Signed-off-by: Justin Stitt
---
Note: b
s://github.com/KSPP/linux/issues/90
Cc: linux-harden...@vger.kernel.org
Signed-off-by: Justin Stitt
---
Note: build-tested only.
Found with: $ rg "strncpy\("
---
drivers/video/fbdev/fsl-diu-fb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/
Hi,
On Wed, Mar 20, 2024 at 12:56 AM Helge Deller wrote:
>
> On 3/19/24 00:46, 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.
>
rnel.org
Signed-off-by: Justin Stitt
---
Note: build-tested only.
Found with: $ rg "strncpy\("
---
drivers/video/fbdev/au1200fb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/au1200fb.c b/drivers/video/fbdev/au1200fb.c
index 6f20efc663d7..e718fea
s/drm_buddy: add alloc_contiguous test")
> Fixes: fca7526b7d89 ("drm/tests/drm_buddy: fix build failure on 32-bit
> targets")
> Fixes: fc8d29e298cf ("drm: selftest: convert drm_mm selftest to KUnit")
> Signed-off-by: David Gow
Reviewed-by: Justin Stitt
> ---
>
ks good.
For those wondering, %pe has a special meaning in the kernel which can
be seen in lib/vsprintf.c.
Reviewed-by: Justin Stitt
> ---
> net/core/gso_test.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/core/gso_test.c b/net/core/gso_test.c
>
tc: Improve performance of rtc_time64_to_tm(). Add
> tests.")
> Signed-off-by: David Gow
Reviewed-by: Justin Stitt
> ---
> drivers/rtc/lib_test.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/rtc/lib_test.c b/drivers/rtc/lib_test.c
>
t;time: Improve performance of time64_to_tm()")
> Signed-off-by: David Gow
Reviewed-by: Justin Stitt
> ---
> kernel/time/time_test.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/time/time_test.c b/kernel/time/time_test.c
> index ca058c8af6b
the format strings.
>
> Fixes: bb95ebbe89a7 ("lib: Introduce CONFIG_MEMCPY_KUNIT_TEST")
> Signed-off-by: David Gow
> ---
Reviewed-by: Justin Stitt
> lib/memcpy_kunit.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/lib/memcp
Hi,
On Wed, Feb 21, 2024 at 05:27:15PM +0800, David Gow wrote:
> The correct format specifier for p - n (both p and n are pointers) is
> %td, as the type should be ptrdiff_t.
I think %tu is better. d specifies a signed type. I don't doubt that the
warning is fixed but I think %tu represents the t
t gcc validate
> the format string.
>
> Fixes: 76066f93f1df ("kunit: add tests for filtering attributes")
> Signed-off-by: David Gow
Reviewed-by: Justin Stitt
> ---
> lib/kunit/executor_test.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
er now that we've fixed these errors, to
> prevent them from recurring.
>
> Suggested-by: Linus Torvalds
> Signed-off-by: David Gow
Reviewed-by: Justin Stitt
> ---
> include/kunit/test.h | 12 ++--
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff
char name[DRM_DISPLAY_MODE_LEN];
Link:
https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings
[1]
Link: https://github.com/KSPP/linux/issues/90
Cc: linux-harden...@vger.kernel.org
Cc: Xu Panda
Signed-off-by: Justin Stitt
---
Changes in v2:
- use strscpy_pad (thanks Kee
cpy.9.en.html [2]
Link: https://github.com/KSPP/linux/issues/90
Cc: linux-harden...@vger.kernel.org
Signed-off-by: Justin Stitt
---
Changes in v2:
- drop the `... - 1` (thanks Kees)
- Link to v1:
https://lore.kernel.org/r/20230914-strncpy-drivers-gpu-drm-i915-gem-selftests-mock_context-c-v1-1-c3f9
k: https://github.com/KSPP/linux/issues/90
Cc: linux-harden...@vger.kernel.org
Signed-off-by: Justin Stitt
---
Changes in v2:
- use sizeof() instead of I2C_NAME_SIZE (thanks Kees, Patrik)
- Link to v1:
https://lore.kernel.org/r/20230914-drivers-gpu-drm-gma500-oaktrail_lvds_i2c-c-v1-1-0
behavior that strncpy provides.
Link:
https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings
[1]
Link: https://github.com/KSPP/linux/issues/90
Cc: linux-harden...@vger.kernel.org
Cc: Bo YU
Signed-off-by: Justin Stitt
---
Changes in v2:
- use strscpy_pad
.
Link:
https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings
[1]
Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2]
Link: https://github.com/KSPP/linux/issues/90
Cc: linux-harden...@vger.kernel.org
Signed-off-by: Justin Stitt
cated.html#strncpy-on-nul-terminated-strings
[1]
Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2]
Link: https://github.com/KSPP/linux/issues/90
Cc: linux-harden...@vger.kernel.org
Signed-off-by: Justin Stitt
---
drivers/gpu/drm/nouveau/nvkm/core/firmware.c | 3 +
b.com/KSPP/linux/issues/90
Cc: linux-harden...@vger.kernel.org
Signed-off-by: Justin Stitt
---
Note: build-tested only.
---
drivers/gpu/drm/nouveau/nvif/client.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/nouveau/nvif/client.c
b/drivers/gpu/drm/nouveau/nvi
ocess/deprecated.html#strncpy-on-nul-terminated-strings
[1]
Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2]
Link: https://github.com/KSPP/linux/issues/90
Cc: linux-harden...@vger.kernel.org
Signed-off-by: Justin Stitt
---
drivers/gpu/drm/i915/gem/selftests/mock_context.
Cc: linux-harden...@vger.kernel.org
Signed-off-by: Justin Stitt
---
drm/gma500: refactor deprecated strncpy
---
drivers/gpu/drm/gma500/oaktrail_lvds_i2c.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/gma500/oaktrail_lvds_i2c.c
b/drivers/gpu/drm/gma
/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings
[1]
Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2]
Link: https://github.com/KSPP/linux/issues/90
Cc: linux-harden...@vger.kernel.org
Cc: Bo YU
Signed-off-by: Justin Stitt
---
Similar to [1
arden...@vger.kernel.org
Cc: Xu Panda
Signed-off-by: Justin Stitt
---
This patch is basically a resend of [1] by Xu but rebased onto mainline.
This patch is also similar to:
commit 0f9aa074c92dd ("drm/modes: Use strscpy() to copy command-line mode name")
[1]: https://lore.kernel.org/all/202
This patch as well as two other related patches were combined into a
single patch [1]
On Thu, Aug 24, 2023 at 1:41 PM Justin Stitt wrote:
>
> `strncpy` is deprecated for use on NUL-terminated destination strings [1].
>
> A suitable replacement is `strscpy` [2] due to the
This patch as well as two other related patches were combined into a
single patch [1]
On Thu, Aug 24, 2023 at 1:45 PM Justin Stitt wrote:
>
> `strncpy` is deprecated for use on NUL-terminated destination strings [1].
>
> A suitable replacement is `strscpy` [2] due to the
This patch as well as two other related patches were combined into a
single patch [1]
Thu, Aug 24, 2023 at 1:49 PM Justin Stitt wrote:
>
> `strncpy` is deprecated for use on NUL-terminated destination strings [1].
>
> A suitable replacement is `strscpy` [2] due to the fact that it
w.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings[1]
Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2]
Link: https://github.com/KSPP/linux/issues/90
Cc: linux-harden...@vger.kernel.org
Signed-off-by: Justin Stitt
Suggested-by: Kees Co
eprecated.html#strncpy-on-nul-terminated-strings[1]
Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2]
Link: https://github.com/KSPP/linux/issues/90
Cc: linux-harden...@vger.kernel.org
Signed-off-by: Justin Stitt
---
Note: build-tested only.
---
drivers/accel/ivpu/ivpu_
/deprecated.html#strncpy-on-nul-terminated-strings[1]
Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2]
Link: https://github.com/KSPP/linux/issues/90
Cc: linux-harden...@vger.kernel.org
Signed-off-by: Justin Stitt
---
Note: build-tested only.
---
drivers/accel/habanalabs/goya
/deprecated.html#strncpy-on-nul-terminated-strings[1]
Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2]
Link: https://github.com/KSPP/linux/issues/90
Cc: linux-harden...@vger.kernel.org
Signed-off-by: Justin Stitt
---
Note: build-tested only.
---
drivers/accel/habanalabs/gaudi2
/deprecated.html#strncpy-on-nul-terminated-strings[1]
Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2]
Link: https://github.com/KSPP/linux/issues/90
Cc: linux-harden...@vger.kernel.org
Signed-off-by: Justin Stitt
---
Note: build-tested only
---
drivers/accel/habanalabs/gaudi
/latest/process/deprecated.html#strncpy-on-nul-terminated-strings[1]
Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2]
Link: https://github.com/KSPP/linux/issues/90
Cc: linux-harden...@vger.kernel.org
Signed-off-by: Justin Stitt
---
Note: build-tested only
sues/1910
Reported-by: Nathan Chancellor
Signed-off-by: Justin Stitt
---
drivers/gpu/drm/pl111/pl111_versatile.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/pl111/pl111_versatile.c
b/drivers/gpu/drm/pl111/pl111_versatile.c
index 00c3ebd32
repaper_model)spi_id->driver_data;
Link: https://github.com/ClangBuiltLinux/linux/issues/1910
Reported-by: Nathan Chancellor
Signed-off-by: Justin Stitt
---
drivers/gpu/drm/tiny/repaper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/tiny/repaper.c b/drivers
42 matches
Mail list logo