From: Ritesh Harjani <riteshh@linux.ibm.com>
To: linux-xfs@vger.kernel.org, linux-ext4@vger.kernel.org
Cc: linux-fsdevel@vger.kernel.org, anju@linux.vnet.ibm.com
Subject: Re: [PATCH] iomap: Fix negative assignment to unsigned sis->pages in iomap_swapfile_activate
Date: Thu, 4 Mar 2021 15:56:47 +0530 [thread overview]
Message-ID: <e5dd2a59-d228-31ee-3f47-e54838c11b4e@linux.ibm.com> (raw)
In-Reply-To: <b39319ab99d9c5541b2cdc172a4b25f39cbaad50.1614838615.git.riteshh@linux.ibm.com>
On 3/4/21 11:51 AM, Ritesh Harjani wrote:
> In case if isi.nr_pages is 0, we are making sis->pages (which is
> unsigned int) a huge value in iomap_swapfile_activate() by assigning -1.
> This could cause a kernel crash in kernel v4.18 (with below signature).
> Or could lead to unknown issues on latest kernel if the fake big swap gets
> used.
>
> Fix this issue by returning -EINVAL in case of nr_pages is 0, since it
> is anyway a invalid swapfile. Looks like this issue will be hit when
> we have pagesize < blocksize type of configuration.
Oops I meant blocksize < pagesize type of configuration.
next prev parent reply other threads:[~2021-03-04 10:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-04 6:21 [PATCH] iomap: Fix negative assignment to unsigned sis->pages in iomap_swapfile_activate Ritesh Harjani
2021-03-04 10:26 ` Ritesh Harjani [this message]
2021-03-04 17:26 ` Darrick J. Wong
2021-03-11 5:57 ` Ritesh Harjani
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=e5dd2a59-d228-31ee-3f47-e54838c11b4e@linux.ibm.com \
--to=riteshh@linux.ibm.com \
--cc=anju@linux.vnet.ibm.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-xfs@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox