Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1705517

Possible race in pc87413_wdt.ko

From Anton Volkov <avolkov@ispras.ru>
Newsgroups linux.kernel
Subject Possible race in pc87413_wdt.ko
Date 2017-08-07 15:30 +0200
Message-ID <ubQgy-ju-11@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Hello.

While searching for races in the Linux kernel I've come across 
"drivers/watchdog/pc87413_wdt.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:
pc87413_init
    misc_register(&pc87413_miscdev)
-> pc87413_get_swc_base_addr       pc87413_open
                                    -> pc87413_refresh
                                       -> pc87413_swc_bank3
      swc_base_addr = ...                  <read access to swc_base_addr>
      (pc87413_wdt.c: line 133)            (pc87413_wdt.c: line 146)

So in this case preemptive registration of the device leads to a 
possibility of race between the initialization process and a callback to 
the registered device.

Is this race feasible from your point of view? And if it is, is it 
possible to move the device registration a bit further down in the 
pc87413_init function?

Thank you for your time.

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

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Possible race in pc87413_wdt.ko Anton Volkov <avolkov@ispras.ru> - 2017-08-07 15:30 +0200
  Re: Possible race in pc87413_wdt.ko Guenter Roeck <linux@roeck-us.net> - 2017-08-08 06:20 +0200

csiph-web