All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bin Meng <bmeng.cn@gmail.com>
To: u-boot@lists.denx.de
Subject: [PATCH] virtio_blk: set log2blksz correctly
Date: Wed, 19 Aug 2020 17:38:47 +0800	[thread overview]
Message-ID: <CAEUhbmXXG+DR9F44jFPwvkztTy509wduE-GxcTh2ZxRueLKjDQ@mail.gmail.com> (raw)
In-Reply-To: <20200819090732.155299-1-takahiro.akashi@linaro.org>

On Wed, Aug 19, 2020 at 5:08 PM AKASHI Takahiro
<takahiro.akashi@linaro.org> wrote:
>
> 'log2blksz' in blk_desc structure must always be initialized, otherwise
> it will cause a lot of weird failures in file operations.
>
> For example, fs_set_blk_dev[_with_part]() examines a block device against
> every file system with its probe function. In particular, ext4 file
> system's ext4_probe() will calls fs_devread() to fetch a super block.
> If log2blksz is 0, the actual 'read' size, i.e. block_len >> log2blksz, is
> much bigger than a buffer's size, and it can end up with memory corruption.
>
> Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
> Fixes: f4802209e59d ("virtio: Add block driver support")
> ---
>  drivers/virtio/virtio_blk.c | 1 +
>  1 file changed, 1 insertion(+)
>

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

  reply	other threads:[~2020-08-19  9:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-19  9:07 [PATCH] virtio_blk: set log2blksz correctly AKASHI Takahiro
2020-08-19  9:38 ` Bin Meng [this message]
2020-08-25 12:16 ` Tom Rini

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=CAEUhbmXXG+DR9F44jFPwvkztTy509wduE-GxcTh2ZxRueLKjDQ@mail.gmail.com \
    --to=bmeng.cn@gmail.com \
    --cc=u-boot@lists.denx.de \
    /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.