[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CO2PR11MB00884D3E0A999631A0E6E447975D0@CO2PR11MB0088.namprd11.prod.outlook.com>
Date: Tue, 7 Jun 2016 12:16:01 +0000
From: Yuval Mintz <Yuval.Mintz@...gic.com>
To: Dan Carpenter <dan.carpenter@...cle.com>
CC: Ariel Elior <Ariel.Elior@...gic.com>,
Dept-Eng Everest Linux L2 <everest-linux-l2@...gic.com>,
netdev <netdev@...r.kernel.org>,
"kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>
Subject: RE: [patch -next] qed: potential overflow in qed_cxt_src_t2_alloc()
> In the current code "ent_per_page" could be more than "conn_num" making
> "conn_num" negative after the subtraction. In the next iteration through the
> loop then the negative is treated as a very high positive meaning we don't put a
> limit on "ent_num". It could lead to memory corruption.
>
> Fixes: dbb799c39717 ('qed: Initialize hardware for new protocols')
> Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
I don't think we can actually hit an issue here, since the number of iterations
was also calculated based on conn_num, so this can only happen on the last
iteration.
Regardless, yours is the correct way to go. Thanks, Yuval.
Acked-by: Yuval Mintz <Yuval.Mintz@...gic.com>
Powered by blists - more mailing lists