Re: [RFC PATCH 1/1] net: kcm: Use sk_psock size for kcm_psock_cache

Greg KH
2022-07-13T06:37:22Z

On Wed, Jul 13, 2022 at 12:32:04PM +0600, Khalid Masum wrote:
> `struct sock` has a member `sk_user_data`, which got its memory allocated
> in `kcm_attach` by `kcm_psock_cache` with the size of `kcm_psock`. Which
> is not enough when the member is used as `sk_psock` causing out of bound
> read.
>
> Use `sk_psock` size to allocate memory instead for `sk_user_data`.
>
> Reported-by: syzbot+1fa91bcd05206ff8cbb5@syzkaller.appspotmail.com
> Signed-off-by: Khalid Masum <khalid.masum.92@gmail.com>
> ---
> net/kcm/kcmsock.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)

What commit id does this fix?

thanks,

greg k-h