Skip to content

Cleanup/fix the sk_alloc() call

Pavel Emelyanov netdev 1 version Applied

Status from this message: Applied.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest8 patches 13 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/8Move the sock_copy() from the headerinclude/net/sock.h net/core/sock.c+14 -141 reply
2/8Move the get_net() from sock_copy()net/core/sock.c+1 -11 reply
3/8Cleanup the allocation/freeing of the sock objectnet/core/sock.c+29 -151 reply
4/8Auto-zero the allocated sock objectnet/core/sock.c+3 -11 reply
5/8Move some core sock setup into sk_prot_allocnet/core/sock.c+27 -161 reply
6/8Make the sk_clone() lighternet/core/sock.c+3 -23 replies
7/8Remove bogus zero_it argument from sk_allocnet/core/sock.c+9 -141 reply
8/8Forget the zero_it argument of sk_alloc()drivers/net/pppoe.c drivers/net/pppol2tp.c include/net/sock.h +30 more+43 -361 reply

Reviews trailers per patch

None of the 8 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchArnaldo Carvalho de Melo
SeriesA-b
1/8
2/8
3/8
4/8
5/8
6/8
7/8
8/8

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/8] Cleanup/fix the sk_alloc() call

The sk_alloc() function suffers from two problems:
1 (major). The error path is not clean in it - if the security
call fails, the net namespace is not put, if the try_module_get fails additionally the security context is not released;
2 (minor). The zero_it argument is misleading, as it doesn't just
zeroes it, but performs some extra setup. Besides this argument is used only in one place - in the sk_clone().

So this set fixes these problems and performs some additional cleanup.