From: Simon Horman <horms@verge.net.au>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>,
Ulf Hansson <ulf.hansson@linaro.org>,
Magnus Damm <magnus.damm@gmail.com>,
linux-mmc@vger.kernel.org,
Linux-Renesas <linux-renesas-soc@vger.kernel.org>
Subject: Re: [PATCH/RFC 1/5] mmc: renesas-sdhi, tmio: make dma more modular
Date: Tue, 2 May 2017 15:03:11 +0200 [thread overview]
Message-ID: <20170502130311.GA3518@verge.net.au> (raw)
In-Reply-To: <20170502125721.GA3160@verge.net.au>
On Tue, May 02, 2017 at 02:57:23PM +0200, Simon Horman wrote:
> On Tue, May 02, 2017 at 02:01:28PM +0200, Arnd Bergmann wrote:
> > On Tue, May 2, 2017 at 1:15 PM, Simon Horman <horms+renesas@verge.net.au> wrote:
> >
> > > @@ -202,6 +214,15 @@ void tmio_mmc_enable_mmc_irqs(struct tmio_mmc_host *host, u32 i);
> > > void tmio_mmc_disable_mmc_irqs(struct tmio_mmc_host *host, u32 i);
> > > irqreturn_t tmio_mmc_irq(int irq, void *devid);
> > >
> > > +#if IS_ENABLED(CONFIG_MMC_SDHI)
> > > +const struct tmio_mmc_dma_ops *tmio_mmc_get_dma_ops(void);
> > > +#else
> > > +static inline const struct tmio_mmc_dma_ops *tmio_mmc_get_dma_ops(void)
> > > +{
> > > + return NULL;
> > > +}
> > > +#endif
> > > +
> > > static inline char *tmio_mmc_kmap_atomic(struct scatterlist *sg,
> > > unsigned long *flags)
> > > {
> >
> > Here you return a NULL pointer for the operations structure
> >
> > > +
> > > +static inline void tmio_mmc_enable_dma(struct tmio_mmc_host *host, bool enable)
> > > +{
> > > + if (host->dma_ops->enable)
> > > + host->dma_ops->enable(host, enable);
> > > +}
> > >
> >
> > And here you check the ->enable callback but not the dma_ops pointer.
> > In the other callbacks you check the dma_ops pointer but not the callback.
> > Is that intentional? Maybe always check the dma_ops pointer first for
> > consistency, as a NULL operations structure (resulting from a future bug)
> > might lead running user space with kernel privileges.
>
> Thanks for noticing.
>
> I resolved that problem but it seems to have crept back in again.
> I'll check to see how that happened.
I take back my comment above - I fixed a different problem and it looks
like I sent out the latest local patches (phew!).
Regardless, I'll look into the problem you mention with a view to fixing it
in v2.
next prev parent reply other threads:[~2017-05-02 13:03 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-02 11:15 [PATCH/RFC 0/5] mmc: renesas-sdhi: refactor DMA support Simon Horman
2017-05-02 11:15 ` [PATCH/RFC 1/5] mmc: renesas-sdhi, tmio: make dma more modular Simon Horman
2017-05-02 12:01 ` Arnd Bergmann
2017-05-02 12:57 ` Simon Horman
2017-05-02 13:03 ` Simon Horman [this message]
2017-05-02 11:15 ` [PATCH/RFC 2/5] mmc: tmio: rename tmio_mmc_{pio => core}.c Simon Horman
2017-05-02 13:11 ` Wolfram Sang
2017-05-09 13:14 ` Simon Horman
2017-05-02 11:15 ` [PATCH/RFC 3/5] mmc: renesas-sdhi: rename tmio_mmc_dma.c => renesas_sdhi_sys_dmac.c Simon Horman
2017-05-02 11:15 ` [PATCH/RFC 4/5] mmc: renesas-sdhi: rename sh_mobile_sdhi.c => renesas_sdhi_core.c Simon Horman
2017-05-02 11:15 ` [PATCH 5/5] mmc: renesas-sdhi: make renesas_sdhi_sys_dmac main module file Simon Horman
2017-05-02 12:03 ` [PATCH/RFC 0/5] mmc: renesas-sdhi: refactor DMA support Arnd Bergmann
2017-05-09 9:28 ` Simon Horman
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=20170502130311.GA3518@verge.net.au \
--to=horms@verge.net.au \
--cc=arnd@arndb.de \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=ulf.hansson@linaro.org \
--cc=wsa+renesas@sang-engineering.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;
as well as URLs for NNTP newsgroup(s).