Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: "Niklas Söderlund" <niklas.soderlund@ragnatech.se>
To: Hyeonjun Hong <hyeonjunhong330@gmail.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Magnus Damm <magnus.damm@gmail.com>,
	linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH 1/2] media: rcar-isp: Account for the header in the ConfigDMA bounds check
Date: Wed, 2 Dec 2026 17:43:42 +0100	[thread overview]
Message-ID: <20261202164342.GI3157946@ragnatech.se> (raw)
In-Reply-To: <20261202163831.743683-1-hyeonjunhong330@gmail.com>

On 2026-12-03 01:38:31 +0900, Hyeonjun Hong wrote:
> Hi Niklas,
> 
> Thanks for the review.
> 
> On 2026-12-02 17:26:45 +0100, Niklas Söderlund wrote:
> > Nice catch, but could you move the magic values to defines, maybe
> > something like,
> >
> > #define RISP_IO_PARAMS_HEADER_SIZE 8
> > #define RISP_IO_PARAMS_MAX_PAIRS ((RISP_IO_PARAMS_BUF_SIZE - RISP_IO_PARAMS_HEADER_SIZE) / 8)

d00h this should have been / 16, not / 8. Maybe add a define for that 
too, RISP_IO_PARAMS_PAIR_SIZE and use that ;-)

> >
> > And use them here?
> 
> Will do in v2. The check then becomes
> 
> 	if (desc->count >= RISP_IO_PARAMS_MAX_PAIRS)
> 		return -ENOMEM;
> 
> and I will also update the comment above RISP_IO_PARAMS_BUF_SIZE, which
> says 2048 pairs.
> 
> One related question, also in the cover letter: risp_core_job_prepare()
> in core.c rejects the buffer if
> 
> 	pairs > (RISP_IO_PARAMS_BUF_SIZE - 8) / 16
> 
> which is 1023, i.e. it counts 16 bytes per pair. Should that become
> RISP_IO_PARAMS_MAX_PAIRS as well? If so I can add a patch for it to v2.

Most likely.

> 
> Thanks,
> Hyeonjun

-- 
Kind Regards,
Niklas Söderlund

  reply	other threads:[~2026-12-02 16:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02 15:17 [PATCH 0/2] media: rcar-isp: Fix ConfigDMA buffer overflow Hyeonjun Hong
2026-12-02 15:17 ` [PATCH 1/2] media: rcar-isp: Account for the header in the ConfigDMA bounds check Hyeonjun Hong
2026-12-02 16:26   ` Niklas Söderlund
2026-12-02 16:38     ` Hyeonjun Hong
2026-12-02 16:43       ` Niklas Söderlund [this message]
2026-12-02 16:52         ` Hyeonjun Hong
2026-12-02 15:17 ` [PATCH 2/2] media: rcar-isp: Fail buffer preparation if the ConfigDMA buffer is full Hyeonjun Hong
2026-12-02 16:31   ` Niklas Söderlund
2026-12-02 16:43     ` Hyeonjun Hong

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=20261202164342.GI3157946@ragnatech.se \
    --to=niklas.soderlund@ragnatech.se \
    --cc=geert+renesas@glider.be \
    --cc=hyeonjunhong330@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=mchehab@kernel.org \
    --cc=stable@vger.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