Skip to content

Commit 6aebf64

Browse files
CIQ Kernel Automationroxanan1996
authored andcommitted
net: atm: fix /proc/net/atm/lec handling
jira VULN-163377 cve CVE-2025-38180 commit-author Eric Dumazet <edumazet@google.com> commit d03b79f /proc/net/atm/lec must ensure safety against dev_lec[] changes. It appears it had dev_put() calls without prior dev_hold(), leading to imbalance and UAF. Fixes: 1da177e ("Linux-2.6.12-rc2") Signed-off-by: Eric Dumazet <edumazet@google.com> Acked-by: Francois Romieu <romieu@fr.zoreil.com> # Minor atm contributor Link: https://patch.msgid.link/20250618140844.1686882-3-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> (cherry picked from commit d03b79f) Signed-off-by: CIQ Kernel Automation <ciq_kernel_automation@ciq.com>
1 parent b38b680 commit 6aebf64

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

net/atm/lec.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,6 @@ static void *lec_itf_walk(struct lec_state *state, loff_t *l)
910910
v = (dev && netdev_priv(dev)) ?
911911
lec_priv_walk(state, l, netdev_priv(dev)) : NULL;
912912
if (!v && dev) {
913-
dev_put(dev);
914913
/* Partial state reset for the next time we get called */
915914
dev = NULL;
916915
}
@@ -934,6 +933,7 @@ static void *lec_seq_start(struct seq_file *seq, loff_t *pos)
934933
{
935934
struct lec_state *state = seq->private;
936935

936+
mutex_lock(&lec_mutex);
937937
state->itf = 0;
938938
state->dev = NULL;
939939
state->locked = NULL;
@@ -951,8 +951,9 @@ static void lec_seq_stop(struct seq_file *seq, void *v)
951951
if (state->dev) {
952952
spin_unlock_irqrestore(&state->locked->lec_arp_lock,
953953
state->flags);
954-
dev_put(state->dev);
954+
state->dev = NULL;
955955
}
956+
mutex_unlock(&lec_mutex);
956957
}
957958

958959
static void *lec_seq_next(struct seq_file *seq, void *v, loff_t *pos)

0 commit comments

Comments
 (0)