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


Groups > linux.kernel > #1720093

Possible race in nsc-ircc.ko

From Anton Volkov <avolkov@ispras.ru>
Newsgroups linux.kernel
Subject Possible race in nsc-ircc.ko
Date 2017-08-25 16:10 +0200
Message-ID <uint7-51N-9@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/net/irda/nsc-ircc.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:
nsc_ircc_init
->nsc_ircc_open
     self = netdev_priv(dev)
     register_netdev(dev)
                             nsc_ircc_net_ioctl
                             ->nsc_ircc_change_speed
     self->dongle_id = ...       <READ self->io.dongle_id>
     (nsc-ircc.c: line 485)      (nsc-ircc.c: line 1318)
     platform_device_register_simple

Before the initialization of self->dongle_id in msc_ircc_open() its 
value is 0. Thus if read access to its value in nsc_ircc_change_speed 
occurs before the initialization there will be an attempt to change 
speed of dongle with undesired id (if the dongle with id 0 exists). Is 
this case feasible 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

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


Thread

Possible race in nsc-ircc.ko Anton Volkov <avolkov@ispras.ru> - 2017-08-25 16:10 +0200
  Re: Possible race in nsc-ircc.ko Jean Tourrilhes <jt@labs.hpe.com> - 2017-08-25 18:50 +0200

csiph-web