[PATCH 02/11] xfsprogs: fix integer overflow in xlog_find_verify_cycle
Eric Sandeen
sandeen at sandeen.net
Wed Dec 2 11:58:29 CST 2015
On 12/2/15 5:19 AM, Vivek Trivedi wrote:
> Fix unintentional integer overflow in xlog_find_verify_cycle.
> Reported by coverity.
>
> Signed-off-by: Vivek Trivedi <t.vivek at samsung.com>
Coverity-Id: 200684
Reviewed-by: Eric Sandeen <sandeen at redhat.com>
> ---
> libxlog/xfs_log_recover.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libxlog/xfs_log_recover.c b/libxlog/xfs_log_recover.c
> index ef7cf68..73f4d36 100644
> --- a/libxlog/xfs_log_recover.c
> +++ b/libxlog/xfs_log_recover.c
> @@ -254,7 +254,7 @@ xlog_find_verify_cycle(
> * try a smaller size. We need to be able to read at least
> * a log sector, or we're out of luck.
> */
> - bufblks = 1 << ffs(nbblks);
> + bufblks = (xfs_daddr_t)1 << ffs(nbblks);
> while (bufblks > log->l_logBBsize)
> bufblks >>= 1;
> while (!(bp = xlog_get_bp(log, bufblks))) {
>
More information about the xfs
mailing list