Author: trasz
Date: Sun Jun 14 14:38:40 2020
New Revision: 362176
URL: https://svnweb.freebsd.org/changeset/base/362176

Log:
  Make linux(4) warn about unsupported CMSG level/type.
  
  MFC after:    2 weeks
  Sponsored by: The FreeBSD Foundation
  Differential Revision:        https://reviews.freebsd.org/D25255

Modified:
  head/sys/compat/linux/linux_socket.c

Modified: head/sys/compat/linux/linux_socket.c
==============================================================================
--- head/sys/compat/linux/linux_socket.c        Sun Jun 14 11:41:57 2020        
(r362175)
+++ head/sys/compat/linux/linux_socket.c        Sun Jun 14 14:38:40 2020        
(r362176)
@@ -1042,8 +1042,12 @@ linux_sendmsg_common(struct thread *td, l_int s, struc
                        cmsg->cmsg_level =
                            linux_to_bsd_sockopt_level(linux_cmsg.cmsg_level);
                        if (cmsg->cmsg_type == -1
-                           || cmsg->cmsg_level != SOL_SOCKET)
+                           || cmsg->cmsg_level != SOL_SOCKET) {
+                               linux_msg(curthread,
+                                   "unsupported sendmsg cmsg level %d type %d",
+                                   linux_cmsg.cmsg_level, 
linux_cmsg.cmsg_type);
                                goto bad;
+                       }
 
                        /*
                         * Some applications (e.g. pulseaudio) attempt to
@@ -1228,6 +1232,9 @@ linux_recvmsg_common(struct thread *td, l_int s, struc
                            bsd_to_linux_sockopt_level(cm->cmsg_level);
                        if (linux_cmsg->cmsg_type == -1 ||
                            cm->cmsg_level != SOL_SOCKET) {
+                               linux_msg(curthread,
+                                   "unsupported recvmsg cmsg level %d type %d",
+                                   cm->cmsg_level, cm->cmsg_type);
                                error = EINVAL;
                                goto bad;
                        }
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to