public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/ras: Introduce the DRM RAS infrastructure over generic netlink
Date: Tue, 24 Feb 2026 10:45:41 +1000	[thread overview]
Message-ID: <review-patch1-20260223060541.526397-8-riana.tauro@intel.com> (raw)
In-Reply-To: <20260223060541.526397-8-riana.tauro@intel.com>

Patch Review

**Uninitialized return value in `drm_ras_nl_list_nodes_dumpit()`:**

> +	int ret;
> +
> +	xa_for_each_start(&drm_ras_xa, id, node, ctx->restart) {
> +		...
> +		genlmsg_end(skb, hdr);
> +	}
> +
> +	if (ret == -EMSGSIZE)
> +		ctx->restart = id;
> +
> +	return ret;

If the xarray is empty, or if `ctx->restart` is past all entries (which can happen on the continuation call after the last batch of entries exactly filled the previous skb), the loop body never executes and `ret` is used uninitialized. This is undefined behavior. `ret` should be initialized to 0 so the function returns 0 (dump complete) when there are no entries to process.

The same issue exists in `drm_ras_nl_get_error_counter_dumpit()` -- if `first > last` or all error IDs return `-ENOENT`, the for loop completes without setting `ret`.

**skb leak in `doit_reply_value()`:**

> +	msg = genlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL);
> +	if (!msg)
> +		return -ENOMEM;
> +
> +	hdr = genlmsg_iput(msg, info);
> +	if (!hdr) {
> +		nlmsg_free(msg);
> +		return -EMSGSIZE;
> +	}
> +
> +	ret = get_node_error_counter(node_id, error_id,
> +				     &error_name, &value);
> +	if (ret)
> +		return ret;

When `get_node_error_counter` fails, the function returns without freeing `msg`. This leaks the skb allocated by `genlmsg_new`. It should do `nlmsg_free(msg)` before returning.

**Self-include in auto-generated header:**

> +#include <uapi/drm/drm_ras.h>
> +#include <drm/drm_ras_nl.h>

`drm_ras_nl.h` includes itself. The header guard prevents infinite recursion so it's harmless, but it's clearly wrong in the auto-generated output. Might indicate a YAML configuration issue (the `kernel-family.headers` includes the generated header itself).

**`netnsok: true` in the genl family:**

> +	.netnsok	= true,

Hardware RAS data is global to the system, not per-network-namespace. Is there a reason to make this namespace-aware? If userspace in a non-init netns can query hardware error counters, that might be undesirable from a security/isolation perspective. Consider whether this should be `false`.

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-02-24  0:45 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-23  6:05 [PATCH v8 0/5] Introduce DRM_RAS using generic netlink for RAS Riana Tauro
2026-02-23  6:05 ` [PATCH v8 1/5] drm/ras: Introduce the DRM RAS infrastructure over generic netlink Riana Tauro
2026-02-24  0:45   ` Claude Code Review Bot [this message]
2026-02-23  6:05 ` [PATCH v8 2/5] drm/xe/xe_drm_ras: Add support for XE DRM RAS Riana Tauro
2026-02-24  0:45   ` Claude review: " Claude Code Review Bot
2026-02-23  6:05 ` [PATCH v8 3/5] drm/xe/xe_hw_error: Integrate DRM RAS with hardware error handling Riana Tauro
2026-02-24  0:45   ` Claude review: " Claude Code Review Bot
2026-02-23  6:05 ` [PATCH v8 4/5] drm/xe/xe_hw_error: Add support for Core-Compute errors Riana Tauro
2026-02-24  0:45   ` Claude review: " Claude Code Review Bot
2026-02-23  6:05 ` [PATCH v8 5/5] drm/xe/xe_hw_error: Add support for PVC SoC errors Riana Tauro
2026-02-24  0:45   ` Claude review: " Claude Code Review Bot
2026-02-24  0:45 ` Claude review: Introduce DRM_RAS using generic netlink for RAS Claude Code Review Bot
  -- strict thread matches above, loose matches on Subject: below --
2026-02-28  8:08 [PATCH v9 0/5] " Riana Tauro
2026-02-28  8:08 ` [PATCH v9 1/5] drm/ras: Introduce the DRM RAS infrastructure over generic netlink Riana Tauro
2026-03-03  4:32   ` Claude review: " Claude Code Review Bot
2026-03-04  7:44 [PATCH v10 0/5] Introduce DRM_RAS using generic netlink for RAS Riana Tauro
2026-03-04  7:44 ` [PATCH v10 1/5] drm/ras: Introduce the DRM RAS infrastructure over generic netlink Riana Tauro
2026-03-05  3:47   ` Claude review: " Claude Code Review Bot

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=review-patch1-20260223060541.526397-8-riana.tauro@intel.com \
    --to=claude-review@example.com \
    --cc=dri-devel-reviews@example.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