Re: [PATCH 1/1] [DCCP][QPOLICY]: More strict controlling of supplied parameters v2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



| Ensure that cmsg->cmsg_type value is valid for qpolicy that is currently in use.
| Slightly revised version after comments from Gerrit.
| 
Thanks, this looks good and compiles cleanly. It is currently uploaded to
	git://eden-feed.erg.abdn.ac.uk/dccp_exp 	(subtree `qpolicy')
but I would like to add it to the test tree soon, with changes as below.

Are there any objections in reserving the first 16 bits for qpolicy -- I
think this should be enough to get a good number of policies started.

--- a/include/linux/dccp.h
+++ b/include/linux/dccp.h
@@ -198,6 +198,8 @@ enum dccp_feature_numbers {
 /* DCCP socket control message types for cmsg */
 enum dccp_cmsg_type {
 	DCCP_SCM_PRIORITY = 1,
+	DCCP_SCM_QPOLICY_MAX = 0xFFFF,
+	/* Up to here reserved exclusively for qpolicy parameters */
 	DCCP_SCM_MAX
 };
 
--- a/net/dccp/proto.c
+++ b/net/dccp/proto.c
@@ -730,7 +730,8 @@ static int dccp_msghdr_parse(struct msgh
 		if (cmsg->cmsg_level != SOL_DCCP)
 			continue;
 
-		if (!dccp_qpolicy_param_ok(skb->sk, cmsg->cmsg_type))
+		if (cmsg->cmsg_type <= DCCP_SCM_QPOLICY_MAX &&
+		    !dccp_qpolicy_param_ok(skb->sk, cmsg->cmsg_type))
 			return -EINVAL;
 
 		switch (cmsg->cmsg_type) {
	
--
To unsubscribe from this list: send the line "unsubscribe dccp" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [IETF DCCP]     [Linux Networking]     [Git]     [Security]     [Linux Assembly]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux