[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z8iWWQS3PJi6HcrZ@pop-os.localdomain>
Date: Wed, 5 Mar 2025 10:22:17 -0800
From: Cong Wang <xiyou.wangcong@...il.com>
To: Jun Yang <juny24602@...il.com>
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH] sched: address a potential NULL pointer dereference in
the GRED scheduler.
On Wed, Mar 05, 2025 at 11:44:10PM +0800, Jun Yang wrote:
> If kzalloc in gred_init returns a NULL pointer, the code follows the
> error handling path, invoking gred_destroy. This, in turn, calls
> gred_offload, where memset could receive a NULL pointer as input,
> potentially leading to a kernel crash.
>
> Signed-off-by: Jun Yang <juny24602@...il.com>
When table->opt is NULL in gred_init(), gred_change_table_def() is not
called yet, so it is not necessary to call ->ndo_setup_tc() in
gred_offload().
Fixes: f25c0515c521 ("net: sched: gred: dynamically allocate tc_gred_qopt_offload")
Reviewed-by: Cong Wang <xiyou.wangcong@...il.com>
Thanks!
Powered by blists - more mailing lists