lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+GJov5MrgGO1bo8Zr=_E8h4beB7mkZdpODc=i_m7o5Sff6iLQ@mail.gmail.com>
Date: Tue, 19 Dec 2023 16:03:34 -0500
From: Rae Moar <rmoar@...gle.com>
To: Richard Fitzgerald <rf@...nsource.cirrus.com>
Cc: brendan.higgins@...ux.dev, davidgow@...gle.com, 
	linux-kselftest@...r.kernel.org, kunit-dev@...glegroups.com, 
	linux-kernel@...r.kernel.org, patches@...nsource.cirrus.com
Subject: Re: [PATCH] kunit: Fix NULL-dereference in kunit_init_suite() if
 suite->log is NULL

On Mon, Dec 18, 2023 at 10:17 AM Richard Fitzgerald
<rf@...nsource.cirrus.com> wrote:
>
> suite->log must be checked for NULL before passing it to
> string_stream_clear(). This was done in kunit_init_test() but was missing
> from kunit_init_suite().
>
> Signed-off-by: Richard Fitzgerald <rf@...nsource.cirrus.com>
> Fixes: 6d696c4695c5 ("kunit: add ability to run tests after boot using debugfs")

Hello!

This looks good! Thanks! Sorry I did not catch this earlier.

Reviewed-by: Rae Moar <rmoar@...gle.com>

-Rae

> ---
>  lib/kunit/test.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/lib/kunit/test.c b/lib/kunit/test.c
> index e803d998e855..ea7f0913e55a 100644
> --- a/lib/kunit/test.c
> +++ b/lib/kunit/test.c
> @@ -658,7 +658,9 @@ static void kunit_init_suite(struct kunit_suite *suite)
>         kunit_debugfs_create_suite(suite);
>         suite->status_comment[0] = '\0';
>         suite->suite_init_err = 0;
> -       string_stream_clear(suite->log);
> +
> +       if (suite->log)
> +               string_stream_clear(suite->log);
>  }
>
>  bool kunit_enabled(void)
> --
> 2.30.2
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ