Re: [PATCH v2 2/2] net: socket: implement SO_DESCRIPTION

2020-08-23 Thread Pascal Bouchareine
On Sat, Aug 22, 2020 at 2:01 PM David Miller wrote: > > About the pid part - > > On top of multiple pids to scan for a given socket, there's also the > > security provided by /proc - I'm not sure what inet_diag does for that > > So maybe users calling it will need to scan /proc for a long time any

Re: [PATCH v2 2/2] net: socket: implement SO_DESCRIPTION

2020-08-22 Thread Pascal Bouchareine
On Sat, Aug 22, 2020 at 1:19 PM Pascal Bouchareine wrote: > > On Sat, Aug 22, 2020 at 12:59 PM Pascal Bouchareine wrote: > > > Would it make sense to also make UDIAG_SHOW_NAME use sk_description? > > (And keep the existing change - setsockopt + show_fd_info via > > /p

Re: [PATCH v2 2/2] net: socket: implement SO_DESCRIPTION

2020-08-22 Thread Pascal Bouchareine
On Sat, Aug 22, 2020 at 12:59 PM Pascal Bouchareine wrote: > Would it make sense to also make UDIAG_SHOW_NAME use sk_description? > (And keep the existing change - setsockopt + show_fd_info via > /proc/.../fdinfo/..) Ah,very wrong example - to be more precise, I suppose that'

Re: [PATCH v2 2/2] net: socket: implement SO_DESCRIPTION

2020-08-22 Thread Pascal Bouchareine
Thank you, On Sat, Aug 22, 2020 at 12:36 PM David Miller wrote: > > We ignore optlen and constrain the string to a static max size > > > > Signed-off-by: Pascal Bouchareine > > This change is really a non-starter unless the information gets > published somewhere wh

Re: [PATCH v2 1/2] mm: add GFP mask param to strndup_user

2020-08-22 Thread Pascal Bouchareine
Thanks for taking a look! On Fri, Aug 21, 2020 at 8:51 PM Andrew Morton wrote: > Why change all existing callsites so that one callsite can pass in a > different gfp_t? My initial thought was to change strndup_user to use GFP_KERNEL_ACCOUNT (or GFP_USER | __GFP_ACCOUNT ?) unconditionally. (Woul

[PATCH v2 2/2] net: socket: implement SO_DESCRIPTION

2020-08-21 Thread Pascal Bouchareine
ignore optlen and constrain the string to a static max size Signed-off-by: Pascal Bouchareine --- include/net/sock.h| 4 +++ include/uapi/asm-generic/socket.h | 2 ++ net/core/sock.c | 53 +++ net/socket.c | 5

[PATCH v2 1/2] mm: add GFP mask param to strndup_user

2020-08-21 Thread Pascal Bouchareine
Let caller specify allocation. Preserve existing calls with GFP_USER. Signed-off-by: Pascal Bouchareine --- Updating patch 1/ and 2/ to address comments drivers/dma-buf/dma-buf.c | 2 +- drivers/gpu/drm/i915/i915_debugfs_params.c | 2 +- drivers/gpu/drm/vc4/vc4_bo.c

Re: [PATCH 2/2] net: socket: implement SO_DESCRIPTION

2020-08-16 Thread Pascal Bouchareine
On Sun, Aug 16, 2020 at 11:15 AM Eric Dumazet wrote: > > 1) You also ignored what would happen at accept() time. > > Please test your patches with ASAN. Ouch, I will look into it - thanks for pointing that out & 3/ > > 2) Also, why is that description specific to sockets ? fcntl on struct file

[PATCH 2/2] net: socket: implement SO_DESCRIPTION

2020-08-15 Thread Pascal Bouchareine
ignore optlen and constrain the string to a static max size Signed-off-by: Pascal Bouchareine --- include/net/sock.h| 4 include/uapi/asm-generic/socket.h | 2 ++ net/core/sock.c | 23 +++ net/socket.c | 5 + 4

[PATCH 1/2] mm: add GFP mask param to strndup_user

2020-08-15 Thread Pascal Bouchareine
Let caller specify allocation. Preserve existing calls with GFP_USER. Signed-off-by: Pascal Bouchareine --- drivers/dma-buf/dma-buf.c | 2 +- drivers/gpu/drm/i915/i915_debugfs_params.c | 2 +- drivers/gpu/drm/vc4/vc4_bo.c | 3 +- drivers/input/misc/uinput.c

[RFC PATCH 0/2] proc,socket: attach description to sockets

2020-08-15 Thread Pascal Bouchareine
Checking to see if this could fit in struct sock. This goes against v5.8 I tried to make it tl;dr in commit 2/2 but motivation is also described a bit in https://lore.kernel.org/linux-api/CAGbU3_nVvuzMn2wo4_ZKufWcGfmGsopVujzTWw-Bbeky=xs...@mail.gmail.com/