lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0c6e0cd5-d975-41cc-824e-10b5e28251a2@linux.dev>
Date:   Mon, 20 Nov 2023 16:43:50 +0000
From:   Vadim Fedorenko <vadim.fedorenko@...ux.dev>
To:     Hao Ge <gehao@...inos.cn>
Cc:     michal.michalik@...el.com, davem@...emloft.net,
        linux-kernel@...r.kernel.org, gehao618@....com,
        arkadiusz.kubalewski@...el.com
Subject: Re: [PATCH] dpll: Fix potential msg memleak in
 dpll_nl_pin_id_get_doit

On 20/11/2023 04:07, Hao Ge wrote:
> We should clean the skb resource if genlmsg_put_reply failed.
> 
> Fixes: 9d71b54b65b1 ("dpll: netlink: Add DPLL framework base functions")
> Signed-off-by: Hao Ge <gehao@...inos.cn>
> ---
>   drivers/dpll/dpll_netlink.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/dpll/dpll_netlink.c b/drivers/dpll/dpll_netlink.c
> index a6dc3997bf5c..54051cd34d43 100644
> --- a/drivers/dpll/dpll_netlink.c
> +++ b/drivers/dpll/dpll_netlink.c
> @@ -1093,9 +1093,10 @@ int dpll_nl_pin_id_get_doit(struct sk_buff *skb, struct genl_info *info)
>   		return -ENOMEM;
>   	hdr = genlmsg_put_reply(msg, info, &dpll_nl_family, 0,
>   				DPLL_CMD_PIN_ID_GET);
> -	if (!hdr)
> +	if (!hdr) {
> +		nlmsg_free(msg);
>   		return -EMSGSIZE;
> -
> +	}
>   	pin = dpll_pin_find_from_nlattr(info);
>   	if (!IS_ERR(pin)) {
>   		ret = dpll_msg_add_pin_handle(msg, pin);

The change seems reasonable, but we have 4 spots of the same problem
in the file, could you please fix all of them in one patch?

pw-bot: cr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ