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: <20250924184451.GT836419@horms.kernel.org>
Date: Wed, 24 Sep 2025 19:44:51 +0100
From: Simon Horman <horms@...nel.org>
To: Deepak Sharma <deepak.sharma.472935@...il.com>
Cc: davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
	pabeni@...hat.com, pwn9uin@...il.com, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	syzbot+07b635b9c111c566af8b@...kaller.appspotmail.com
Subject: Re: [PATCH] Fix the cleanup on alloc_mpc failure in
 atm_mpoa_mpoad_attach

On Tue, Sep 23, 2025 at 06:54:27PM +0530, Deepak Sharma wrote:
> Syzbot reported a warning at `add_timer`, which is called from the
> `atm_mpoa_mpoad_attach` function
> 
> The reason for this warning is that in the allocation failure by `alloc_mpc`,
> there is lack of proper cleanup. And in the event that ATMMPC_CTRL ioctl is
> called on to again, it will lead to the attempt of starting an already 
> started timer from the previous ioctl call
> 
> Do a `timer_delete` before returning from the `alloc_mpc` failure
> 
> Reported-by: syzbot+07b635b9c111c566af8b@...kaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=07b635b9c111c566af8b
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Signed-off-by: Deepak Sharma <deepak.sharma.472935@...il.com>
> ---
>  net/atm/mpc.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/net/atm/mpc.c b/net/atm/mpc.c
> index f6b447bba329..cd3295c3c480 100644
> --- a/net/atm/mpc.c
> +++ b/net/atm/mpc.c
> @@ -814,7 +814,10 @@ static int atm_mpoa_mpoad_attach(struct atm_vcc *vcc, int arg)
>  		dprintk("allocating new mpc for itf %d\n", arg);
>  		mpc = alloc_mpc();
>  		if (mpc == NULL)
> +		{

Sorry for not mentioning this in my previous email.

The preferred coding style is:

		if (mpc == NULL) {

> +			timer_delete(&mpc_timer);
>  			return -ENOMEM;
> +		}
>  		mpc->dev_num = arg;
>  		mpc->dev = find_lec_by_itfnum(arg);
>  					/* NULL if there was no lec */

-- 
pw-bot: changes-requested

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ