linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Francesco Ruggeri <fruggeri@arista.com>
To: Dmitry Safonov <0x7f454c46@gmail.com>
Cc: lenb@kernel.org, "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	open list <linux-kernel@vger.kernel.org>,
	linux-acpi@vger.kernel.org
Subject: Re: [PATCH] ACPI: only free map once in osl.c
Date: Tue, 26 Nov 2019 14:42:00 -0800	[thread overview]
Message-ID: <CA+HUmGhOEPNcUGn1-yc6Zo41wYSCO+Ch4qh6N2TDbFEfRmNvEQ@mail.gmail.com> (raw)
In-Reply-To: <CAJwJo6bu0Hkmneg=DuwN=v_G4pkm1JQnUWKEVcudJD5L0pjLiw@mail.gmail.com>

On Thu, Nov 21, 2019 at 2:58 PM Dmitry Safonov <0x7f454c46@gmail.com> wrote:
>
> On Wed, 20 Nov 2019 at 05:50, Francesco Ruggeri <fruggeri@arista.com> wrote:
> >
> > acpi_os_map_cleanup checks map->refcount outside of acpi_ioremap_lock
> > before freeing the map. This creates a race condition the can result
> > in the map being freed more than once.
> > A panic can be caused by running
> >
> > for ((i=0; i<10; i++))
> > do
> >         for ((j=0; j<100000; j++))
> >         do
> >                 cat /sys/firmware/acpi/tables/data/BERT >/dev/null
> >         done &
> > done
> >
> > This patch makes sure that only the process that drops the reference
> > to 0 does the freeing.
> >
> > Fixes: b7c1fadd6c2e ("ACPI: Do not use krefs under a mutex in osl.c")
> > Signed-off-by: Francesco Ruggeri <fruggeri@arista.com>
>
> Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>
>
> Thanks,
>              Dmitry

Any more comments on this?
Can this be applied or is more work needed?

Thanks,
Francesco Ruggeri

  reply	other threads:[~2019-11-26 22:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-20  5:47 [PATCH] ACPI: only free map once in osl.c Francesco Ruggeri
2019-11-21 21:19 ` Dmitry Safonov
2019-11-21 22:49   ` Francesco Ruggeri
2019-11-21 22:57     ` Dmitry Safonov
2019-11-21 22:58 ` Dmitry Safonov
2019-11-26 22:42   ` Francesco Ruggeri [this message]
2019-11-29 11:22 ` Rafael J. Wysocki

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=CA+HUmGhOEPNcUGn1-yc6Zo41wYSCO+Ch4qh6N2TDbFEfRmNvEQ@mail.gmail.com \
    --to=fruggeri@arista.com \
    --cc=0x7f454c46@gmail.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    /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;
as well as URLs for NNTP newsgroup(s).