public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Kees Cook <keescook@chromium.org>
Cc: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>,
	Vinod Koul <vkoul@kernel.org>,
	dmaengine@vger.kernel.org, Sia Jee Heng <jee.heng.sia@intel.com>,
	linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Re: [PATCH] dmaengine: dw-axi-dmac: Do not dereference NULL structure
Date: Mon, 30 Jan 2023 14:52:19 +0200	[thread overview]
Message-ID: <Y9e9gyARKf1nrmgG@smile.fi.intel.com> (raw)
In-Reply-To: <Y9egAuMYM+JyBZ3O@smile.fi.intel.com>

On Mon, Jan 30, 2023 at 12:46:26PM +0200, Andy Shevchenko wrote:
> On Fri, Jan 27, 2023 at 02:36:27PM -0800, Kees Cook wrote:

...

> If you want to fix it properly, the code should be modified like
> 
> 	status = dma_cookie_status(dchan, cookie, txstate);
> 	if (status == DMA_COMPLETE || !txstate) {
> 		if (txstate)
> 			goto out;
> 		return status;
> 	}
> 
> 	...
> 
> out:
> 	dma_set_residue(txstate, bytes);
> 
> 	return status;
> 
> to be in accordance with the Documentation.
> 
> **OR**
> 
> the Documentation should be fixed to tell that if status is DMA_COMPLETE,
> residue is undefined and assumed to be 0.
> 
> Vinod?

Disregard my message. The dma_cookie_status() makes sure it's 0.
Sorry for the noise.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2023-01-30 12:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-27 22:36 [PATCH] dmaengine: dw-axi-dmac: Do not dereference NULL structure Kees Cook
2023-01-30 10:46 ` Andy Shevchenko
2023-01-30 12:52   ` Andy Shevchenko [this message]
2023-01-30 12:52 ` Andy Shevchenko
2023-02-10  6:10 ` Vinod Koul

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=Y9e9gyARKf1nrmgG@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=Eugeniy.Paltsev@synopsys.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=jee.heng.sia@intel.com \
    --cc=keescook@chromium.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vkoul@kernel.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