Hi,

On Tue, Jun 30, 2020 at 10:49 AM Dan Carpenter <dan.carpen...@oracle.com> wrote:
>
> Hello Sumit Garg,
>
> This is a semi-automatic email about new static checker warnings.
>
> The patch 5946d1f5b309: "kdb: Switch to use safer dbg_io_ops over
> console APIs" from Jun 4, 2020, leads to the following Smatch
> complaint:
>
>     kernel/debug/kdb/kdb_io.c:565 kdb_msg_write()
>     error: we previously assumed 'dbg_io_ops' could be null (see line 552)
>
> kernel/debug/kdb/kdb_io.c
>    551
>    552          if (dbg_io_ops) {
>                     ^^^^^^^^^^
> Check for NULL
>
>    553                  const char *cp = msg;
>    554                  int len = msg_len;
>    555
>    556                  while (len--) {
>    557                          dbg_io_ops->write_char(*cp);
>    558                          cp++;
>    559                  }
>    560          }
>    561
>    562          for_each_console(c) {
>    563                  if (!(c->flags & CON_ENABLED))
>    564                          continue;
>    565                  if (c == dbg_io_ops->cons)
>                                  ^^^^^^^^^^
> New unchecked dereference.

Thanks for the report!  Someone else already noticed and so we have:

https://lore.kernel.org/r/20200630082922.28672-1-cen...@kernel.wtf

-Doug


_______________________________________________
Kgdb-bugreport mailing list
Kgdb-bugreport@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport

Reply via email to