From: Herbert Xu <herbert@gondor.apana.org.au>
To: xiakaixu <xiakaixu@huawei.com>
Cc: davem@davemloft.net, tytso@mit.edu, jaegeuk@kernel.org,
nhorman@tuxdriver.com, ard.biesheuvel@linaro.org, mh1@iki.fi,
linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
Bintian <bintian.wang@huawei.com>,
liushuoran@huawei.com, Huxinwei <huxinwei@huawei.com>,
zhangzhibin.zhang@huawei.com
Subject: Re: Kernel panic - encryption/decryption failed when open file on Arm64
Date: Thu, 8 Sep 2016 20:47:09 +0800 [thread overview]
Message-ID: <20160908124709.GA26586@gondor.apana.org.au> (raw)
In-Reply-To: <57D15BD3.40903@huawei.com>
On Thu, Sep 08, 2016 at 08:38:43PM +0800, xiakaixu wrote:
> Hi,
>
> I am using the encryption/decryption feature on arm64 board and a kernel
> panic occurs just when open a file. As the memory size of the board
> is limited
> and there are some page allocation failures before the panic.
>
> Seems it is a kernel bug from the call trace log.
>
> ...
> - fscrypt_get_encryption_info
> - get_crypt_info.part.1
> - validate_user_key.isra.0
> - derive_aes_gcm_key
> - crypto_gcm_decrypt
> - ablk_decrypt
> - ctr_encrypt
> - blkcipher_walk_done
> - blkcipher_walk_next
> - __get_free_pages
> ----------------------------------> page allocation failure
> ...
> - aes_ctr_encrypt
> -----------------------------------------> the input parameter is
> NULL pointer as the page allocation failure
>
>
> The input parameter of function aes_ctr_encrypt() comes from the
> /struct blkcipher_walk//
> //walk/, and this variable /walk /is allocated by the function
> __get_free_pages(). So if this
> page allocate failed, the input parameter of function
> aes_ctr_encrypt() will be NULL. The
> panic will occurs if we don't check the input parameter.
>
> Not sure about this and wish to get your opinions!
If the page allocation fails in blkcipher_walk_next it'll simply
switch over to processing it block by block. so I don't think the
warning is related to the crash.
Cheers,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
next parent reply other threads:[~2016-09-08 12:47 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <57D15BD3.40903@huawei.com>
2016-09-08 12:47 ` Herbert Xu [this message]
2016-09-09 4:08 ` xiakaixu
2016-09-09 10:19 ` xiakaixu
2016-09-09 10:31 ` Ard Biesheuvel
2016-09-09 10:56 ` Ard Biesheuvel
2016-09-12 2:16 ` liushuoran
2016-09-12 17:40 ` Ard Biesheuvel
2016-09-13 2:05 ` xiakaixu
2016-09-13 6:43 ` Herbert Xu
2016-09-13 7:56 ` Ard Biesheuvel
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=20160908124709.GA26586@gondor.apana.org.au \
--to=herbert@gondor.apana.org.au \
--cc=ard.biesheuvel@linaro.org \
--cc=bintian.wang@huawei.com \
--cc=davem@davemloft.net \
--cc=huxinwei@huawei.com \
--cc=jaegeuk@kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liushuoran@huawei.com \
--cc=mh1@iki.fi \
--cc=nhorman@tuxdriver.com \
--cc=tytso@mit.edu \
--cc=xiakaixu@huawei.com \
--cc=zhangzhibin.zhang@huawei.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
all inboxes | Powered by JetHome®