lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CADXeF1FxVt=xt+yk_SvLSYBYw07Vy6pssSfXqv8pOQuP7obPgg@mail.gmail.com>
Date: Fri, 10 Jan 2025 00:01:31 +0900
From: Yuyang Huang <yuyanghuang@...gle.com>
To: Paolo Abeni <pabeni@...hat.com>
Cc: "David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, 
	Jakub Kicinski <kuba@...nel.org>, Simon Horman <horms@...nel.org>, David Ahern <dsahern@...nel.org>, 
	roopa@...ulusnetworks.com, jiri@...nulli.us, stephen@...workplumber.org, 
	jimictw@...gle.com, prohr@...gle.com, liuhangbin@...il.com, 
	nicolas.dichtel@...nd.com, andrew@...n.ch, netdev@...r.kernel.org, 
	Maciej Żenczykowski <maze@...gle.com>, 
	Lorenzo Colitti <lorenzo@...gle.com>
Subject: Re: [PATCH net-next, v4] netlink: support dumping IPv4 multicast addresses

>Also, this will need a paired self-test - even something very simple
>just exercising the new code.

After looking into the existing selftest, I feel writing C program
selftests might be a little bit anti-pattern. The existing test cases
primarily use iproute2. This approach appears to be more common and
easier to implement. I do plan to migrate `ip maddress` to use netlink
instead of parsing procfs, which enables me to write selftests using
iproute2.

I intend to add similar selftests for my other patches
(anycast/multicast notifications), which already have corresponding
iproute2 patches under review or merged.

For this patch, my proposed steps for adding test are:

1. Fix this patch and get it merged.
2. Update iproute2(`ip maddress`) to use netlink.
3. Write selftests using iproute2.

Please let me know if you have any concerns.

Thanks,
Yuyang

On Thu, Jan 9, 2025 at 9:04 PM Yuyang Huang <yuyanghuang@...gle.com> wrote:
>
> Hi Paolo
>
> Thanks for the review feedback.
>
> >I suspect the above chunk confuses the user-space as inet_fill_ifaddr()
> >still get the 'event' value from fillargs->event
>
> You're right, I missed initializing the event field in the fillargs
> structure. It's a bug introduced in the v4 patch during refactoring. I
> will fix it in the v5 patch.
>
> >Also, this will need a paired self-test - even something very simple
> >just exercising the new code.
>
> Sure, I can send separate patch for adding self-test, but please let
> me know if I should include the self-test in the same patch
>
> Thanks
> Yuyang
>
>
> On Thu, Jan 9, 2025 at 8:30 PM Paolo Abeni <pabeni@...hat.com> wrote:
> >
> > On 1/9/25 8:22 AM, Yuyang Huang wrote:
> > > @@ -1889,15 +1935,16 @@ static u32 inet_base_seq(const struct net *net)
> > >       return res;
> > >  }
> > >
> > > -static int inet_dump_ifaddr(struct sk_buff *skb, struct netlink_callback *cb)
> > > +static int inet_dump_addr(struct sk_buff *skb, struct netlink_callback *cb,
> > > +                       enum addr_type_t type)
> > >  {
> > >       const struct nlmsghdr *nlh = cb->nlh;
> > >       struct inet_fill_args fillargs = {
> > >               .portid = NETLINK_CB(cb->skb).portid,
> > >               .seq = nlh->nlmsg_seq,
> > > -             .event = RTM_NEWADDR,
> > >               .flags = NLM_F_MULTI,
> > >               .netnsid = -1,
> > > +             .type = type,
> >
> > This patch is apparently breaking a few tests:
> >
> > https://netdev.bots.linux.dev/contest.html?branch=net-next-2025-01-09--09-00&executor=vmksft-net-dbg&pw-n=0&pass=0
> > https://netdev.bots.linux.dev/contest.html?branch=net-next-2025-01-09--09-00&executor=vmksft-nf-dbg&pw-n=0&pass=0
> > https://netdev.bots.linux.dev/contest.html?branch=net-next-2025-01-09--09-00&executor=vmksft-nf&pw-n=0&pass=0
> >
> > I suspect the above chunk confuses the user-space as inet_fill_ifaddr()
> > still get the 'event' value from fillargs->event
> >
> > Also, this will need a paired self-test - even something very simple
> > just exercising the new code.
> >
> > Thanks,
> >
> > Paolo
> >

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ