Luck, Tony
bef3efbeb8
efivarfs: Limit the rate for non-root to read files
...
Each read from a file in efivarfs results in two calls to EFI
(one to get the file size, another to get the actual data).
On X86 these EFI calls result in broadcast system management
interrupts (SMI) which affect performance of the whole system.
A malicious user can loop performing reads from efivarfs bringing
the system to its knees.
Linus suggested per-user rate limit to solve this.
So we add a ratelimit structure to "user_struct" and initialize
it for the root user for no limit. When allocating user_struct for
other users we set the limit to 100 per second. This could be used
for other places that want to limit the rate of some detrimental
user action.
In efivarfs if the limit is exceeded when reading, we take an
interruptible nap for 50ms and check the rate limit again.
Signed-off-by: Tony Luck <tony.luck@intel.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-02-22 10:21:02 -08:00
..
autogroup.h
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
clock.h
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
coredump.h
mm, oom_reaper: fix memory corruption
2017-12-14 16:00:49 -08:00
cpufreq.h
sched/cpufreq: Use the DEADLINE utilization signal
2018-01-10 11:30:32 +01:00
cputime.h
Merge branch 'for-4.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup
2017-11-15 14:29:44 -08:00
deadline.h
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
debug.h
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
hotplug.h
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
idle.h
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
init.h
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
isolation.h
sched/isolation: Move isolcpus= handling to the housekeeping code
2017-10-27 09:55:30 +02:00
jobctl.h
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
loadavg.h
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
mm.h
Merge branch 'linus' into sched/urgent, to resolve conflicts
2018-02-06 21:12:31 +01:00
nohz.h
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
numa_balancing.h
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
prio.h
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
rt.h
Merge branch 'linus' into sched/core, to pick up fixes
2017-11-08 10:17:15 +01:00
signal.h
signal/ptrace: Add force_sig_ptrace_errno_trap and use it where needed
2018-01-22 19:07:11 -06:00
stat.h
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
sysctl.h
Merge branch 'linus' into sched/core, to pick up fixes
2017-11-08 10:17:15 +01:00
task.h
fork: Provide usercopy whitelisting for task_struct
2018-01-15 12:08:04 -08:00
task_stack.h
sched/headers: Constify object_is_on_stack()
2017-12-06 20:50:02 +01:00
topology.h
sched/cpufreq: Move arch_scale_{freq,cpu}_capacity() outside of #ifdef CONFIG_SMP
2018-01-10 12:53:35 +01:00
user.h
efivarfs: Limit the rate for non-root to read files
2018-02-22 10:21:02 -08:00
wake_q.h
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
xacct.h
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00