Message ID | 20231104210053.343149-1-maze@google.com (mailing list archive) |
---|---|
State | Changes Requested, archived |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net] net: xt_recent: fix (increase) ipv6 literal buffer length | expand |
On Saturday 2023-11-04 22:00, Maciej Żenczykowski wrote: > >IPv4 in IPv6 is supported by in6_pton [...] >but the provided buffer is too short: If in6_pton were to support tunnel traffic.. wait that sounds unusual, and would require dst to be at least 20 bytes, which the function documentation contradicts. As the RFCs make no precise name proposition (IPv6 Text Representation, third alternative, IPv4 "decimal value" of the "four low-order 8-bit pieces") so let's just call it "low-32-bit dot-decimal representation" which should avoid the tunnel term.
On Sun, Nov 5, 2023 at 12:08 AM Jan Engelhardt <jengelh@inai.de> wrote: > > > On Saturday 2023-11-04 22:00, Maciej Żenczykowski wrote: > > > >IPv4 in IPv6 is supported by in6_pton [...] > >but the provided buffer is too short: > > If in6_pton were to support tunnel traffic.. wait that sounds > unusual, and would require dst to be at least 20 bytes, which the > function documentation contradicts. > > As the RFCs make no precise name proposition > > (IPv6 Text Representation, third alternative, > IPv4 "decimal value" of the "four low-order 8-bit pieces") > > so let's just call it > > "low-32-bit dot-decimal representation" > > which should avoid the tunnel term. Resent [ https://patchwork.kernel.org/project/netdevbpf/patch/20231105195600.522779-1-maze@google.com/ ], hopefully this is better. Also: - used your (Jan's) new email in the CC. - changed net to netfilter in the commit title (but as it is such a trivial bug fix, it does still feel like it should go straight into net/main... rather than via netfilter repos) Cheers, Maciej
diff --git a/net/netfilter/xt_recent.c b/net/netfilter/xt_recent.c index 7ddb9a78e3fc..ef93e0d3bee0 100644 --- a/net/netfilter/xt_recent.c +++ b/net/netfilter/xt_recent.c @@ -561,7 +561,7 @@ recent_mt_proc_write(struct file *file, const char __user *input, { struct recent_table *t = pde_data(file_inode(file)); struct recent_entry *e; - char buf[sizeof("+b335:1d35:1e55:dead:c0de:1715:5afe:c0de")]; + char buf[sizeof("+b335:1d35:1e55:dead:c0de:1715:255.255.255.255")]; const char *c = buf; union nf_inet_addr addr = {}; u_int16_t family;