Re: [PATCH] IB/mlx4: prevent undefined shift in set_user_sq_size()

2019-06-11 Thread Dan Carpenter
On Mon, Jun 10, 2019 at 10:28:49AM -0300, Jason Gunthorpe wrote: > On Sat, Jun 08, 2019 at 12:22:31PM +0300, Dan Carpenter wrote: > > The ucmd->log_sq_bb_count is a u8 that comes from the user. If it's > > larger than the number of bits in an int then that's undefined behavior. > > It turns out

Re: [PATCH] IB/mlx4: prevent undefined shift in set_user_sq_size()

2019-06-10 Thread Leon Romanovsky
On Mon, Jun 10, 2019 at 10:28:49AM -0300, Jason Gunthorpe wrote: > On Sat, Jun 08, 2019 at 12:22:31PM +0300, Dan Carpenter wrote: > > The ucmd->log_sq_bb_count is a u8 that comes from the user. If it's > > larger than the number of bits in an int then that's undefined behavior. > > It turns out

Re: [PATCH] IB/mlx4: prevent undefined shift in set_user_sq_size()

2019-06-10 Thread Jason Gunthorpe
On Sat, Jun 08, 2019 at 12:22:31PM +0300, Dan Carpenter wrote: > The ucmd->log_sq_bb_count is a u8 that comes from the user. If it's > larger than the number of bits in an int then that's undefined behavior. > It turns out this doesn't really cause an issue at runtime but it's > still nice to

[PATCH] IB/mlx4: prevent undefined shift in set_user_sq_size()

2019-06-08 Thread Dan Carpenter
The ucmd->log_sq_bb_count is a u8 that comes from the user. If it's larger than the number of bits in an int then that's undefined behavior. It turns out this doesn't really cause an issue at runtime but it's still nice to clean it up. Signed-off-by: Dan Carpenter ---