[PATCH] net: Convert proto_ops::getname to sockaddr_storage
Marc Kleine-Budde
mkl at pengutronix.de
Wed Jan 15 23:53:42 PST 2025
On 16.12.2024 18:34:28, Kees Cook wrote:
> The proto_ops::getname callback was long ago backed by sockaddr_storage,
> but the replacement of it for sockaddr was never done. Plumb it through
> all the getname() callbacks, adjust prototypes, and fix casts.
>
> There are a few cases where the backing object is _not_ a sockaddr_storage
> and converting it looks painful. In those cases, they use a cast to
> struct sockaddr_storage. They appear well bounds-checked, so the risk
> is no worse that we have currently.
>
> Other casts to sockaddr are removed, though to avoid spilling this
> change into BPF (which becomes a much larger set of changes), cast the
> sockaddr_storage instances there to sockaddr for the time being.
>
> In theory this could be split up into per-caller patches that add more
> casts that all later get removed, but it seemed like there are few
> enough callers that it seems feasible to do this in a single patch. Most
> conversions are mechanical, so review should be fairly easy. (Famous
> last words.)
>
> Signed-off-by: Kees Cook <kees at kernel.org>
> ---
> net/can/isotp.c | 3 +-
> net/can/j1939/socket.c | 2 +-
> net/can/raw.c | 2 +-
Acked-by: Marc Kleine-Budde <mkl at pengutronix.de> # for net/can
regards,
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung Nürnberg | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-nvme/attachments/20250116/7764dcc5/attachment-0001.sig>
More information about the Linux-nvme
mailing list