mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-11-30 07:29:42 -05:00
net: net_cls: fd passed in SCM_RIGHTS datagram not set correctly
Commit6a328d8c6fchanged the update logic for the socket but it does not update the SCM_RIGHTS update as well. This patch is based on the net_prio fix commit48a87cc26cnet: netprio: fd passed in SCM_RIGHTS datagram not set correctly A socket fd passed in a SCM_RIGHTS datagram was not getting updated with the new tasks cgrp prioidx. This leaves IO on the socket tagged with the old tasks priority. To fix this add a check in the scm recvmsg path to update the sock cgrp prioidx with the new tasks value. Let's apply the same fix for net_cls. Signed-off-by: Daniel Wagner <[email protected]> Reported-by: Li Zefan <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: "Eric W. Biederman" <[email protected]> Cc: Al Viro <[email protected]> Cc: John Fastabend <[email protected]> Cc: Neil Horman <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
a05948f296
commit
d84295067f
1 changed files with 4 additions and 1 deletions
|
|
@ -35,6 +35,7 @@
|
|||
#include <net/sock.h>
|
||||
#include <net/compat.h>
|
||||
#include <net/scm.h>
|
||||
#include <net/cls_cgroup.h>
|
||||
|
||||
|
||||
/*
|
||||
|
|
@ -302,8 +303,10 @@ void scm_detach_fds(struct msghdr *msg, struct scm_cookie *scm)
|
|||
}
|
||||
/* Bump the usage count and install the file. */
|
||||
sock = sock_from_file(fp[i], &err);
|
||||
if (sock)
|
||||
if (sock) {
|
||||
sock_update_netprioidx(sock->sk, current);
|
||||
sock_update_classid(sock->sk, current);
|
||||
}
|
||||
fd_install(new_fd, get_file(fp[i]));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue