From: Andrew Morton <akpm@linux-foundation.org>
To: Daeseok Youn <daeseok.youn@gmail.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] dmapool: remove redundant NULL check for dev in dma_pool_create()
Date: Wed, 30 Apr 2014 14:19:24 -0700 [thread overview]
Message-ID: <20140430141924.8d84f7fdcac3ac3996802aa9@linux-foundation.org> (raw)
In-Reply-To: <20140429025310.GA5913@devel>
On Tue, 29 Apr 2014 11:53:10 +0900 Daeseok Youn <daeseok.youn@gmail.com> wrote:
> "dev" cannot be NULL because it is already checked before
> calling dma_pool_create().
>
> Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
> ---
> If dev can be NULL, it has NULL deferencing when kmalloc_node()
> is called after enabling CONFIG_NUMA.
hm, this is unclear.
The code which handles the dev==NULL case was obviously put there
deliberately, presumably with the intention of permitting drivers to
call dma_pool_create() without a device*. This code is very old.
A lot of drivers call dma_pool_create() (I doubt if you audited all of
them!) and perhaps there are some which use this feature and have never
been run on NUMA hardware.
I think I'll apply the patch anyway because such drivers (if they
exist) probably need some attending to.
I rewrote the changelog thusly:
: "dev" cannot be NULL because it is already checked before calling
: dma_pool_create().
:
: If dev ever was NULL, the code would oops in dev_to_node() after enabling
: CONFIG_NUMA.
:
: It is possible that some driver is using dev==NULL and has never been run
: on a NUMA machine. Such a driver is probably outdated, possibly buggy and
: will need some attention if it starts triggering NULL derefs.
--
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>
next prev parent reply other threads:[~2014-04-30 21:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-29 2:53 Daeseok Youn
2014-04-30 21:19 ` Andrew Morton [this message]
2014-05-01 7:38 ` DaeSeok Youn
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=20140430141924.8d84f7fdcac3ac3996802aa9@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=daeseok.youn@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.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