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] [thread-next>] [day] [month] [year] [list]
Message-ID: <1f524738-778d-a23c-c0d8-ece6ae4ee909@intel.com>
Date:   Tue, 11 Apr 2023 08:13:14 -0700
From:   Jesse Brandeburg <jesse.brandeburg@...el.com>
To:     Tony Nguyen <anthony.l.nguyen@...el.com>, <davem@...emloft.net>,
        <kuba@...nel.org>, <pabeni@...hat.com>, <edumazet@...gle.com>,
        <netdev@...r.kernel.org>
CC:     Sylwester Dziedziuch <sylwesterx.dziedziuch@...el.com>,
        <maciej.fijalkowski@...el.com>, <magnus.karlsson@...el.com>,
        <ast@...nel.org>, <daniel@...earbox.net>, <hawk@...nel.org>,
        <john.fastabend@...il.com>, <bpf@...r.kernel.org>,
        Piotr Raczynski <piotr.raczynski@...el.com>,
        Andrii Staikov <andrii.staikov@...el.com>,
        Kamil Maziarz <kamil.maziarz@...el.com>,
        George Kuruvinakunnel <george.kuruvinakunnel@...el.com>
Subject: Re: [PATCH net 1/1] i40e: Fix crash when rebuild fails in
 i40e_xdp_setup

On 4/7/2023 2:09 PM, Tony Nguyen wrote:
> From: Sylwester Dziedziuch <sylwesterx.dziedziuch@...el.com>
> 
> When attaching XDP program on i40e driver there was a reset and rebuild
> of the interface to reconfigure the queues for XDP operation.
> If one of the steps of rebuild failed then the interface was left
> in incorrect state that could lead to a crash. If rebuild failed while
> getting capabilities from HW such crash occurs:
> 
> capability discovery failed, err I40E_ERR_ADMIN_QUEUE_TIMEOUT aq_err OK
> BUG: unable to handle kernel NULL pointer dereference at 0000000000000000
> Call Trace:
> ? i40e_reconfig_rss_queues+0x120/0x120 [i40e]
>   dev_xdp_install+0x70/0x100
>   dev_xdp_attach+0x1d7/0x530
>   dev_change_xdp_fd+0x1f4/0x230
>   do_setlink+0x45f/0xf30
>   ? irq_work_interrupt+0xa/0x20
>   ? __nla_validate_parse+0x12d/0x1a0
>   rtnl_setlink+0xb5/0x120
>   rtnetlink_rcv_msg+0x2b1/0x360
>   ? sock_has_perm+0x80/0xa0
>   ? rtnl_calcit.isra.42+0x120/0x120
>   netlink_rcv_skb+0x4c/0x120
>   netlink_unicast+0x196/0x230
>   netlink_sendmsg+0x204/0x3d0
>   sock_sendmsg+0x4c/0x50
>   __sys_sendto+0xee/0x160
>   ? handle_mm_fault+0xc1/0x1e0
>   ? syscall_trace_enter+0x1fb/0x2c0
>   ? __sys_setsockopt+0xd6/0x1d0
>   __x64_sys_sendto+0x24/0x30
>   do_syscall_64+0x5b/0x1a0
>   entry_SYSCALL_64_after_hwframe+0x65/0xca
>   RIP: 0033:0x7f3535d99781
> 
> Fix this by removing reset and rebuild from i40e_xdp_setup and replace it
> by interface down, reconfigure queues and interface up. This way if any
> step fails the interface will remain in a correct state.
> 
> Fixes: 0c8493d90b6b ("i40e: add XDP support for pass and drop actions")
> Signed-off-by: Sylwester Dziedziuch <sylwesterx.dziedziuch@...el.com>
> Signed-off-by: Piotr Raczynski <piotr.raczynski@...el.com>
> Signed-off-by: Andrii Staikov <andrii.staikov@...el.com>
> Signed-off-by: Kamil Maziarz <kamil.maziarz@...el.com>
> Tested-by: George Kuruvinakunnel <george.kuruvinakunnel@...el.com>
> Signed-off-by: Tony Nguyen <anthony.l.nguyen@...el.com>

Big change, but I don't see anything obviously wrong.

Reviewed-by: Jesse Brandeburg <jesse.brandeburg@...el.com>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ