提交 213d7f94 编写于 作者: R Richard Haines 提交者: Paul Moore

netlabel: If PF_INET6, check sk_buff ip header version

When resolving a fallback label, check the sk_buff version as it
is possible (e.g. SCTP) to have family = PF_INET6 while
receiving ip_hdr(skb)->version = 4.
Signed-off-by: NRichard Haines <richard_c_haines@btinternet.com>
Acked-by: NPaul Moore <paul@paul-moore.com>
Signed-off-by: NPaul Moore <paul@paul-moore.com>
上级 7928b2cb
......@@ -1472,6 +1472,16 @@ int netlbl_unlabel_getattr(const struct sk_buff *skb,
iface = rcu_dereference(netlbl_unlhsh_def);
if (iface == NULL || !iface->valid)
goto unlabel_getattr_nolabel;
#if IS_ENABLED(CONFIG_IPV6)
/* When resolving a fallback label, check the sk_buff version as
* it is possible (e.g. SCTP) to have family = PF_INET6 while
* receiving ip_hdr(skb)->version = 4.
*/
if (family == PF_INET6 && ip_hdr(skb)->version == 4)
family = PF_INET;
#endif /* IPv6 */
switch (family) {
case PF_INET: {
struct iphdr *hdr4;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册