On (06/27/17 15:59), Sowmini Varadhan wrote: > > Why does rds-tcp need to call sock_graft() without those invariants > > met? > > It would certainly help to declare "dont use sock_creeate_kern() > if you are going to accept on this socket"- I dont see that being > mandated anywhere.
I can look into getting rds_tcp_accept_one also calling sock_create_lite like every other caller, (though I may not get to this for another week, due to travel), but the code in sock_graft() doesnt look right either. At the very least, there needs to be a WARN_ON(parent->sk) there, to provide a gentle dope-slap for the next slob that stumbles on this type of leak. --Sowmini