[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89i+KR8AOeLqmXa-dbd3Vv6wWqakv+krd5+c0BUfZ3QSAZQ@mail.gmail.com>
Date: Wed, 18 Jun 2025 19:37:04 -0700
From: Eric Dumazet <edumazet@...gle.com>
To: Francois Romieu <romieu@...zoreil.com>
Cc: "David S . Miller" <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, Simon Horman <horms@...nel.org>, netdev@...r.kernel.org,
eric.dumazet@...il.com
Subject: Re: [PATCH net 2/2] net: atm: fix /proc/net/atm/lec handling
On Wed, Jun 18, 2025 at 4:43 PM Francois Romieu <romieu@...zoreil.com> wrote:
>
> Eric Dumazet <edumazet@...gle.com> :
> > /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: da177e4c3f41 ("Linux-2.6.12-rc2")
> > Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> > ---
> > net/atm/lec.c | 5 +++--
> > 1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/net/atm/lec.c b/net/atm/lec.c
> > index 1e1f3eb0e2ba3cc1caa52e49327cecb8d18250e7..afb8d3eb2185078eb994e70c67d581e6dd96a452 100644
> > --- a/net/atm/lec.c
> > +++ b/net/atm/lec.c
>
> Acked-by: Francois Romieu <romieu@...zoreil.com> # Minor atm contributor
>
> While moving proc handling code from net/atm/proc.c to net/atm/lec.c after
> seq_file conversion back in september 2003, there was a misguided change
> turning:
>
> dev = state->dev ? state->dev : atm_lane_ops->get_lec(state->itf);
>
> into:
>
> dev = state->dev ? state->dev : dev_lec[state->itf];
>
> .get_lec included dev_hold. I didn't notice the change :/
Thanks for doing the archeology work.
Indeed, this came with this change recorded in (
https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git )
commit 4aea2cbff4174dc81a3f7f8a0e07fea75333f8ff
Author: Chas Williams <chas@....nrl.navy.mil>
Date: Thu Sep 25 07:15:41 2003 -0700
[ATM]: Move lan seq_file ops to lec.c [1/3]
Powered by blists - more mailing lists