Skip to content

ext4: fallocate zero range page size > block size BUG() - #25

Closed
Trucido wants to merge 1 commit into
zen-kernel:4.0/masterfrom
Trucido:4.0/master
Closed

Trucido wants to merge 1 commit into
zen-kernel:4.0/masterfrom
Trucido:4.0/master

Conversation

@Trucido

@Trucido Trucido commented Jun 13, 2015

Copy link
Copy Markdown

Ubuntu just deployed this patch, fedora has had it for awhile, and Debian has it patched it in 4.0-4 (and earlier kernels) Looks like upstream doesn't have it backported to 4.0.5 yet. ( http://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/log/?h=linux-4.0.y )
It's coming in 4.1 though ( https://lkml.org/lkml/2015/4/18/197 ), Proposing to merge in the meantime until upstream fixes it.

CVE-2015-0275 -- Linux kernel: fs: ext4: fallocate zero range page size > block size BUG()
https://security-tracker.debian.org/tracker/CVE-2015-0275
http://www.openwall.com/lists/oss-security/2015/02/23/14
https://bugzilla.redhat.com/show_bug.cgi?id=1193907
http://www.ubuntu.com/usn/usn-2638-1/
https://git.kernel.org/cgit/linux/kernel/git/tytso/ext4.git/commit/?h=dev&id=0f2af21aae11972fa924374ddcf52e88347cf5a8

Currently there is a bug in zero range code which causes zero range
calls to only allocate block aligned portion of the range, while
ignoring the rest in some cases.

In some cases, namely if the end of the range is past isize, we do
attempt to preallocate the last nonaligned block. However this might
cause kernel to BUG() in some carefully designed zero range requests on
setups where page size > block size.

Fix this problem by first preallocating the entire range, including the
nonaligned edges and converting the written extents to unwritten in the
next step. This approach will also give us the advantage of having the
range to be as linearly contiguous as possible.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant