linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Possible null pointer dereference in isp1760.ko
@ 2017-08-07 15:12 Anton Volkov
  0 siblings, 0 replies; only message in thread
From: Anton Volkov @ 2017-08-07 15:12 UTC (permalink / raw)
  To: bhumirks; +Cc: gregkh, linux-usb, linux-kernel, ldv-project, Alexey Khoroshilov

Hello.

While searching for races in the Linux kernel I've come across 
"drivers/usb/isp1760/isp1760.ko" module. Here is a question that I came 
up with while analyzing results. Lines are given using the info from 
Linux v4.12.

Consider the following case:

Thread 1:                             Thread 2:
isp1760_plat_probe
-> isp1760_register
    -> isp1760_udc_register
          request_irq(...,udc)
       -> isp1760_udc_init_eps(udc)    isp1760_udc_irq
            for(i = 0; ...){              for(i = 0; ...) {
              ep = &udc->ep[i]               ep = &udc->ep[i%2]
                                          -> isp1760_ep_rx_ready(ep)
              INIT_LIST_HEAD(ep->queue)         list_empty(&ep->queue)
              (isp1760-udc.c: line 1367)        (isp1760-udc.c: line 303)

As far as I understand ep->queue is NULL before its initialization in 
isp1760_udc_init_eps and list_empty() tries to access the '->next' 
pointer member of the passed parameter.

Is this case possible from your point of view?

Thank you for your time.

-- Anton Volkov
Linux Verification Center, ISPRAS
web: http://linuxtesting.org
e-mail: avolkov@ispras.ru

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-08-07 15:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-07 15:12 Possible null pointer dereference in isp1760.ko Anton Volkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).