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: <20240513165747.GT2787@kernel.org>
Date: Mon, 13 May 2024 17:57:47 +0100
From: Simon Horman <horms@...nel.org>
To: Kuniyuki Iwashima <kuniyu@...zon.com>
Cc: "David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Kuniyuki Iwashima <kuni1840@...il.com>,
	Michal Luczaj <mhal@...x.co>, netdev@...r.kernel.org,
	Billy Jheng Bing-Jhong <billy@...rlabs.sg>
Subject: Re: [PATCH v3 net] af_unix: Update unix_sk(sk)->oob_skb under
 sk_receive_queue lock.

On Mon, May 13, 2024 at 10:06:28PM +0900, Kuniyuki Iwashima wrote:

...

> @@ -2666,13 +2681,19 @@ static struct sk_buff *manage_oob(struct sk_buff *skb, struct sock *sk,
>  			} else if (flags & MSG_PEEK) {
>  				skb = NULL;
>  			} else {
> -				skb_unlink(skb, &sk->sk_receive_queue);
> +				__skb_unlink(skb, &sk->sk_receive_queue);
>  				WRITE_ONCE(u->oob_skb, NULL);
> -				if (!WARN_ON_ONCE(skb_unref(skb)))
> -					kfree_skb(skb);
> +				unlinked_skb = skb;
>  				skb = skb_peek(&sk->sk_receive_queue);
>  			}
>  		}
> +
> +		spin_unlock(&sk->sk_receive_queue.lock);
> +
> +		if (unlinked_skb) {
> +			WARN_ON_ONCE(skb_unref(skb));
> +			kfree_skb(skb);

Hi Iwashima-san,

Here skb is kfree'd.

> +		}
>  	}
>  	return skb;

But here it is returned.
This doesn't seem right.

Flagged by Smatch.

>  }

...

-- 
pw-bot: changes-requested

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ