On 06/27, Alexei Starovoitov wrote: > On Thu, Jun 27, 2019 at 01:38:46PM -0700, Stanislav Fomichev wrote: > > This series implements two new per-cgroup hooks: getsockopt and > > setsockopt along with a new sockopt program type. The idea is pretty > > similar to recently introduced cgroup sysctl hooks, but > > implementation is simpler (no need to convert to/from strings). > > > > What this can be applied to: > > * move business logic of what tos/priority/etc can be set by > > containers (either pass or reject) > > * handle existing options (or introduce new ones) differently by > > propagating some information in cgroup/socket local storage > > > > Compared to a simple syscall/{g,s}etsockopt tracepoint, those > > hooks are context aware. Meaning, they can access underlying socket > > and use cgroup and socket local storage. > > > > v9: > > * allow overwriting setsocktop arguments (Alexei Starovoitov) > > (see individual changes for more changelog details) > > Applied. Thanks. Great, thanks for all the reviews! > There is a build warning though: > test_sockopt_sk.c: In function ‘getsetsockopt’: > test_sockopt_sk.c:115:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] > if (*(__u32 *)buf != 0x55AA*2) { > ^~ > test_sockopt_sk.c:116:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] > log_err("Unexpected getsockopt(SO_SNDBUF) 0x%x != 0x55AA*2", > ^~~~~~~ > > Pls fix it in the follow up. Sure, but I can't reproduce it with gcc7 nor with clang9 :-/ Presumably, a switch to __get_unaligned_cpu32 should help, I'll try to play with compilers a bit before sending a fix.