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: <680394fa-b018-a4da-7309-f38730052375@mellanox.com>
Date:   Fri, 8 May 2020 13:29:56 -0700
From:   Mark Bloch <markb@...lanox.com>
To:     Jason Gunthorpe <jgg@...pe.ca>, Leon Romanovsky <leon@...nel.org>
Cc:     Doug Ledford <dledford@...hat.com>,
        Maor Gottlieb <maorg@...lanox.com>, linux-rdma@...r.kernel.org,
        Mark Zhang <markz@...lanox.com>, netdev@...r.kernel.org,
        Saeed Mahameed <saeedm@...lanox.com>
Subject: Re: [PATCH mlx5-next v1 1/4] {IB/net}/mlx5: Simplify don't trap code



On 5/8/2020 12:58, Jason Gunthorpe wrote:
> On Mon, May 04, 2020 at 08:30:09AM +0300, Leon Romanovsky wrote:
>> +	flow_act->action &=
>> +		~MLX5_FLOW_CONTEXT_ACTION_FWD_NEXT_PRIO;
>> +	flow_act->action |= MLX5_FLOW_CONTEXT_ACTION_FWD_DEST;
>> +	handle = _mlx5_add_flow_rules(ft, spec, flow_act, dest, num_dest);
>> +	if (IS_ERR_OR_NULL(handle))
>> +		goto unlock;
> 
> I never like seeing IS_ERR_OR_NULL()..
> 
> In this case I see callers of mlx5_add_flow_rules() that crash if it
> returns NULL, so this can't be right.
> 
> Also, I don't see an obvious place where _mlx5_add_flow_rules()
> returns NULL, does it?

It seems you are right. b3638e1a76648 ("net/mlx5_core: Introduce forward to next priority action")
added that code and it seems from the start it was wrong.

Looking at the code it looks like we always use IS_ERR() to check the result
of mlx5_add_flow_rules() except in: mlx5e_tc_add_nic_flow() which should also
be fixed.

Thanks Jason.

> 
> Jason
> 

Mark

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ