From: Kangjie Lu <hidden> Date: 2018-12-26 03:50:32
When nla_parse fails, we should not use the results (the first
argument). The fix checks if it fails, and if so, returns its error code
upstream.
Signed-off-by: Kangjie Lu <redacted>
---
net/netfilter/ipset/ip_set_core.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
When nla_parse fails, we should not use the results (the first
argument). The fix checks if it fails, and if so, returns its error code
upstream.
Signed-off-by: Kangjie Lu <redacted>
---
net/netfilter/ipset/ip_set_core.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
From: Pablo Neira Ayuso <pablo@netfilter.org> Date: 2019-01-09 22:43:42
On Wed, Dec 26, 2018 at 12:16:25PM +0300, Kirill Tkhai wrote:
On 26.12.2018 06:50, Kangjie Lu wrote:
quoted
When nla_parse fails, we should not use the results (the first
argument). The fix checks if it fails, and if so, returns its error code
upstream.
Signed-off-by: Kangjie Lu <redacted>
---
net/netfilter/ipset/ip_set_core.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
@Kangjie: nitpick, could you align this line below? ie.
ret = nla_parse(cda, IPSET_ATTR_CMD_MAX, cmdattr,
nlh->nlmsg_len - min_len, ip_set_adt_policy,
NULL);
quoted
+ if (ret)
+ return ret;
In this function above nlmsg_new() allocates skb2, but I don't see, where you free it here.
netlink_unicast() is responsible for releasing this skb2.
On Wed, Dec 26, 2018 at 12:16:25PM +0300, Kirill Tkhai wrote:
quoted
On 26.12.2018 06:50, Kangjie Lu wrote:
quoted
When nla_parse fails, we should not use the results (the first
argument). The fix checks if it fails, and if so, returns its error code
upstream.
Signed-off-by: Kangjie Lu <redacted>
---
net/netfilter/ipset/ip_set_core.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
@Kangjie: nitpick, could you align this line below? ie.
ret = nla_parse(cda, IPSET_ATTR_CMD_MAX, cmdattr,
nlh->nlmsg_len - min_len, ip_set_adt_policy,
NULL);
quoted
quoted
+ if (ret)
+ return ret;
In this function above nlmsg_new() allocates skb2, but I don't see, where you free it here.
netlink_unicast() is responsible for releasing this skb2.
We return earlier at "if (ret)", so netlink_unicast() is not called.