Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp760619img; Wed, 20 Mar 2019 10:17:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqzFS8Y7nxmpc+QL8qpWDc8fsYx5jsEA2BbS2U4KNleTEHlVwQuL9oR/fDI8CsiweTXti5yA X-Received: by 2002:a63:6f46:: with SMTP id k67mr8299675pgc.174.1553102226913; Wed, 20 Mar 2019 10:17:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553102226; cv=none; d=google.com; s=arc-20160816; b=OWaUzp7WYrt3HWmM8D3hY3BY5rbt39RIzJWHowSvvkvQlk2E7OvwMSGu2mpE37V8HQ A+mnn0SmbZZWhBZ9B4BXDloI5FcBXm/b0fs6Oq/YaEM/afUsSrIx1DO2YDFEXWGBscJX Ky8l0f87OHQPH66CXBAFOH2O8T8T9YfCXHBCRg7fiLZYSINXzBkrOz5a3J0hOUYGFl6f shHlZkUyhFqgPkv8hHJvi32ITDzJcY3228mEERQfbbmXtA4dkEbVjDv6KzjpG+Qoyth8 pkbb+a6hWw2jl+zKfdUhJr/UOUMajDHoc7rtq4n6YWy2kvU25RRXkVyGI5kYvf7D9kuM /wZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=Mvhk6rtVHJVICQUF0P7BuyiJZ098OXbl1XCXXquadr4=; b=PHeWy99D/qFWaW1czl2II2HUtfZBW4iMPNfLedYN6z7obVzxfi2DQqORfvImHJMS9C 9LG3vKMdimHNzQkcCHu1sibMQmp0FBFaKqSAQB5JHj22UqmSC7wvaGuy2DXZ9l8VCXkV p8sAeYyzgGwmCUyAesBJ0mRENuQGJcwT+fge5Ax6KaGYOTObOFZ1YKXVnUkm4CFBB9RM D0JtkYiC5PHIFEHeAKq+cVBX4Ekz5hO3H4JsgR2sQRcXQj+vAQE3O39MQEQwcU8XWJ4u QnJjM9qfBG/NuglnnYInvzVnKL6uo+jJWsfxxqp1LRb4h6AYpvfs4yJO9/4PSYM9C2rK t+qQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q72si2042775pfa.163.2019.03.20.10.16.51; Wed, 20 Mar 2019 10:17:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727189AbfCTRPt (ORCPT + 99 others); Wed, 20 Mar 2019 13:15:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33980 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726692AbfCTRPs (ORCPT ); Wed, 20 Mar 2019 13:15:48 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 99C3F300521D; Wed, 20 Mar 2019 17:15:48 +0000 (UTC) Received: from [10.10.122.62] (ovpn-122-62.rdu2.redhat.com [10.10.122.62]) by smtp.corp.redhat.com (Postfix) with ESMTP id D3ED960BE2; Wed, 20 Mar 2019 17:15:47 +0000 (UTC) Subject: Re: [PATCH][next] scsi: target: fix unsigned comparision with less than zero To: Colin King , "Martin K . Petersen" , linux-scsi@vger.kernel.org, target-devel@vger.kernel.org References: <20190320163709.28767-1-colin.king@canonical.com> <5C9274D9.30706@redhat.com> Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org From: Mike Christie Message-ID: <5C927543.2020907@redhat.com> Date: Wed, 20 Mar 2019 12:15:47 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <5C9274D9.30706@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Wed, 20 Mar 2019 17:15:48 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/20/2019 12:14 PM, Mike Christie wrote: > On 03/20/2019 11:37 AM, Colin King wrote: >> From: Colin Ian King >> >> Currently an error return is being assigned to an unsigned >> size_t varianle and then checked if the result is less than >> zero which will always be false. Fix this by making ret > > What kernel version was this made against? > > For Martin's 5.2 queue branch, with these scsi changes it looks like > strlcpy returns a size_t. And then below it looks like we compare the > return value from that function to the buffer size and the max len of > the string we support. We do not seem to check for less than zero. > > My mistake. I was looking at len and not ret. Patch looks ok to me. Reviewed-by: Mike Christie