Skip to contentSkip to conversation

nlmsg: add lacking attributes validation

PATCH Applied Ken-ichirou MATSUZAWA 2 participants 2 messages Sep 11, 2015 – Oct 5, 2015 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nlmsg: add lacking attributes validation

This patch adds four (actually two) attributes validation with comparing to current kernel header.

---
 src/nlmsg.c | 9 +++++++++
 1 file changed, 9 insertions(+)
src/nlmsg.c +9 -0
index cabd8be..ba28c77 100644
@@ -140,6 +140,7 @@ static int nfq_pkt_parse_attr_cb(const struct nlattr *attr, void *data)
 	case NFQA_SECCTX:
 	case NFQA_UID:
 	case NFQA_GID:
+	case NFQA_CT_INFO:
 		if (mnl_attr_validate(attr, MNL_TYPE_U32) < 0)
 			return MNL_CB_ERROR;
 		break;
@@ -155,7 +156,15 @@ static int nfq_pkt_parse_attr_cb(const struct nlattr *attr, void *data)
 			return MNL_CB_ERROR;
 		}
 		break;
+	case NFQA_PACKET_HDR:
+		if (mnl_attr_validate2(attr, MNL_TYPE_UNSPEC,
+		    sizeof(struct nfqnl_msg_packet_hdr)) < 0) {
+			return MNL_CB_ERROR;
+		}
+		break;
 	case NFQA_PAYLOAD:
+	case NFQA_CT:
+	case NFQA_EXP:
 		break;
 	}
 	tb[type] = attr;
Signature · 1 line
2.1.4
maintainer Applied
#1 lore raw
Quoted 2 lines · Ken-ichirou MATSUZAWA

This patch adds four (actually two) attributes validation with comparing to current kernel header.

Applied, thanks.