From: Tejun Heo <tj@kernel.org>
To: Pavel Andrianov <andrianov@ispras.ru>
Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org,
ldv-project@linuxtesting.org,
Vaishali Thakkar <vaishali.thakkar@oracle.com>
Subject: Re: Potential race condition in drivers/ata/sata_mv.ko
Date: Tue, 9 Aug 2016 23:51:33 -0400 [thread overview]
Message-ID: <20160810035133.GD25053@mtj.duckdns.org> (raw)
In-Reply-To: <8d7d8958-1a77-7c39-d008-fb6362e15d57@ispras.ru>
Hello,
On Fri, Aug 05, 2016 at 03:43:30PM +0300, Pavel Andrianov wrote:
> In drivers/ata/sata_mv.ko function mv_set_main_irq_mask is called several
> times. Twice with a spinlock, twice from init function and once without any
> protection. The call without protection rises to several handlers from
> ata_port_operations. The structure with the ata_port_operations is included
> into a structure 'host' in mv_platform_probe and in mv_pci_init_one. At the
> end of these functions ata_host operations are activated together with
> interrupt handler. The conclusion is: interrupt handler may be executed in
> parallel with handlers from ata_port_operations, or, more formally, it may
> interrupt its execution.
>
> In mv_set_main_irq_mask and in interrupt handler mv_interrupt the interrupt
> mask is modified, but, as I said, handlers from ata_port_operations do not
> acquire any lock. Thus, the interrupt mask may be set incorrectly if the are
> two conflicting modifications.
It depends on which operations. Most are only called from EH context
and racing there isn't likely to cause any actual issues. Care to
submit a patch to fix the issue?
Thanks.
--
tejun
next prev parent reply other threads:[~2016-08-10 3:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-05 12:43 Potential race condition in drivers/ata/sata_mv.ko Pavel Andrianov
2016-08-10 3:51 ` Tejun Heo [this message]
2016-08-11 14:18 ` Pavel Andrianov
2016-08-11 16:26 ` Tejun Heo
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=20160810035133.GD25053@mtj.duckdns.org \
--to=tj@kernel.org \
--cc=andrianov@ispras.ru \
--cc=ldv-project@linuxtesting.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vaishali.thakkar@oracle.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox