From: Dave Jones <davej@redhat.com>
To: Theodore Ts'o <tytso@mit.edu>,
Dan Carpenter <dan.carpenter@oracle.com>,
Andrew Morton <akpm@linux-foundation.org>,
Jiri Kosina <jkosina@suse.cz>, Christoph Lameter <cl@linux.com>,
Pekka Enberg <penberg@kernel.org>,
David Rientjes <rientjes@google.com>,
Joonsoo Kim <iamjoonsoo.kim@lge.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH] mm/sl[aou]b: make kfree() aware of error pointers
Date: Wed, 10 Sep 2014 10:27:12 -0400 [thread overview]
Message-ID: <20140910142712.GA10785@redhat.com> (raw)
In-Reply-To: <20140910135649.GB31903@thunk.org>
On Wed, Sep 10, 2014 at 09:56:49AM -0400, Theodore Ts'o wrote:
> The ironic thing is that I asked Dan to add the feature to smatch
> because I found two such bugs in ext4, and I suspected there would be
> more. Sure enough, it found four more such bugs, including two in a
> recent commit where I had found the first two bugs --- and I had
> missed the other two even though I was specifically looking for such
> instances. Oops. :-)
>
> Maybe we can add a debugging config option? I think having static
> checkers plus some kmalloc failure testing should be sufficient to
> prevent these sorts of problem from showing up.
>
> It would seem to me that this is the sort of thing that a static
> checker should find reliably; Coverity has found things that were more
> complex than what this should require, I think. I don't know if they
> would be willing to add something this kernel-specific, though. (I've
> added Dave Jones to the thread since he's been working a lot with
> Coverity; Dave, what do you think?)
It *might* be possible to rig up something using their modelling
functionality, but I've not managed to make that work to my ends in the past.
I suspect a runtime check would be more fruitful faster than they could
implement kernel specific checkers & roll them out.
Dave
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
WARNING: multiple messages have this Message-ID (diff)
From: Dave Jones <davej@redhat.com>
To: "Theodore Ts'o" <tytso@mit.edu>,
Dan Carpenter <dan.carpenter@oracle.com>,
Andrew Morton <akpm@linux-foundation.org>,
Jiri Kosina <jkosina@suse.cz>, Christoph Lameter <cl@linux.com>,
Pekka Enberg <penberg@kernel.org>,
David Rientjes <rientjes@google.com>,
Joonsoo Kim <iamjoonsoo.kim@lge.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH] mm/sl[aou]b: make kfree() aware of error pointers
Date: Wed, 10 Sep 2014 10:27:12 -0400 [thread overview]
Message-ID: <20140910142712.GA10785@redhat.com> (raw)
In-Reply-To: <20140910135649.GB31903@thunk.org>
On Wed, Sep 10, 2014 at 09:56:49AM -0400, Theodore Ts'o wrote:
> The ironic thing is that I asked Dan to add the feature to smatch
> because I found two such bugs in ext4, and I suspected there would be
> more. Sure enough, it found four more such bugs, including two in a
> recent commit where I had found the first two bugs --- and I had
> missed the other two even though I was specifically looking for such
> instances. Oops. :-)
>
> Maybe we can add a debugging config option? I think having static
> checkers plus some kmalloc failure testing should be sufficient to
> prevent these sorts of problem from showing up.
>
> It would seem to me that this is the sort of thing that a static
> checker should find reliably; Coverity has found things that were more
> complex than what this should require, I think. I don't know if they
> would be willing to add something this kernel-specific, though. (I've
> added Dave Jones to the thread since he's been working a lot with
> Coverity; Dave, what do you think?)
It *might* be possible to rig up something using their modelling
functionality, but I've not managed to make that work to my ends in the past.
I suspect a runtime check would be more fruitful faster than they could
implement kernel specific checkers & roll them out.
Dave
next prev parent reply other threads:[~2014-09-10 14:27 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-09 21:25 [PATCH] mm/sl[aou]b: make kfree() aware of error pointers Jiri Kosina
2014-09-09 21:25 ` Jiri Kosina
2014-09-09 23:21 ` Andrew Morton
2014-09-09 23:21 ` Andrew Morton
2014-09-10 5:05 ` Jiri Kosina
2014-09-10 5:05 ` Jiri Kosina
2014-09-10 5:11 ` Andrew Morton
2014-09-10 5:11 ` Andrew Morton
2014-09-10 6:36 ` Dan Carpenter
2014-09-10 6:36 ` Dan Carpenter
2014-09-10 13:56 ` Theodore Ts'o
2014-09-10 13:56 ` Theodore Ts'o
2014-09-10 14:27 ` Dave Jones [this message]
2014-09-10 14:27 ` Dave Jones
2014-09-10 14:07 ` Theodore Ts'o
2014-09-10 14:07 ` Theodore Ts'o
2014-09-10 14:24 ` Jiri Kosina
2014-09-10 14:24 ` Jiri Kosina
2014-09-10 14:33 ` Andrey Ryabinin
2014-09-10 14:33 ` Andrey Ryabinin
2014-09-10 14:42 ` Jiri Kosina
2014-09-10 14:42 ` Jiri Kosina
2014-09-10 15:43 ` Christoph Lameter
2014-09-10 15:43 ` Christoph Lameter
2014-09-10 14:26 ` Jiri Kosina
2014-09-10 14:26 ` Jiri Kosina
2014-09-10 15:21 ` Dan Carpenter
2014-09-10 15:21 ` Dan Carpenter
2014-09-10 15:28 ` Jiri Kosina
2014-09-10 15:28 ` Jiri Kosina
2014-09-10 15:53 ` Dan Carpenter
2014-09-10 15:53 ` Dan Carpenter
2014-09-10 19:40 ` Theodore Ts'o
2014-09-10 19:40 ` Theodore Ts'o
2014-09-11 14:14 ` Rasmus Villemoes
2014-09-11 14:14 ` Rasmus Villemoes
2014-09-10 14:22 ` Christoph Lameter
2014-09-10 14:22 ` Christoph Lameter
2014-09-10 5:15 ` Valdis.Kletnieks
2014-09-10 6:51 ` Dan Carpenter
2014-09-10 6:51 ` Dan Carpenter
2014-09-10 13:59 ` Christoph Lameter
2014-09-10 13:59 ` Christoph Lameter
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=20140910142712.GA10785@redhat.com \
--to=davej@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=cl@linux.com \
--cc=dan.carpenter@oracle.com \
--cc=iamjoonsoo.kim@lge.com \
--cc=jkosina@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=penberg@kernel.org \
--cc=rientjes@google.com \
--cc=tytso@mit.edu \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.