Bug 66661
Summary: | Possible size overflow in tree-log.c | ||
---|---|---|---|
Product: | File System | Reporter: | Jens Binnewies (fearnop) |
Component: | btrfs | Assignee: | Josef Bacik (josef) |
Status: | RESOLVED CODE_FIX | ||
Severity: | normal | CC: | dsterba, pageexec |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 3.12.2 | Subsystem: | |
Regression: | No | Bisected commit-id: |
Description
Jens Binnewies
2013-12-05 22:28:50 UTC
The bug also exists in the latest kernel 3.12.4. please take a look at this bug. the system is unusable. I don't see how it gets to btrfs_lookup_csums_range, there's skip_csum = true set if block_start is EXTENT_MAP_HOLE: 3373 if (test_bit(EXTENT_FLAG_PREALLOC, &em->flags)) { 3374 skip_csum = true; 3375 btrfs_set_token_file_extent_type(leaf, fi, 3376 BTRFS_FILE_EXTENT_PREALLOC, 3377 &token); 3378 } else { 3379 btrfs_set_token_file_extent_type(leaf, fi, 3380 BTRFS_FILE_EXTENT_REG, 3381 &token); 3382 if (em->block_start == EXTENT_MAP_HOLE) 3383 skip_csum = true; 3384 } ... 3421 if (skip_csum) 3422 return 0; There's no goto that would miss that check, em->block_start is not modified nor is 'em' passed to a function that could modify it. ... 3515 /* block start is already adjusted for the file extent offset. */ 3516 ret = btrfs_lookup_csums_range(log->fs_info->csum_root, 3517 em->block_start + csum_offset, 3518 em->block_start + csum_offset + 3519 csum_len - 1, &ordered_sums, 0); David, it seems that this was indeed a real bug and got only fixed after 3.12 with commit ed9e8af88e2551aaa6bf51d8063a2493e2d71597 in vanilla. It was however never CC'd to -stable... The flow of btrfs patches to stable is not established, usually only the patches that fix serious or visible problems end up there. This bug falls into that category, I'll submit it to stable. Thanks for the report. |