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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 26 Apr 2023 11:29:02 +0200
From:   Simon Horman <simon.horman@...igine.com>
To:     Ivan Vecera <ivecera@...hat.com>
Cc:     netdev@...r.kernel.org, Jamal Hadi Salim <jhs@...atatu.com>,
        Cong Wang <xiyou.wangcong@...il.com>,
        Jiri Pirko <jiri@...nulli.us>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        Marcelo Ricardo Leitner <marcelo.leitner@...il.com>,
        Paul Blakey <paulb@...dia.com>,
        open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net] net/sched: flower: Fix wrong handle assignment
 during filter change

On Tue, Apr 25, 2023 at 04:06:04PM +0200, Ivan Vecera wrote:
> Commit 08a0063df3ae ("net/sched: flower: Move filter handle initialization
> earlier") moved filter handle initialization but an assignment of
> the handle to fnew->handle is done regardless of fold value. This is wrong
> because if fold != NULL (so fold->handle == handle) no new handle is
> allocated and passed handle is assigned to fnew->handle. Then if any
> subsequent action in fl_change() fails then the handle value is
> removed from IDR that is incorrect as we will have still valid old filter
> instance with handle that is not present in IDR.
> Fix this issue by moving the assignment so it is done only when passed
> fold == NULL.
> 
> Prior the patch:
> [root@...hine tc-testing]# ./tdc.py -d enp1s0f0np0 -e 14be
> Test 14be: Concurrently replace same range of 100k flower filters from 10 tc instances
> exit: 123
> exit: 0
> RTNETLINK answers: Invalid argument
> We have an error talking to the kernel
> Command failed tmp/replace_6:1885
> 
> 
> All test results:
> 
> 1..1
> not ok 1 14be - Concurrently replace same range of 100k flower filters from 10 tc instances
>         Command exited with 123, expected 0
> RTNETLINK answers: Invalid argument
> We have an error talking to the kernel
> Command failed tmp/replace_6:1885
> 
> After the patch:
> [root@...hine tc-testing]# ./tdc.py -d enp1s0f0np0 -e 14be
> Test 14be: Concurrently replace same range of 100k flower filters from 10 tc instances
> 
> All test results:
> 
> 1..1
> ok 1 14be - Concurrently replace same range of 100k flower filters from 10 tc instances
> 
> Fixes: 08a0063df3ae ("net/sched: flower: Move filter handle initialization earlier")
> Signed-off-by: Ivan Vecera <ivecera@...hat.com>

Reviewed-by: Simon Horman <simon.horman@...igine.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ