diff options
| author | Herbert Xu <[email protected]> | 2015-12-16 10:13:14 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2015-12-16 15:44:08 +0000 |
| commit | 3a324606bbabfc30084ce9d08169910773ba9a92 (patch) | |
| tree | 3561b143a3f0c9036cd6e9b9e5e3adc95208846a /net/unix/af_unix.c | |
| parent | inet: tcp: fix inetpeer_set_addr_v4() (diff) | |
| download | kernel-3a324606bbabfc30084ce9d08169910773ba9a92.tar.gz kernel-3a324606bbabfc30084ce9d08169910773ba9a92.zip | |
rhashtable: Enforce minimum size on initial hash table
William Hua <[email protected]> wrote:
>
> I wasn't aware there was an enforced minimum size. I simply set the
> nelem_hint in the rhastable_params struct to 1, expecting it to grow as
> needed. This caused a segfault afterwards when trying to insert an
> element.
OK we're doing the size computation before we enforce the limit
on min_size.
---8<---
We need to do the initial hash table size computation after we
have obtained the correct min_size/max_size parameters. Otherwise
we may end up with a hash table whose size is outside the allowed
envelope.
Fixes: a998f712f77e ("rhashtable: Round up/down min/max_size to...")
Reported-by: William Hua <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/unix/af_unix.c')
0 files changed, 0 insertions, 0 deletions
