From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755151AbcIVFtZ (ORCPT ); Thu, 22 Sep 2016 01:49:25 -0400 Received: from shards.monkeyblade.net ([184.105.139.130]:54880 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751769AbcIVFtX (ORCPT ); Thu, 22 Sep 2016 01:49:23 -0400 Date: Thu, 22 Sep 2016 01:49:20 -0400 (EDT) Message-Id: <20160922.014920.1225574247564649882.davem@davemloft.net> To: colin.king@canonical.com Cc: hariprasad@chelsio.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] cxgb4: fix signed wrap around when decrementing index idx From: David Miller In-Reply-To: <20160920144846.21765-1-colin.king@canonical.com> References: <20160920144846.21765-1-colin.king@canonical.com> X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Wed, 21 Sep 2016 22:49:23 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin King Date: Tue, 20 Sep 2016 15:48:45 +0100 > From: Colin Ian King > > Change predecrement compare to post decrement compare to avoid an > unsigned integer wrap-around comparison when decrementing idx in > the while loop. > > For example, when idx is zero, the current situation will > predecrement idx in the while loop, wrapping idx to the maximum > signed integer and cause out of bounds reads on rxq_info->msix_tbl[idx]. > > Signed-off-by: Colin Ian King This doesn't apply cleanly to the 'net' tree, please respin.