Page MenuHomeFreeBSD

MFV r268120: 4936 lz4 could theoretically overflow a pointer with a certain input
ClosedPublic

Authored by allanjude on Sep 11 2016, 1:45 AM.
Tags
None
Referenced Files
Unknown Object (File)
May 3 2024, 6:24 PM
Unknown Object (File)
May 3 2024, 8:02 AM
Unknown Object (File)
May 3 2024, 8:02 AM
Unknown Object (File)
Apr 21 2024, 3:41 PM
Unknown Object (File)
Mar 30 2024, 1:51 AM
Unknown Object (File)
Feb 23 2024, 11:37 PM
Unknown Object (File)
Feb 14 2024, 5:08 PM
Unknown Object (File)
Feb 13 2024, 5:15 PM
Subscribers

Details

Reviewers
emaste
avg
delphij
mav
smh
Group Reviewers
ZFS
Commits
rS305701: MFV r268120:
Summary

Somehow r268120 was marked as merged, but the change was lost

Also brings in: "3705 stack overflow due to zfs lz4 compression" for diff reduction
This change is a noop as STACKLIMIT is always 0 on FreeBSD

And fixes a local typo

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

allanjude retitled this revision from to MFV r268120: 4936 lz4 could theoretically overflow a pointer with a certain input.
allanjude updated this object.
allanjude edited the test plan for this revision. (Show Details)
allanjude added reviewers: ZFS, delphij, mav, avg, smh, emaste.

Could you please take a look at my comment inline?

I think the overflow prevention change itself should be landed regardless (and thanks for discovering and merging this), even it's not supposed to happen (because data is validated against their checksums before feeding into decompressor), it is in general a good thing to do to further reduce the chance of having reliability issues found on non-ECC systems.

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c
195 ↗(On Diff #20250)

Why? (this is mainly to avoid stack overflow, and previously we did not get evidence that this would give meaningful performance boost).

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c
195 ↗(On Diff #20250)

Yeah, the setting on IllumOS is now 9 (2**(N+2) = 2kb) for both amd64 and i386 (was 11 and 9 respectively before)

Since the lz4 data is 16kb, I don't think the 'stack mode' ever gets used at all.

The re-arrangement is just to reduce the diff with upstream, when they lowered the value of STACKLIMIT for 64bit from 11 to 9, and moved the define outside of the LZ4_ARCH64 ifdef

The diff against upstream is now:
-#define STACKLIMIT 9
+/* FreeBSD: Use heap for all platforms for now */
+#define STACKLIMIT 0

delphij edited edge metadata.
delphij added inline comments.
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c
195 ↗(On Diff #20250)

Hmm I see, sorry I have misread the code block and the change is correct.

This revision is now accepted and ready to land.Sep 11 2016, 7:01 AM
This revision was automatically updated to reflect the committed changes.