<html>
<head>
<base href="https://bugzilla.netfilter.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_ASSIGNED "
title="ASSIGNED - Trying to populate a set raises a netlink error "Could not process rule: No space left on device""
href="https://bugzilla.netfilter.org/show_bug.cgi?id=1464#c10">Comment # 10</a>
on <a class="bz_bug_link
bz_status_ASSIGNED "
title="ASSIGNED - Trying to populate a set raises a netlink error "Could not process rule: No space left on device""
href="https://bugzilla.netfilter.org/show_bug.cgi?id=1464">bug 1464</a>
from <span class="vcard"><a class="email" href="mailto:pablo@netfilter.org" title="Pablo Neira Ayuso <pablo@netfilter.org>"> <span class="fn">Pablo Neira Ayuso</span></a>
</span></b>
<pre>(In reply to Pablo Neira Ayuso from <a href="show_bug.cgi?id=1464#c8">comment #8</a>)
<span class="quote">> (In reply to kfm from <a href="show_bug.cgi?id=1464#c7">comment #7</a>)
> > Created <span class=""><a href="attachment.cgi?id=618" name="attach_618" title="bug-1464-strace-r1.txt">attachment 618</a> <a href="attachment.cgi?id=618&action=edit" title="bug-1464-strace-r1.txt">[details]</a></span>
> > bug-1464-strace-r1.txt
> >
> > # strace -obug-1464-strace-r1.txt nft -f bug-1464-nft-input-stream.txt
>
> Netlink message is sent:
>
> sendmsg(3, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000},
> msg_namelen=12, msg_iov=[{iov_base=[{{len=20, type=NFNL_MSG_BATCH_BEGIN,
> flags=NLM_F_REQUEST, seq=0, pid=0}, {nfgen_family=AF_UNSPEC,
> version=NFNETLINK_V0, res_id=htons(2560)}, {{len=40,
> type=NFNL_SUBSYS_NFTABLES<<8|NFT_MSG_DELSETELEM, flags=NLM_F_REQUEST, seq=1,
> pid=0}, {nfgen_family=AF_INET, version=NFNETLINK_V0, res_id=htons(0),
> [{{nla_len=11, nla_type=0x2}, "\x62\x6f\x67\x6f\x6e\x73\x00"}, {{nla_len=8,
> nla_type=NFNETLINK_V1}, "\x72\x61\x77\x00"}]}, {{len=51440,
> type=NFNL_SUBSYS_NFTABLES<<8|NFT_MSG_NEWSETELEM,
> flags=NLM_F_REQUEST|NLM_F_CREATE, seq=2, pid=0}, {nfgen_family=AF_INET,
> version=NFNETLINK_V0, res_id=htons(0), [{{nla_len=11, nla_type=0x2},
> "\x62\x6f\x67\x6f\x6e\x73\x00"}, {{nla_len=8, nla_type=0x4},
> "\x00\x00\x00\x1d"}, {{nla_len=8, nla_type=NFNETLINK_V1},
> "\x72\x61\x77\x00"}, {{nla_len=51392, nla_type=NLA_F_NESTED|0x3},
> "\x10\x00\x01\x80\x0c\x00\x01\x80\x08\x00\x01\x00\x00\x00\x00\x00\x18\x00\x02
> \x80\x08\x00\x03\x00\x00\x00\x00\x01\x0c\x00\x01\x80"...}]}, {{len=20,
> type=NFNL_MSG_BATCH_END, flags=NLM_F_REQUEST, seq=3, pid=0},
> {nfgen_family=AF_UNSPEC, version=NFNETLINK_V0, res_id=htons(2560)}],
> iov_len=51520}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 51520</span >
The large message is send from userspace to the kernel:
{{len=51440, type=NFNL_SUBSYS_NFTABLES<<8|NFT_MSG_NEWSETELEM,
<span class="quote">> Then, select() reports a reply message:
>
> select(4, [3], NULL, NULL, {tv_sec=0, tv_usec=0}) = 1 (in [3], left
> {tv_sec=0, tv_usec=0})
>
> And userspace gets it via recvmsg():
>
> recvmsg(3, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000},
> msg_namelen=12, msg_iov=[{iov_base={{len=51460, type=NLMSG_ERROR, flags=0,
> seq=2, pid=11881}, {error=-EEXIST, msg={{len=51440,
> type=NFNL_SUBSYS_NFTABLES<<8|NFT_MSG_NEWSETELEM,
> flags=NLM_F_REQUEST|NLM_F_CREATE, seq=2, pid=0}, {nfgen_family=AF_INET,
> version=NFNETLINK_V0, res_id=htons(0), [{{nla_len=11, nla_type=0x2},
> "\x62\x6f\x67\x6f\x6e\x73\x00"}, {{nla_len=8, nla_type=0x4},
> "\x00\x00\x00\x1d"}, {{nla_len=8, nla_type=NFNETLINK_V1},
> "\x72\x61\x77\x00"}, {{nla_len=51392, nla_type=NLA_F_NESTED|0x3},
> "\x10\x00\x01\x80\x0c\x00\x01\x80\x08\x00\x01\x00\x00\x00\x00\x00\x18\x00\x02
> \x80\x08\x00\x03\x00\x00\x00\x00\x01\x0c\x00\x01\x80"...}]}}},
> iov_len=4096}], msg_iovlen=1, msg_controllen=0, msg_flags=MSG_TRUNC}, 0) =
> 4096</span >
Then the NLM_ERROR message contains the original message len=51440.
Looks like userspace is sending a malformed attribute:
{{nla_len=51392, nla_type=NLA_F_NESTED|0x3},
<span class="quote">> "\x10\x00\x01\x80\x0c\x00\x01\x80\x08\x00\x01\x00\x00\x00\x00\x00\x18\x00\x02
> \x80\x08\x00\x03\x00\x00\x00\x00\x01\x0c\x00\x01\x80"...}]}}},</span ></pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are watching all bug changes.</li>
</ul>
</body>
</html>