public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Felipe Contreras <felipe.contreras@nokia.com>
To: Ameya Palande <ameya.palande@nokia.com>
Cc: Omar Ramirez Luna <omar.ramirez@ti.com>,
	Nishanth Menon <nm@ti.com>,
	"deepak.chitriki@ti.com" <deepak.chitriki@ti.com>,
	linux-omap <linux-omap@vger.kernel.org>,
	"x0095840@ti.com" <x0095840@ti.com>
Subject: Re: [PATCH] DSPBRIDGE: Fix memory corruption in DRV_ProcFreeDMMRes
Date: Mon, 15 Feb 2010 17:59:58 +0200	[thread overview]
Message-ID: <20100215155958.GA5458@annwn.felipec.org> (raw)
In-Reply-To: <018f9cad9a346b7a841268f4520a73a98c9cf7c9.1266246072.git.ameya.palande@nokia.com>

On Mon, Feb 15, 2010 at 04:36:31PM +0100, Ameya Palande wrote:
> This patch fixes following issues:
> 
> 1. pDMMRes was dereferenced and modified when it was already freed by
> PROC_Ummap(). This results in memory corruption.
> 
> 2.Instead of passing ulDSPAddr, ulDSPResAddr was passed to PROC_UnMap()
> which will not retrieve correct DMMRes element.

You forgot to mention that this patch applies on top of your previous
reserve resource cleanup patches.

> Signed-off-by: Ameya Palande <ameya.palande@nokia.com>

And:
Signed-off-by: Felipe Contreras <felipe.contreras@nokia.com>

> ---
>  drivers/dsp/bridge/rmgr/drv.c |   15 +++++----------
>  1 files changed, 5 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/dsp/bridge/rmgr/drv.c b/drivers/dsp/bridge/rmgr/drv.c
> index 9d5c077..747b34c 100644
> --- a/drivers/dsp/bridge/rmgr/drv.c
> +++ b/drivers/dsp/bridge/rmgr/drv.c
> @@ -273,11 +273,14 @@ DSP_STATUS  DRV_ProcFreeDMMRes(HANDLE hPCtxt)
>  		pDMMList = pDMMList->next;
>  		if (pDMMRes->dmmAllocated) {
>  			status = PROC_UnMap(pDMMRes->hProcessor,
> -				 (void *)pDMMRes->ulDSPResAddr, pCtxt);
> +				 (void *)pDMMRes->ulDSPAddr, pCtxt);
> +			/*
> +			 * PROC_UnMap has freed pDMMRes pointer, so don't access
> +			 * it now
> +			 */

I don't see the need for this comment on the code.

Cheers.

-- 
Felipe Contreras

  reply	other threads:[~2010-02-15 16:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-15 15:36 [PATCH] DSPBRIDGE: Fix memory corruption in DRV_ProcFreeDMMRes Ameya Palande
2010-02-15 15:59 ` Felipe Contreras [this message]
2010-02-16 12:38   ` Ameya Palande
2010-02-16 17:47     ` Felipe Contreras

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=20100215155958.GA5458@annwn.felipec.org \
    --to=felipe.contreras@nokia.com \
    --cc=ameya.palande@nokia.com \
    --cc=deepak.chitriki@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=omar.ramirez@ti.com \
    --cc=x0095840@ti.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