]> git.ipfire.org Git - thirdparty/qemu.git/commit
virtiofsd: stay below fs.file-max sysctl value (CVE-2020-10717)
authorStefan Hajnoczi <stefanha@redhat.com>
Fri, 1 May 2020 14:06:44 +0000 (15:06 +0100)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 25 Aug 2020 01:18:30 +0000 (20:18 -0500)
commitc1abbd0f047e81ea5441baa586c5e3e9901318aa
treea0ff44c828cc438889a0fa7d32a823a34d129062
parenta637ea0c5298af9e10f5cfe659dc9093d4d7bc9c
virtiofsd: stay below fs.file-max sysctl value (CVE-2020-10717)

The system-wide fs.file-max sysctl value determines how many files can
be open.  It defaults to a value calculated based on the machine's RAM
size.  Previously virtiofsd would try to set RLIMIT_NOFILE to 1,000,000
and this allowed the FUSE client to exhaust the number of open files
system-wide on Linux hosts with less than 10 GB of RAM!

Take fs.file-max into account when choosing the default RLIMIT_NOFILE
value.

Fixes: CVE-2020-10717
Reported-by: Yuval Avrahami <yavrahami@paloaltonetworks.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20200501140644.220940-3-stefanha@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
(cherry picked from commit 8c1d353d107b4fc344e27f2f08ea7fa25de2eea2)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
tools/virtiofsd/helper.c