Re: [PATCH] eCryptfs: infinite loop due to overflow in ecryptfs_write()

From: Cong Wang
Date: Thu Jan 19 2012 - 10:10:07 EST


On 01/19/2012 05:13 PM, Tyler Hicks wrote:
From: Li Wang<liwang@xxxxxxxxxxx>

ecryptfs_write() can enter an infinite loop when truncating a file to a
size larger than 4G. This only happens on architectures where size_t is
represented by 32 bits.

This was caused by a size_t overflow due to it incorrectly being used to
store the result of a calculation which uses potentially large values of
type loff_t.

[tyhicks@xxxxxxxxxxxxx: rewrite subject and commit message]
Signed-off-by: Li Wang<liwang@xxxxxxxxxxx>
Signed-off-by: Yunchuan Wen<wenyunchuan@xxxxxxxxxxxxxx>
Cc: Cong Wang<xiyou.wangcong@xxxxxxxxx>
Cc:<stable@xxxxxxxxxxxxxxx>
Signed-off-by: Tyler Hicks<tyhicks@xxxxxxxxxxxxx>


Tyler, thanks for cleaning this up! Looks pretty good now.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/