From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: <intel-xe@lists.freedesktop.org>,
Mika Kuoppala <mika.kuoppala@linux.intel.com>
Subject: Re: [PATCH] drm/xe/rtp: Fix out-of-bounds array access
Date: Fri, 28 Jun 2024 14:41:13 -0400 [thread overview]
Message-ID: <Zn8DyRqMDxKr8EWF@intel.com> (raw)
In-Reply-To: <20240628161726.836734-1-lucas.demarchi@intel.com>
On Fri, Jun 28, 2024 at 09:17:26AM -0700, Lucas De Marchi wrote:
> Increment the counter before checking for number of rules, otherwise
> when there's no XE_RTP_MATCH_OR an out-of-bounds access is done, as
> reported by kasan:
>
> BUG: KASAN: global-out-of-bounds in rule_matches+0xb6d/0x11c0 [xe]
> Read of size 1 at addr ffffffffa0a50b70 by task systemd-udevd/243
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
>
> Fixes: dc72c52a42e0 ("drm/xe/rtp: Allow to OR rules")
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
> ---
> drivers/gpu/drm/xe/xe_rtp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_rtp.c b/drivers/gpu/drm/xe/xe_rtp.c
> index 5b27f7c45ea3..02e28274282f 100644
> --- a/drivers/gpu/drm/xe/xe_rtp.c
> +++ b/drivers/gpu/drm/xe/xe_rtp.c
> @@ -121,7 +121,7 @@ static bool rule_matches(const struct xe_device *xe,
> * Advance rules until we find XE_RTP_MATCH_OR to check
> * if there's another set of conditions to check
> */
> - while (i < n_rules && rules[++i].match_type != XE_RTP_MATCH_OR)
> + while (++i < n_rules && rules[i].match_type != XE_RTP_MATCH_OR)
> ;
>
> if (i >= n_rules)
> --
> 2.43.0
>
next prev parent reply other threads:[~2024-06-28 18:41 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-28 16:17 [PATCH] drm/xe/rtp: Fix out-of-bounds array access Lucas De Marchi
2024-06-28 18:41 ` Rodrigo Vivi [this message]
2024-07-01 19:28 ` Lucas De Marchi
2024-07-01 2:19 ` ✓ CI.Patch_applied: success for drm/xe/rtp: Fix out-of-bounds array access (rev2) Patchwork
2024-07-01 2:19 ` ✓ CI.checkpatch: " Patchwork
2024-07-01 2:20 ` ✓ CI.KUnit: " Patchwork
2024-07-01 2:32 ` ✓ CI.Build: " Patchwork
2024-07-01 2:34 ` ✓ CI.Hooks: " Patchwork
2024-07-01 2:35 ` ✓ CI.checksparse: " Patchwork
2024-07-01 2:58 ` ✓ CI.BAT: " Patchwork
2024-07-01 3:59 ` ✗ CI.FULL: failure " Patchwork
2024-07-01 15:58 ` [PATCH] drm/xe/rtp: Fix out-of-bounds array access Nirmoy Das
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=Zn8DyRqMDxKr8EWF@intel.com \
--to=rodrigo.vivi@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=lucas.demarchi@intel.com \
--cc=mika.kuoppala@linux.intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.