From: Mike Christie <mchristi@redhat.com>
To: Colin King <colin.king@canonical.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
linux-scsi@vger.kernel.org, target-devel@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][next] scsi: target: fix unsigned comparision with less than zero
Date: Wed, 20 Mar 2019 17:15:47 +0000 [thread overview]
Message-ID: <5C927543.2020907@redhat.com> (raw)
In-Reply-To: <5C9274D9.30706@redhat.com>
On 03/20/2019 12:14 PM, Mike Christie wrote:
> On 03/20/2019 11:37 AM, Colin King wrote:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> 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 <mchristi@redhat.com>
WARNING: multiple messages have this Message-ID (diff)
From: Mike Christie <mchristi@redhat.com>
To: Colin King <colin.king@canonical.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
linux-scsi@vger.kernel.org, target-devel@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][next] scsi: target: fix unsigned comparision with less than zero
Date: Wed, 20 Mar 2019 12:15:47 -0500 [thread overview]
Message-ID: <5C927543.2020907@redhat.com> (raw)
In-Reply-To: <5C9274D9.30706@redhat.com>
On 03/20/2019 12:14 PM, Mike Christie wrote:
> On 03/20/2019 11:37 AM, Colin King wrote:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> 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 <mchristi@redhat.com>
next prev parent reply other threads:[~2019-03-20 17:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-20 16:37 [PATCH][next] scsi: target: fix unsigned comparision with less than zero Colin King
2019-03-20 17:14 ` Mike Christie
2019-03-20 17:14 ` Mike Christie
2019-03-20 17:14 ` Colin Ian King
2019-03-20 17:15 ` Mike Christie [this message]
2019-03-20 17:15 ` Mike Christie
2019-03-21 0:33 ` Martin K. Petersen
2019-03-21 0:33 ` Martin K. Petersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5C927543.2020907@redhat.com \
--to=mchristi@redhat.com \
--cc=colin.king@canonical.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=target-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.