[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YKNnSvn+42uZwEJZ@unreal>
Date: Tue, 18 May 2021 10:05:46 +0300
From: Leon Romanovsky <leon@...nel.org>
To: Jason Gunthorpe <jgg@...dia.com>
Cc: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>,
yishaih@...dia.com, dledford@...hat.com,
linux-rdma@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] RDMA/mlx4: Remove unnessesary check in
mlx4_ib_modify_wq()
On Tue, May 11, 2021 at 02:43:02PM -0300, Jason Gunthorpe wrote:
> On Fri, May 07, 2021 at 06:22:41PM +0800, Jiapeng Chong wrote:
> > cur_state and new_state are enums and when GCC considers
> > them as unsigned, the conditions are never met.
>
> But doesn't gcc consider enums to be 'int' as the standard requires?
Ohh, I missed that.
>
> This change looks really sketchy to me, cur_state and new_state are
> both userspace controlled data. We should not make assumptions about
> the underlying signedness of an enum when validating user data.
I still think that the right change should be in
ib_uverbs_ex_modify_wq(), so both mlx4 and mlx5 will be protected.
Thanks
>
> Jason
Powered by blists - more mailing lists