atm: null pointer dereference when both entry and holding_time are NULL.
Subsystems (3)
PATCH 1/1 atm: null pointer dereference when both entry and holding_time are NULL.
From: Minjoong Kim <[email protected]>
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.
--- net/atm/mpc.c | 3 +++ 1 file changed, 3 insertions(+)
net/atm/mpc.c +3 -0
@@ -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);
Signature · 1 line
2.34.1
Simon Horman
reviewerQuoted 10 lines · On Fri, Mar 14, 2025 at 12:34:04AM +0000, [email protected] wrote:
From: Minjoong Kim <[email protected]>
When
MPOA_cache_impos_rcvd()receives the msg, it can trigger Null Pointer Dereference Vulnerability if both entry andholding_timeare NULL. Because there is only for the situation where entry is NULL andholding_timeexists, it can be passed when both entry andholding_timeare NULL. If these are NULL, the entry will be passd toeg_cache_put()as parameter and it is referenced byentry->usecode in it.
Quoted 2 lines
Signed-off-by Minjoong Kim <[email protected]>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?
Paolo Abeni
maintainerQuoted 10 lines · On 3/14/25 1:34 AM, [email protected] wrote:
From: Minjoong Kim <[email protected]>
When
MPOA_cache_impos_rcvd()receives the msg, it can trigger Null Pointer Dereference Vulnerability if both entry andholding_timeare NULL. Because there is only for the situation where entry is NULL andholding_timeexists, it can be passed when both entry andholding_timeare NULL. If these are NULL, the entry will be passd toeg_cache_put()as parameter and it is referenced byentry->usecode in it.
Quoted 2 lines
Signed-off-by Minjoong Kim <[email protected]>Fixes 1da177e4c3f4 ("Linux-2.6.12-rc2")
Please include the full splat for such UaF in the commit message
Quoted 9 lines
--- net/atm/mpc.c | 3 +++ 1 file changed, 3 insertions(+)net/atm/mpc.c +0
-0
net/atm/mpc.c static void MPOA_cache_impos_rcvd(struct k_message *msg, · line 1318
Quoted 5 lines
net/atm/mpc.c +2
-0@@ -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