Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:

Pre-existing issues:
- [High] Memory leak of the netlink message sk_buff in the error path of 
doit_reply_value().
--

--- Patch [1]: [PATCH v6 1/2] drm/drm_ras: Add drm_ras netlink error event ---
commit 71a58eced6bfe5deeec605fb34ee6d129ff7cc14
Author: Riana Tauro <[email protected]>

drm/drm_ras: Add drm_ras netlink error event

This commit introduces a new netlink event error-event and a multicast group
error-report for the drm_ras family. It provides drm_ras_nl_error_event() to
allow drivers to broadcast device, node, and error information to userspace.

> diff --git a/drivers/gpu/drm/drm_ras.c b/drivers/gpu/drm/drm_ras.c
> index d6eab29a1394c..39155fb514de3 100644
> --- a/drivers/gpu/drm/drm_ras.c
> +++ b/drivers/gpu/drm/drm_ras.c

[ ... ]

> +static int msg_put_error_event_attrs(struct sk_buff *msg, struct 
> drm_ras_node *node,
> +                                  u32 error_id, const char *error_name, u32 
> value)
> +{

[ ... ]

> +}
> +
>  static int doit_reply_value(struct genl_info *info, u32 node_id,
>                           u32 error_id)
>  {

[Severity: High]
This is a pre-existing issue, but could this leak the msg buffer?

Looking at doit_reply_value() in drivers/gpu/drm/drm_ras.c, msg is allocated
using genlmsg_new() at the beginning of the function:

        msg = genlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL);
        if (!msg)
                return -ENOMEM;

If get_node_error_counter() fails, the function returns early:

        ret = get_node_error_counter(node_id, error_id,
                                     &error_name, &value);
        if (ret)
                return ret;

Does this error path need to call nlmsg_free(msg) to avoid leaking the sk_buff
each time an invalid node_id or error_id is queried?

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=1

Reply via email to