On Tue, Oct 24, 2017 at 03:30:37PM -0700, Cong Wang wrote:
> Although CONFIG_VSOCKETS_DIAG depends on CONFIG_VSOCKETS,
> vsock_init_tables() is not always called, it is called only
> if other modules call its caller. Therefore if we only
> enable CONFIG_VSOCKETS_DIAG, it would crash kernel on uninitialized
> vsock_bind_table.
>
> This patch fixes it by moving vsock_init_tables() to its own
> module_init().
>
> Fixes: 413a4317aca7 ("VSOCK: add sock_diag interface")
> Reported-by: syzkaller bot
> Cc: Stefan Hajnoczi <[email protected]>
> Cc: Jorgen Hansen <[email protected]>
> Signed-off-by: Cong Wang <[email protected]>
> ---
> net/vmw_vsock/af_vsock.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
Thank you, Cong Wang! I was just trying to figure out the syzkaller bug
report and you've already fixed it :). The patch looks good.
Reviewed-by: Stefan Hajnoczi <[email protected]>