Re: kernel BUG at net/phonet/socket.c:LINE!

From: Rémi Denis-Courmont
Date: Mon Apr 13 2020 - 02:02:12 EST


Le maanantaina 13. huhtikuuta 2020, 8.49.14 EEST Vito Caputo a Ãcrit :
> > If we are to distinguish the two error scenarii, then it's the rebind
> > case
> > that needs a different error, but EINVAL is consistent with INET.
>
> Isn't the existing code is bugged if treating -EINVAL as valid and a rebind?
>
> The invalid size will return a NULL sobject but -EINVAL, triggering the
> BUG_ON.

How do you pass an invalid size? It's a constant `sizeof(struct sockaddr_pn)`
in that code path.

--
RÃmi Denis-Courmont
Tapiolan uusi kaupunki, Uudenmaan tasavalta