Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932192AbbBBCxV (ORCPT ); Sun, 1 Feb 2015 21:53:21 -0500 Received: from linuxhacker.ru ([217.76.32.60]:59820 "EHLO fiona.linuxhacker.ru" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1755281AbbBBCxP (ORCPT ); Sun, 1 Feb 2015 21:53:15 -0500 From: green@linuxhacker.ru To: Greg Kroah-Hartman , devel@driverdev.osuosl.org, Andreas Dilger Cc: Linux Kernel Mailing List , Dmitry Eremin , Oleg Drokin Subject: [PATCH 06/20] staging/lustre: fix comparison between signed and unsigned Date: Sun, 1 Feb 2015 21:52:05 -0500 Message-Id: <1422845539-26742-7-git-send-email-green@linuxhacker.ru> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1422845539-26742-1-git-send-email-green@linuxhacker.ru> References: <1422845539-26742-1-git-send-email-green@linuxhacker.ru> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1402 Lines: 36 From: Dmitry Eremin Expression if (size != (ssize_t)size) is always false. Therefore no bounds check errors detected. Signed-off-by: Dmitry Eremin Reviewed-on: http://review.whamcloud.com/11376 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5417 Reviewed-by: John L. Hammond Reviewed-by: Fan Yong Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/include/lustre/lustre_user.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h index 89794fd..176bd46 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h @@ -1012,7 +1012,7 @@ static inline ssize_t hur_len(struct hsm_user_request *hur) (__u64)hur->hur_request.hr_itemcount * sizeof(hur->hur_user_item[0]) + hur->hur_request.hr_data_len; - if (size != (ssize_t)size) + if (size > ~((size_t)0)>>1) return -1; return size; -- 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/