| To: | xfs@xxxxxxxxxxx |
|---|---|
| Subject: | Re: [PATCH 02/11] xfsprogs: fix integer overflow in xlog_find_verify_cycle |
| From: | Eric Sandeen <sandeen@xxxxxxxxxxx> |
| Date: | Wed, 2 Dec 2015 11:58:29 -0600 |
| Delivered-to: | xfs@xxxxxxxxxxx |
| In-reply-to: | <1449055167-19936-3-git-send-email-t.vivek@xxxxxxxxxxx> |
| References: | <1449055167-19936-1-git-send-email-t.vivek@xxxxxxxxxxx> <1449055167-19936-3-git-send-email-t.vivek@xxxxxxxxxxx> |
| User-agent: | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 |
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@xxxxxxxxxxx>
Coverity-Id: 200684
Reviewed-by: Eric Sandeen <sandeen@xxxxxxxxxx>
> ---
> 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))) {
>
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: [PATCH 01/11] xfsprogs: xfs_io: fix a memory leak in imap_f, Eric Sandeen |
|---|---|
| Next by Date: | 8 Cartoons That Poke Fun at Common IT Issues, GoToAssist |
| Previous by Thread: | [PATCH 02/11] xfsprogs: fix integer overflow in xlog_find_verify_cycle, Vivek Trivedi |
| Next by Thread: | Re: [PATCH 02/11] xfsprogs: fix integer overflow in xlog_find_verify_cycle, Dave Chinner |
| Indexes: | [Date] [Thread] [Top] [All Lists] |