]> rtime.felk.cvut.cz Git - can-eth-gw-linux.git/blobdiff - include/net/scm.h
af_netlink: force credentials passing [CVE-2012-3520]
[can-eth-gw-linux.git] / include / net / scm.h
index 079d7887dac13697d0dfc5d0cc6ce256800151d0..7dc0854f0b3891992696002b7f75edf7a01233ab 100644 (file)
@@ -70,9 +70,11 @@ static __inline__ void scm_destroy(struct scm_cookie *scm)
 }
 
 static __inline__ int scm_send(struct socket *sock, struct msghdr *msg,
-                              struct scm_cookie *scm)
+                              struct scm_cookie *scm, bool forcecreds)
 {
        memset(scm, 0, sizeof(*scm));
+       if (forcecreds)
+               scm_set_cred(scm, task_tgid(current), current_cred());
        unix_get_peersec_dgram(sock, scm);
        if (msg->msg_controllen <= 0)
                return 0;