From: Jean Delvare <jdelvare@suse.de>
To: Andy Lutomirski <luto@amacapital.net>
Cc: "Pali Rohár" <pali.rohar@gmail.com>,
"Jean Delvare" <jdelvare@suse.com>,
"Andy Lutomirski" <luto@kernel.org>,
platform-driver-x86@vger.kernel.org,
linux-kernel@vger.kernel.org, stable <stable@vger.kernel.org>
Subject: Re: [PATCH] dell-wmi: Stop storing pointers to DMI tables
Date: Fri, 15 Jan 2016 14:27:19 +0100 [thread overview]
Message-ID: <20160115142719.36eea015@endymion.delvare> (raw)
In-Reply-To: <CALCETrWUJ+5DowyLFDp7N_iNLsday4uKX3iO3NMC8Pfqma=O7w@mail.gmail.com>
Hi Andy,
Sorry for the late reply.
On Wed, 13 Jan 2016 14:28:18 -0800, Andy Lutomirski wrote:
> [cc: Jean Delvare]
>
> On Tue, Jan 12, 2016 at 6:25 AM, Pali Rohár <pali.rohar@gmail.com> wrote:
> > On Monday 11 January 2016 13:58:20 Andy Lutomirski wrote:
> >> On Sun, Jan 3, 2016 at 6:52 AM, Andy Lutomirski <luto@kernel.org> wrote:
> >> > The dmi_walk function maps the DMI table, walks it, and unmaps it.
> >> > This means that the dell_bios_hotkey_table that find_hk_type stores
> >> > points to unmapped memory by the time it gets read.
> >> >
> >> > I've been able to trigger crashes caused by the stale pointer a
> >> > couple of times, but never on a stock kernel.
> >> >
> >> > Fix it by generating the keymap in the dmi_walk callback instead of
> >> > storing a pointer.
> >>
> >> Quick ping: has anyone had a chance to look at this?
> >
> > Hi Andy, I looked at this patch, but I think some people from -mm or DMI
> > code should look at it as it is memory problem... We also has one in
> > dell-laptop.ko (wrong API usage) and so -mm people could know it better.
>
> Let's ask:
>
> Jean, am I right that drivers must not store pointers to DMI tables
> that they find through dmi_walk?
Yes, you are right.
> Is there any alternative interface
> that could be used to get a longer-lived pointer to DMI tables, or
> should drivers just parse them and copy out any info needed from the
> dmi_walk callback?
There is no alternative for OEM type records. Drivers are indeed
expected to copy the information they need to their own buffers.
> There are at least two platform drivers (dell-wmi and dell-laptop)
> that don't play well with the current interface. This patch is
> intended to fix one of them.
Couldn't see any problem with dell-laptop.
--
Jean Delvare
SUSE L3 Support
next prev parent reply other threads:[~2016-01-15 13:27 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-03 14:52 [PATCH] dell-wmi: Stop storing pointers to DMI tables Andy Lutomirski
2016-01-11 21:58 ` Andy Lutomirski
2016-01-12 14:25 ` Pali Rohár
2016-01-13 22:28 ` Andy Lutomirski
2016-01-14 9:52 ` Michał Kępień
2016-01-15 13:23 ` Jean Delvare
2016-01-15 13:27 ` Jean Delvare [this message]
2016-01-15 16:27 ` Andy Lutomirski
2016-01-15 17:53 ` Jean Delvare
2016-01-15 20:00 ` Andy Lutomirski
2016-01-14 10:29 ` Michał Kępień
2016-01-18 15:44 ` Jean Delvare
2016-01-18 18:09 ` Andy Lutomirski
2016-01-18 18:19 ` Andy Lutomirski
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=20160115142719.36eea015@endymion.delvare \
--to=jdelvare@suse.de \
--cc=jdelvare@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=luto@kernel.org \
--cc=pali.rohar@gmail.com \
--cc=platform-driver-x86@vger.kernel.org \
--cc=stable@vger.kernel.org \
/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