All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: syzbot is quite fun
Date: Tue, 14 Jan 2020 16:27:36 +0000	[thread overview]
Message-ID: <20200114162736.GD3719@kadam> (raw)

Hi Everyone,

I joined the syzbot mailing list last week.  It seems quite fun.

I'm puzzling over this one right now.

https://syzkaller.appspot.com/bug?extidš48339b077c5a80b869

Notice the kernel is 5.5.0-rc3-syzkaller (git checkout v5.5-rc3).

  1801  static int uvc_scan_device(struct uvc_device *dev)
  1802  {
  1803          struct uvc_video_chain *chain;
  1804          struct uvc_entity *term;
  1805  
  1806          list_for_each_entry(term, &dev->entities, list) {
  1807                  if (!UVC_ENTITY_IS_OTERM(term))
  1808                          continue;
  1809  
  1810                  /* If the terminal is already included in a chain, skip it.
  1811                   * This can happen for chains that have multiple output
  1812                   * terminals, where all output terminals beside the first one
  1813                   * will be inserted in the chain in forward scans.
  1814                   */
  1815                  if (term->chain.next || term->chain.prev)
  1816                          continue;
  1817  
  1818                  chain = uvc_alloc_chain(dev);
  1819                  if (chain = NULL)
  1820                          return -ENOMEM;
  1821  
  1822                  term->flags |= UVC_ENTITY_FLAG_DEFAULT;
  1823  
  1824                  if (uvc_scan_chain(chain, term) < 0) {
  1825                          kfree(chain);
                                      ^^^^^
Somehow this "chain" is used after it has been freed.  That doesn't
seem possible because uvc_scan_chain() doesn't store any reference to
it.

  1826                          continue;
  1827                  }
  1828  
  1829                  uvc_trace(UVC_TRACE_PROBE, "Found a valid video chain (%s).\n",
  1830                            uvc_print_chain(chain));
  1831  
  1832                  list_add_tail(&chain->list, &dev->chains);
  1833          }

Its like solving a puzzle.  Reviewing code skills etc.

regards,
dan carpenter

             reply	other threads:[~2020-01-14 16:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-14 16:27 Dan Carpenter [this message]
2020-01-14 16:36 ` syzbot is quite fun Colin Ian King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200114162736.GD3719@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.