[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20231219150907.9338-1-kuniyu@amazon.com>
Date: Wed, 20 Dec 2023 00:09:07 +0900
From: Kuniyuki Iwashima <kuniyu@...zon.com>
To: <mengkanglai2@...wei.com>
CC: <davem@...emloft.net>, <dsahern@...nel.org>, <edumazet@...gle.com>,
<fengtao40@...wei.com>, <kuba@...nel.org>, <linux-kernel@...r.kernel.org>,
<netdev@...r.kernel.org>, <pabeni@...hat.com>, <yanan@...wei.com>,
<kuniyu@...zon.com>
Subject: Re: [Consult]kernel tcp socket lack of refcnt for net may cause uaf problem?
From: mengkanglai <mengkanglai2@...wei.com>
Date: Tue, 19 Dec 2023 13:44:36 +0000
> Hello, Eric:
>
> I found upstream have fixed a UAF issue (smc: Fix use-after-free in
> tcp_write_timer_handler()):
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9744d2bf19762703704ecba885b7ac282c02eacf
>
> When create a kernel socket use sock_create_kern , it won't call get_net()
> to increase refcnt for net where the socket is located.
> I found some other subsystem(like rds and sunrpc) also use sock_create_kern
> to create kernel tcp socket, I want to know if they have same UAF problem?
You need to check if the subsystem itself holds net refcnt (not per socket)
and if it waits for TCP timer to be fired before destroying a socket.
It seems that runrpc holds net refcnt (xprt_net) and rds holds per-socket
net refcnt.
Powered by blists - more mailing lists