Skip to content

Commit

Permalink
pool: pre-reserve pool-memory on pool owner
Browse files Browse the repository at this point in the history
We must not use VM_NORESERVE, otherwise, memory is accounted on the task
that sends the message, instead of the task receiving the message. This
would be bad, as you coul easily OOM a privileged task by consuming, but
never freeing its broadcasts.

Fix this by always pre-accounting the whole pool on the connection that
creates the pool.

Signed-off-by: David Herrmann <[email protected]>
  • Loading branch information
David Herrmann committed Feb 26, 2015
1 parent 5485ae6 commit 950697b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ struct kdbus_pool *kdbus_pool_new(const char *name, size_t size)
}
}

f = shmem_file_setup(n ?: KBUILD_MODNAME "-conn", size, VM_NORESERVE);
f = shmem_file_setup(n ?: KBUILD_MODNAME "-conn", size, 0);
kfree(n);

if (IS_ERR(f)) {
Expand Down

0 comments on commit 950697b

Please sign in to comment.