Skip to content

Raise artificial 4G limit for MaxScanSize#945

Closed
matthias-fratz-bsz wants to merge 0 commit intoCisco-Talos:mainfrom
matthias-fratz-bsz:main
Closed

Raise artificial 4G limit for MaxScanSize#945
matthias-fratz-bsz wants to merge 0 commit intoCisco-Talos:mainfrom
matthias-fratz-bsz:main

Conversation

@matthias-fratz-bsz
Copy link
Contributor

Allows MaxScanSize (only) to be set higher than 4GB on 32-bit systems or using suffixes. (On 64-bit it can already be set beyond 32-bit limits by not using suffixes.) Intended as a fix for #809

Introduces a new Suffix "G" to specify gibibytes for all size options. This isn't terribly useful because there only 1G, 2G and 3G really work, and even "4G" triggers the "too high" message... but it is more consistent.

This code makes 3 assumptions:

  • It is ok to use C99 functions (strtoll) and featuers (long long)
  • We don't want to break the ability to set the other limits higher than 4G on 64-bit systems
  • Limit values are stored in unsigned long int downstream, so they can actually be 64-bit on 64-bit systems.
    That last one may not be true, but if it isn't fulfilled then we can already cause breakage with something like MaxFileSize=10000000000 (nominally 10GB).

Not sure how to test this. It builds on AMD64, but I don't have equipment to test this on i386 or more obscure architectures (esp. ILP64 ones)...

@val-ms
Copy link
Contributor

val-ms commented Aug 3, 2023

What.... I didn't close it..

@val-ms
Copy link
Contributor

val-ms commented Aug 3, 2023

Well I can fix this... but apparently not by re-opening this PR. As I seem to have accidentally deleted the commits from @matthias-fratz-bsz's branch.

Here's a replacement PR with the same commit: #986

Edit: BTW sorry about the confusion. I made a git oopsies on the command line when trying to rebase your main branch with the upstream main branch. I learned something though! Never try to force-push a detached branch to an actual branch. Doesn't work! Anyways...

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.

3 participants