Linux block layer
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <chaitanyak@nvidia.com>
To: Zhong Jinghua <zhongjinghua@huaweicloud.com>,
	"axboe@kernel.dk" <axboe@kernel.dk>
Cc: "linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"willy@infradead.org" <willy@infradead.org>,
	"zhongjinghua@huawei.com" <zhongjinghua@huawei.com>,
	"yi.zhang@huawei.com" <yi.zhang@huawei.com>,
	"yukuai3@huawei.com" <yukuai3@huawei.com>,
	"houtao1@huawei.com" <houtao1@huawei.com>,
	"code@siddh.me" <code@siddh.me>
Subject: Re: [PATCH-next v4] loop: loop_set_status_from_info() check before assignment
Date: Tue, 21 Feb 2023 17:59:50 +0000	[thread overview]
Message-ID: <7b2240e8-6776-9b3e-b054-eeb16d87142b@nvidia.com> (raw)
In-Reply-To: <20230221095027.3656193-1-zhongjinghua@huaweicloud.com>

On 2/21/2023 1:50 AM, Zhong Jinghua wrote:
> From: Zhong Jinghua <zhongjinghua@huawei.com>
> 
> In loop_set_status_from_info(), lo->lo_offset and lo->lo_sizelimit should
> be checked before reassignment, because if an overflow error occurs, the
> original correct value will be changed to the wrong value, and it will not
> be changed back.
> 
> More, the original patch did not solve the problem, the value was set and
> ioctl returned an error, but the subsequent io used the value in the loop
> driver, which still caused an alarm:
> 
> loop_handle_cmd
>   do_req_filebacked
>    loff_t pos = ((loff_t) blk_rq_pos(rq) << 9) + lo->lo_offset;
>    lo_rw_aio
>     cmd->iocb.ki_pos = pos
> 
> Fixes: c490a0b5a4f3 ("loop: Check for overflow while configuring loop")
> Signed-off-by: Zhong Jinghua <zhongjinghua@huawei.com>


Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>

-ck



  reply	other threads:[~2023-02-21 18:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-21  9:50 [PATCH-next v4] loop: loop_set_status_from_info() check before assignment Zhong Jinghua
2023-02-21 17:59 ` Chaitanya Kulkarni [this message]
2023-02-23  3:43 ` Jens Axboe

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=7b2240e8-6776-9b3e-b054-eeb16d87142b@nvidia.com \
    --to=chaitanyak@nvidia.com \
    --cc=axboe@kernel.dk \
    --cc=code@siddh.me \
    --cc=houtao1@huawei.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=willy@infradead.org \
    --cc=yi.zhang@huawei.com \
    --cc=yukuai3@huawei.com \
    --cc=zhongjinghua@huawei.com \
    --cc=zhongjinghua@huaweicloud.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox