* [PATCH net] atm: null pointer dereference when both entry and holding_time are NULL.
@ 2025-03-14 0:34 pwn9uin
2025-03-19 12:03 ` Simon Horman
2025-03-20 9:36 ` Paolo Abeni
0 siblings, 2 replies; 3+ messages in thread
From: pwn9uin @ 2025-03-14 0:34 UTC (permalink / raw)
To: David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: Simon Horman, netdev, Minjoong Kim
From: Minjoong Kim <alswnd4123@outlook.kr>
When MPOA_cache_impos_rcvd() receives the msg, it can trigger
Null Pointer Dereference Vulnerability if both entry and
holding_time are NULL. Because there is only for the situation
where entry is NULL and holding_time exists, it can be passed
when both entry and holding_time are NULL. If these are NULL,
the entry will be passd to eg_cache_put() as parameter and
it is referenced by entry->use code in it.
Signed-off-by: Minjoong Kim <alswnd4123@outlook.kr>
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
---
net/atm/mpc.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/atm/mpc.c b/net/atm/mpc.c
index 324e3ab96bb3..7fb854ea47dc 100644
--- a/net/atm/mpc.c
+++ b/net/atm/mpc.c
@@ -1314,6 +1314,9 @@ static void MPOA_cache_impos_rcvd(struct k_message *msg,
holding_time = msg->content.eg_info.holding_time;
dprintk("(%s) entry = %p, holding_time = %u\n",
mpc->dev->name, entry, holding_time);
+ if (entry == NULL && !holding_time) {
+ return;
+ }
if (entry == NULL && holding_time) {
entry = mpc->eg_ops->add_entry(msg, mpc);
mpc->eg_ops->put(entry);
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH net] atm: null pointer dereference when both entry and holding_time are NULL.
2025-03-14 0:34 [PATCH net] atm: null pointer dereference when both entry and holding_time are NULL pwn9uin
@ 2025-03-19 12:03 ` Simon Horman
2025-03-20 9:36 ` Paolo Abeni
1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2025-03-19 12:03 UTC (permalink / raw)
To: pwn9uin
Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
netdev, Minjoong Kim
On Fri, Mar 14, 2025 at 12:34:04AM +0000, pwn9uin@gmail.com wrote:
> From: Minjoong Kim <alswnd4123@outlook.kr>
>
> When MPOA_cache_impos_rcvd() receives the msg, it can trigger
> Null Pointer Dereference Vulnerability if both entry and
> holding_time are NULL. Because there is only for the situation
> where entry is NULL and holding_time exists, it can be passed
> when both entry and holding_time are NULL. If these are NULL,
> the entry will be passd to eg_cache_put() as parameter and
> it is referenced by entry->use code in it.
>
> Signed-off-by: Minjoong Kim <alswnd4123@outlook.kr>
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Hi,
I agree this is a theoretical possibility, but can it occur in practice?
Have you observed this problem? I think some analysis of that is warranted.
Also, Smatch tells me that there is a potential dereference of mpc while
NULL. Perhaps you could look at making a patch for that too?
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH net] atm: null pointer dereference when both entry and holding_time are NULL.
2025-03-14 0:34 [PATCH net] atm: null pointer dereference when both entry and holding_time are NULL pwn9uin
2025-03-19 12:03 ` Simon Horman
@ 2025-03-20 9:36 ` Paolo Abeni
1 sibling, 0 replies; 3+ messages in thread
From: Paolo Abeni @ 2025-03-20 9:36 UTC (permalink / raw)
To: pwn9uin, David S . Miller, Eric Dumazet, Jakub Kicinski
Cc: Simon Horman, netdev, Minjoong Kim
On 3/14/25 1:34 AM, pwn9uin@gmail.com wrote:
> From: Minjoong Kim <alswnd4123@outlook.kr>
>
> When MPOA_cache_impos_rcvd() receives the msg, it can trigger
> Null Pointer Dereference Vulnerability if both entry and
> holding_time are NULL. Because there is only for the situation
> where entry is NULL and holding_time exists, it can be passed
> when both entry and holding_time are NULL. If these are NULL,
> the entry will be passd to eg_cache_put() as parameter and
> it is referenced by entry->use code in it.
>
> Signed-off-by: Minjoong Kim <alswnd4123@outlook.kr>
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Please include the full splat for such UaF in the commit message
> ---
> net/atm/mpc.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/net/atm/mpc.c b/net/atm/mpc.c
> index 324e3ab96bb3..7fb854ea47dc 100644
> --- a/net/atm/mpc.c
> +++ b/net/atm/mpc.c
> @@ -1314,6 +1314,9 @@ static void MPOA_cache_impos_rcvd(struct k_message *msg,
> holding_time = msg->content.eg_info.holding_time;
> dprintk("(%s) entry = %p, holding_time = %u\n",
> mpc->dev->name, entry, holding_time);
> + if (entry == NULL && !holding_time) {
> + return;
Brackets are unneeded here.
Thanks,
Paolo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-03-20 9:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-14 0:34 [PATCH net] atm: null pointer dereference when both entry and holding_time are NULL pwn9uin
2025-03-19 12:03 ` Simon Horman
2025-03-20 9:36 ` Paolo Abeni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).