]> git.baikalelectronics.ru Git - kernel.git/commit
fix kcm_clone()
authorAl Viro <viro@ZenIV.linux.org.uk>
Tue, 5 Dec 2017 23:27:57 +0000 (23:27 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 5 Dec 2017 23:39:28 +0000 (18:39 -0500)
commitbd0033f197d121be3fcdedaad7a52e65dbc09892
treeb440fa1710f0e7c3779461cb1d851596d5b11ac5
parent3cc79e75f9464f8c2994c2c2e006f418616da1bd
fix kcm_clone()

1) it's fput() or sock_release(), not both
2) don't do fd_install() until the last failure exit.
3) not a bug per se, but... don't attach socket to struct file
   until it's set up.

Take reserving descriptor into the caller, move fd_install() to the
caller, sanitize failure exits and calling conventions.

Cc: stable@vger.kernel.org # v4.6+
Acked-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/kcm/kcmsock.c