From patchwork Sun Mar 1 21:09:29 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: roel kluin X-Patchwork-Id: 23916 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 42CC8DDE19 for ; Mon, 2 Mar 2009 08:09:45 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755170AbZCAVJc (ORCPT ); Sun, 1 Mar 2009 16:09:32 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754956AbZCAVJc (ORCPT ); Sun, 1 Mar 2009 16:09:32 -0500 Received: from nf-out-0910.google.com ([64.233.182.191]:34896 "EHLO nf-out-0910.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754785AbZCAVJb (ORCPT ); Sun, 1 Mar 2009 16:09:31 -0500 Received: by nf-out-0910.google.com with SMTP id d21so463102nfb.21 for ; Sun, 01 Mar 2009 13:09:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:content-type :content-transfer-encoding; bh=Vuh+MK7Ig/3o+au3dAgCY+28YQoK6yQcbSpQ24vYzOU=; b=UYuUTs2jLSrJ4ZgchHVX6Bn4COTp62d3ttf8/1UZaW5qQoUnAF846KKAcnmNwFQ27Y QbgqzW4eFcfow61axv/Pe+vz6uXRxObktNBe8x19rnfBUDlIq7w8kLUuHsLjNAKSsaan 0AZ2x88FuyzgQrYz823Q0U4+TJtzPjQjeqFW4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; b=KMIUnPtySDW9LTrrID9EOcBIFgWSQzCWRy0QCVFF7M5tAkuu52XKHhJoSFDbhaTJsj nMI1rYjaHNP5ghreJcM5sZk9VwoJ55RI4weu8jQ9PpLrnwi9omSk2foKtR4WQ6dXEzkR RcIcCBwu5StF1PsakhLhYs+xwlbGBHSX1uXb4= Received: by 10.210.133.19 with SMTP id g19mr3704515ebd.94.1235941767781; Sun, 01 Mar 2009 13:09:27 -0800 (PST) Received: from ?192.168.1.115? (d133062.upc-d.chello.nl [213.46.133.62]) by mx.google.com with ESMTPS id 5sm4146176eyf.42.2009.03.01.13.09.27 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 01 Mar 2009 13:09:27 -0800 (PST) Message-ID: <49AAF989.8070000@gmail.com> Date: Sun, 01 Mar 2009 22:09:29 +0100 From: Roel Kluin User-Agent: Thunderbird 2.0.0.18 (X11/20081105) MIME-Version: 1.0 To: "David S. Miller" CC: netdev@vger.kernel.org, Andrew Morton Subject: [PATCH] tcp: '< 0' test on unsigned Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org or should this be fixed, with if (!buf || len > x) if so, what should x be? This patch wasn't tested in any way. ------------------------------>8-------------8<--------------------------------- len is unsigned, so the '< 0' test won't work. Signed-off-by: Roel Kluin --- -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/ipv4/tcp_probe.c b/net/ipv4/tcp_probe.c index 25524d4..0b9d63f 100644 --- a/net/ipv4/tcp_probe.c +++ b/net/ipv4/tcp_probe.c @@ -167,7 +167,7 @@ static ssize_t tcpprobe_read(struct file *file, char __user *buf, { int error = 0, cnt = 0; - if (!buf || len < 0) + if (!buf || (ssize_t)len < 0) return -EINVAL; while (cnt < len) {