lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <27dfa798.18d8b.184c6b28dcc.Coremail.duoming@zju.edu.cn>
Date:   Wed, 30 Nov 2022 12:01:41 +0800 (GMT+08:00)
From:   duoming@....edu.cn
To:     "David Ahern" <dsahern@...nel.org>
Cc:     linux-kernel@...r.kernel.org, davem@...emloft.net,
        yoshfuji@...ux-ipv6.org, edumazet@...gle.com, kuba@...nel.org,
        pabeni@...hat.com, netdev@...r.kernel.org
Subject: Re: [PATCH net] net: Add a gfp_t parameter in ip_fib_metrics_init
 to support atomic context

Hello,

On Tue, 29 Nov 2022 09:33:45 -0700 David Ahern wrote:

> On 11/28/22 10:53 PM, Duoming Zhou wrote:
> > The ip_fib_metrics_init() do not support atomic context, because it
> > calls "kzalloc(..., GFP_KERNEL)". When ip_fib_metrics_init() is used
> > in atomic context, the sleep-in-atomic-context bug will happen.
> 
> Did you actually hit this sleep-in-atomic-context bug or is it theory
> based on code analysis?

Thank your for your reply and suggestions. This is based on code analysis.

> > For example, the neigh_proxy_process() is a timer handler that is
> > used to process the proxy request that is timeout. But it could call
> > ip_fib_metrics_init(). As a result, the can_block flag in ipv6_add_addr()
> > and the gfp_flags in addrconf_f6i_alloc() and ip6_route_info_create()
> > are useless. The process is shown below.
> > 
> >     (atomic context)
> > neigh_proxy_process()
> >   pndisc_redo()
> >     ndisc_recv_ns()
> >       addrconf_dad_failure()
> >         ipv6_add_addr(..., bool can_block)
> >           addrconf_f6i_alloc(..., gfp_t gfp_flags)
> 
> 	cfg has fc_mx == NULL.
> 
> >             ip6_route_info_create(..., gfp_t gfp_flags)
> 
> 	rt->fib6_metrics = ip_fib_metrics_init(net, cfg->fc_mx, cfg->fc_mx_len,
> extack);
> 
> >               ip_fib_metrics_init()
> 
>         if (!fc_mx)
>                 return (struct dst_metrics *)&dst_default_metrics;

I understand it, thank your for your advice.

Best regards,
Duoming Zhou

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ