All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Cc: Stable <stable@vger.kernel.org>,
	linux-block <linux-block@vger.kernel.org>,
	Jens Axboe <axboe@kernel.dk>, Ming Lei <ming.lei@redhat.com>,
	Dmitry Monakhov <dmtrmonakhov@yandex-team.ru>
Subject: Re: [4.19.y] 32-bit overflow in __blkdev_issue_discard()
Date: Thu, 30 Jan 2020 15:27:35 +0100	[thread overview]
Message-ID: <20200130142735.GA963927@kroah.com> (raw)
In-Reply-To: <ad8d7c2d-9bbe-6d2e-db20-d208b5563c09@yandex-team.ru>

On Thu, Jan 30, 2020 at 03:10:42PM +0300, Konstantin Khlebnikov wrote:
> Please consider including into 4.19 upstream commits
> 
> ba5d73851e71847ba7f7f4c27a1a6e1f5ab91c79
> ("block: cleanup __blkdev_issue_discard()")
> 
> and
> 
> 4800bf7bc8c725e955fcbc6191cc872f43f506d3
> ("block: fix 32 bit overflow in __blkdev_issue_discard()")

THis patch does not apply to the 4.19 tree :(

> Overflow of unsigned long "req_sects" (fixed in second patch)
> actually exist here much longer.
> 
> And 4.19 commit 744889b7cbb56a64f957e65ade7cb65fe3f35714
> ("block: don't deal with discard limit in blkdev_issue_discard()")
> make it worse by replacing
> 
> req_sects = min_t(sector_t, nr_sects, q->limits.max_discard_sectors);
> 
> with
> 
> unsigned int req_sects = nr_sects;
> 
> 
> because now discard length isn't cut by max_discard_sectors it easily overflows.
> As a result BLKDISCARD fails unexpectedly:
> 
> ioctl(3, BLKDISCARD, [0, 0x20000000000])  = -1 EOPNOTSUPP (Operation not supported)

I don't understand.  Can you provide backported and working patches for
the 4.19.y series so that I can apply them that way to show exactly what
you have changed here?

thanks,

greg k-h

      reply	other threads:[~2020-01-30 14:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-30 12:10 [4.19.y] 32-bit overflow in __blkdev_issue_discard() Konstantin Khlebnikov
2020-01-30 14:27 ` Greg KH [this message]

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=20200130142735.GA963927@kroah.com \
    --to=greg@kroah.com \
    --cc=axboe@kernel.dk \
    --cc=dmtrmonakhov@yandex-team.ru \
    --cc=khlebnikov@yandex-team.ru \
    --cc=linux-block@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    --cc=stable@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.