From: "Luis R. Rodriguez" <mcgrof@suse.com>
To: Tom Gundersen <teg@jklm.no>
Cc: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>,
Michal Hocko <mhocko@suse.cz>,
Greg KH <gregkh@linuxfoundation.org>,
Julia Lawall <julia.lawall@lip6.fr>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Takashi Iwai <tiwai@suse.de>, Tejun Heo <tj@kernel.org>,
Arjan van de Ven <arjan@linux.intel.com>,
Robert Milasan <rmilasan@suse.com>,
werner@suse.com, Oleg Nesterov <oleg@redhat.com>,
hare <hare@suse.com>, Benjamin Poirier <bpoirier@suse.de>,
Santosh Rastapur <santosh@chelsio.com>,
pmladek@suse.cz, dbueso@suse.com,
LKML <linux-kernel@vger.kernel.org>,
Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
Joseph Salisbury <joseph.salisbury@canonical.com>,
Kay Sievers <kay@vrfy.org>,
One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>,
Tim Gardner <tim.gardner@canonical.com>,
Pierre Fersing <pierre-fersing@pierref.org>,
Andrew Morton <akpm@linux-foundation.org>,
Nagalakshmi
Subject: Re: [PATCH v1 5/5] driver-core: add driver asynchronous probe support
Date: Tue, 30 Sep 2014 09:47:35 +0200 [thread overview]
Message-ID: <20140930074735.GE14081@wotan.suse.de> (raw)
In-Reply-To: <20140930022751.GA14081@wotan.suse.de>
On Tue, Sep 30, 2014 at 04:27:51AM +0200, Luis R. Rodriguez wrote:
> On Sun, Sep 28, 2014 at 07:07:24PM +0200, Tom Gundersen wrote:
> > On Fri, Sep 26, 2014 at 11:57 PM, Luis R. Rodriguez
> > <mcgrof@do-not-panic.com> wrote:
> > > From: "Luis R. Rodriguez" <mcgrof@suse.com>
> > > 0) Not all drivers are killed, the signal is just sent and
> > > the kill will only be acted upoon if the driver you loaded
> > > happens to have some code path that either uses kthreads (which
> > > as of 786235ee are now killable), or uses some code which checks for
> > > fatal_signal_pending() on the kernel somewhere -- i.e: pci_read_vpd().
> >
> > Shouldn't this be seen as something to be fixed in the kernel?
>
> That's a great question. In practice now after CVE-2012-4398 and its series of
> patches added which enabled OOM to kill things followed by 786235ee to also
> handle OOM on kthreads it seems imperative we strive towards this, in practive
> however if you're getting OOMs on boot you have far more serious issue to be
> concerned over than handling CVE-2012-4398. Another issue is that even if we
> wanted to address this a critical right now on module loading driver error
> paths tend to be pretty buggy and we'd probably end up causing more issues than
> fixing anything if the sigkill that triggered this was an arbitrary timeout,
> specially if the timeout is not properly justified.
<-- snip -->
> So extending the kill onto more drivers *because* of the timeout is probably
> not a good reason as it would probably create more issue than fix anything
> right now.
A bit more on this. Tejun had added devres while trying to convert libata to
use iomap but in that process also help address buggy failure paths on drivers [0].
Even with devres in place and devm functions being available they actually
haven't been popularized until recent kernels [1]. There is even further
research on precicely these sorts of errors, such as "Hector: Detecting
Resource-Release Omission Faults in error-handling code for systems software" [2]
but unfortunately there is no data over time. Another paper is "An approach to
improving the structure of error-handling code in the Linux kernel" [3] which
tries to address moving error handling code in the middle of the function to gotos
to shared code at the end of the function...
So we have buggy error paths on drivers and trusting them unfortunately isn't
a good idea at this point. They should be fixed but saying we should equally
kill all drivers right now would likley introduce more issues than anything.
[0] http://lwn.net/Articles/215861/
[1] http://www.slideshare.net/ennael/kernel-recipes-2013?qid=f0888b85-377b-4b29-95c3-f4e59822f5b3&v=default&b=&from_search=6
See slide 6 on graph usage of devm functions over time
[2] http://coccinelle.lip6.fr/papers/dsn2013.pdf
[3] http://coccinelle.lip6.fr/papers/lctes11.pdf
Luis
next prev parent reply other threads:[~2014-09-30 7:47 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1411768637-6809-1-git-send-email-mcgrof@do-not-panic.com>
2014-09-26 21:57 ` [PATCH v1 5/5] driver-core: add driver asynchronous probe support Luis R. Rodriguez
2014-09-28 15:03 ` Tejun Heo
2014-09-29 21:22 ` Luis R. Rodriguez
2014-09-29 21:26 ` Tejun Heo
2014-09-30 7:21 ` Luis R. Rodriguez
2014-10-02 23:29 ` Luis R. Rodriguez
2014-09-29 21:59 ` Greg KH
2014-09-29 22:10 ` Luis R. Rodriguez
2014-09-29 22:24 ` Greg KH
2014-09-28 17:07 ` Tom Gundersen
2014-09-30 2:27 ` Luis R. Rodriguez
2014-09-30 7:47 ` Luis R. Rodriguez [this message]
2014-09-30 9:22 ` Tom Gundersen
2014-09-30 15:24 ` Luis R. Rodriguez
2014-10-02 6:12 ` Tom Gundersen
2014-10-02 20:06 ` Luis R. Rodriguez
2014-10-03 8:23 ` Tom Gundersen
2014-10-03 16:54 ` Luis R. Rodriguez
2014-09-28 19:22 ` Dmitry Torokhov
2014-09-30 7:15 ` Luis R. Rodriguez
2014-10-02 23:31 ` Luis R. Rodriguez
2014-10-03 20:11 ` Luis R. Rodriguez
2014-10-03 21:12 ` Luis R. Rodriguez
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=20140930074735.GE14081@wotan.suse.de \
--to=mcgrof@suse.com \
--cc=akpm@linux-foundation.org \
--cc=arjan@linux.intel.com \
--cc=bpoirier@suse.de \
--cc=dbueso@suse.com \
--cc=dmitry.torokhov@gmail.com \
--cc=gnomes@lxorguk.ukuu.org.uk \
--cc=gregkh@linuxfoundation.org \
--cc=hare@suse.com \
--cc=joseph.salisbury@canonical.com \
--cc=julia.lawall@lip6.fr \
--cc=kay@vrfy.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mcgrof@do-not-panic.com \
--cc=mhocko@suse.cz \
--cc=oleg@redhat.com \
--cc=penguin-kernel@i-love.sakura.ne.jp \
--cc=pierre-fersing@pierref.org \
--cc=pmladek@suse.cz \
--cc=rmilasan@suse.com \
--cc=santosh@chelsio.com \
--cc=teg@jklm.no \
--cc=tim.gardner@canonical.com \
--cc=tiwai@suse.de \
--cc=tj@kernel.org \
--cc=werner@suse.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