Re: [PATCH v4] af_netlink: ensure that NLMSG_DONE never fails in dumps

2017-11-12 Thread David Miller
From: David Miller Date: Sat, 11 Nov 2017 23:21:01 +0900 (KST) > Aha, that's what I missed. Indeed, it cannot happen. Applied and queued up for -stable.

Re: [PATCH v4] af_netlink: ensure that NLMSG_DONE never fails in dumps

2017-11-11 Thread Jason A. Donenfeld
On Sat, Nov 11, 2017 at 11:18 PM, Johannes Berg wrote: > >> > If you're handling this by forcing another read() to procude the >> > NLMSG_DONE, then you have no reason to WARN_ON() here. >> > >> > In fact you are adding a WARN_ON() which is trivially triggerable by >> > any user. >> >> I added thi

Re: [PATCH v4] af_netlink: ensure that NLMSG_DONE never fails in dumps

2017-11-11 Thread David Miller
From: Johannes Berg Date: Sat, 11 Nov 2017 15:15:21 +0100 > On Sat, 2017-11-11 at 23:09 +0900, David Miller wrote: >> From: "Jason A. Donenfeld" >> Date: Thu, 9 Nov 2017 13:04:44 +0900 >> >> > @@ -2195,13 +2197,15 @@ static int netlink_dump(struct sock *sk) >> > return 0; >> >

Re: [PATCH v4] af_netlink: ensure that NLMSG_DONE never fails in dumps

2017-11-11 Thread Johannes Berg
> > If you're handling this by forcing another read() to procude the > > NLMSG_DONE, then you have no reason to WARN_ON() here. > > > > In fact you are adding a WARN_ON() which is trivially triggerable by > > any user. > > I added this in my suggestion for how this could work, but I don't > thin

Re: [PATCH v4] af_netlink: ensure that NLMSG_DONE never fails in dumps

2017-11-11 Thread Johannes Berg
On Sat, 2017-11-11 at 23:09 +0900, David Miller wrote: > From: "Jason A. Donenfeld" > Date: Thu, 9 Nov 2017 13:04:44 +0900 > > > @@ -2195,13 +2197,15 @@ static int netlink_dump(struct sock *sk) > > return 0; > > } > > > > - nlh = nlmsg_put_answer(skb, cb, NLMSG_DONE, si

Re: [PATCH v4] af_netlink: ensure that NLMSG_DONE never fails in dumps

2017-11-11 Thread David Miller
From: "Jason A. Donenfeld" Date: Thu, 9 Nov 2017 13:04:44 +0900 > @@ -2195,13 +2197,15 @@ static int netlink_dump(struct sock *sk) > return 0; > } > > - nlh = nlmsg_put_answer(skb, cb, NLMSG_DONE, sizeof(len), NLM_F_MULTI); > - if (!nlh) > + nlh = nlmsg_put_answ

Re: [PATCH v4] af_netlink: ensure that NLMSG_DONE never fails in dumps

2017-11-10 Thread Jason A. Donenfeld
On Sat, Nov 11, 2017 at 11:37 AM, David Miller wrote: > Jason I'm already pushing my luck as-is with the pull request I made > yesterday. > > I've seen your original requst to get this in, you don't have to say > it multiple times. > > We can get this into the merge window and submit it for -stabl

Re: [PATCH v4] af_netlink: ensure that NLMSG_DONE never fails in dumps

2017-11-10 Thread David Miller
From: "Jason A. Donenfeld" Date: Sat, 11 Nov 2017 11:26:12 +0900 > IIRC, 4.14 comes tomorrow-ish? If possible, it would be nice to get > this in 4.14 before then, so it doesn't have to take time to trickle > down through stable. Jason I'm already pushing my luck as-is with the pull request I mad

Re: [PATCH v4] af_netlink: ensure that NLMSG_DONE never fails in dumps

2017-11-10 Thread Jason A. Donenfeld
IIRC, 4.14 comes tomorrow-ish? If possible, it would be nice to get this in 4.14 before then, so it doesn't have to take time to trickle down through stable. Jason On Thu, Nov 9, 2017 at 1:04 PM, Jason A. Donenfeld wrote: > The way people generally use netlink_dump is that they fill in the skb >

[PATCH v4] af_netlink: ensure that NLMSG_DONE never fails in dumps

2017-11-08 Thread Jason A. Donenfeld
The way people generally use netlink_dump is that they fill in the skb as much as possible, breaking when nla_put returns an error. Then, they get called again and start filling out the next skb, and again, and so forth. The mechanism at work here is the ability for the iterative dumping function t