diff options
| author | David Sterba <[email protected]> | 2023-01-24 19:32:10 +0000 |
|---|---|---|
| committer | David Sterba <[email protected]> | 2023-01-27 13:57:05 +0000 |
| commit | 33e17b3f5ab74af12aca58c515bc8424ff69a343 (patch) | |
| tree | 90cbfd5d60eeabb66ea37bbc9ccb10e5eae62846 /fs/btrfs/tree-log.h | |
| parent | btrfs: zlib: zero-initialize zlib workspace (diff) | |
| download | kernel-33e17b3f5ab74af12aca58c515bc8424ff69a343.tar.gz kernel-33e17b3f5ab74af12aca58c515bc8424ff69a343.zip | |
btrfs: send: limit number of clones and allocated memory size
The arg->clone_sources_count is u64 and can trigger a warning when a
huge value is passed from user space and a huge array is allocated.
Limit the allocated memory to 8MiB (can be increased if needed), which
in turn limits the number of clone sources to 8M / sizeof(struct
clone_root) = 8M / 40 = 209715. Real world number of clones is from
tens to hundreds, so this is future proof.
Reported-by: [email protected]
Signed-off-by: David Sterba <[email protected]>
Diffstat (limited to 'fs/btrfs/tree-log.h')
0 files changed, 0 insertions, 0 deletions
