* [Cake] Patch "sch_cake: avoid possible divide by zero in cake_enqueue()" has been added to the 4.19-stable tree
@ 2020-01-11 8:18 gregkh
2020-01-11 20:40 ` Dave Taht
0 siblings, 1 reply; 6+ messages in thread
From: gregkh @ 2020-01-11 8:18 UTC (permalink / raw)
To: cake, davem, gregkh, ldir, toke, toke, wenyang, xiyou.wangcong
Cc: stable-commits
This is a note to let you know that I've just added the patch titled
sch_cake: avoid possible divide by zero in cake_enqueue()
to the 4.19-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
sch_cake-avoid-possible-divide-by-zero-in-cake_enqueue.patch
and it can be found in the queue-4.19 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
From foo@baz Sat 11 Jan 2020 09:14:34 AM CET
From: Wen Yang <wenyang@linux.alibaba.com>
Date: Thu, 2 Jan 2020 17:21:43 +0800
Subject: sch_cake: avoid possible divide by zero in cake_enqueue()
From: Wen Yang <wenyang@linux.alibaba.com>
[ Upstream commit 68aab823c223646fab311f8a6581994facee66a0 ]
The variables 'window_interval' is u64 and do_div()
truncates it to 32 bits, which means it can test
non-zero and be truncated to zero for division.
The unit of window_interval is nanoseconds,
so its lower 32-bit is relatively easy to exceed.
Fix this issue by using div64_u64() instead.
Fixes: 7298de9cd725 ("sch_cake: Add ingress mode")
Signed-off-by: Wen Yang <wenyang@linux.alibaba.com>
Cc: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Cc: Toke Høiland-Jørgensen <toke@redhat.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Cong Wang <xiyou.wangcong@gmail.com>
Cc: cake@lists.bufferbloat.net
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/sched/sch_cake.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/net/sched/sch_cake.c
+++ b/net/sched/sch_cake.c
@@ -1758,7 +1758,7 @@ static s32 cake_enqueue(struct sk_buff *
q->avg_window_begin));
u64 b = q->avg_window_bytes * (u64)NSEC_PER_SEC;
- do_div(b, window_interval);
+ b = div64_u64(b, window_interval);
q->avg_peak_bandwidth =
cake_ewma(q->avg_peak_bandwidth, b,
b > q->avg_peak_bandwidth ? 2 : 8);
Patches currently in stable-queue which might be from wenyang@linux.alibaba.com are
queue-4.19/sch_cake-avoid-possible-divide-by-zero-in-cake_enqueue.patch
queue-4.19/regulator-fix-use-after-free-issue.patch
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Cake] Patch "sch_cake: avoid possible divide by zero in cake_enqueue()" has been added to the 4.19-stable tree
2020-01-11 8:18 [Cake] Patch "sch_cake: avoid possible divide by zero in cake_enqueue()" has been added to the 4.19-stable tree gregkh
@ 2020-01-11 20:40 ` Dave Taht
2020-01-11 21:20 ` Kevin 'ldir' Darbyshire-Bryant
0 siblings, 1 reply; 6+ messages in thread
From: Dave Taht @ 2020-01-11 20:40 UTC (permalink / raw)
Cc: Cake List, Kevin 'ldir' Darbyshire-Bryant,
Toke Høiland-Jørgensen
did this make it into openwrt already?
On Sat, Jan 11, 2020 at 12:19 AM <gregkh@linuxfoundation.org> wrote:
>
>
> This is a note to let you know that I've just added the patch titled
>
> sch_cake: avoid possible divide by zero in cake_enqueue()
>
> to the 4.19-stable tree which can be found at:
> http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
>
> The filename of the patch is:
> sch_cake-avoid-possible-divide-by-zero-in-cake_enqueue.patch
> and it can be found in the queue-4.19 subdirectory.
>
> If you, or anyone else, feels it should not be added to the stable tree,
> please let <stable@vger.kernel.org> know about it.
>
>
> From foo@baz Sat 11 Jan 2020 09:14:34 AM CET
> From: Wen Yang <wenyang@linux.alibaba.com>
> Date: Thu, 2 Jan 2020 17:21:43 +0800
> Subject: sch_cake: avoid possible divide by zero in cake_enqueue()
>
> From: Wen Yang <wenyang@linux.alibaba.com>
>
> [ Upstream commit 68aab823c223646fab311f8a6581994facee66a0 ]
>
> The variables 'window_interval' is u64 and do_div()
> truncates it to 32 bits, which means it can test
> non-zero and be truncated to zero for division.
> The unit of window_interval is nanoseconds,
> so its lower 32-bit is relatively easy to exceed.
> Fix this issue by using div64_u64() instead.
>
> Fixes: 7298de9cd725 ("sch_cake: Add ingress mode")
> Signed-off-by: Wen Yang <wenyang@linux.alibaba.com>
> Cc: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
> Cc: Toke Høiland-Jørgensen <toke@redhat.com>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Cong Wang <xiyou.wangcong@gmail.com>
> Cc: cake@lists.bufferbloat.net
> Cc: netdev@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
> net/sched/sch_cake.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- a/net/sched/sch_cake.c
> +++ b/net/sched/sch_cake.c
> @@ -1758,7 +1758,7 @@ static s32 cake_enqueue(struct sk_buff *
> q->avg_window_begin));
> u64 b = q->avg_window_bytes * (u64)NSEC_PER_SEC;
>
> - do_div(b, window_interval);
> + b = div64_u64(b, window_interval);
> q->avg_peak_bandwidth =
> cake_ewma(q->avg_peak_bandwidth, b,
> b > q->avg_peak_bandwidth ? 2 : 8);
>
>
> Patches currently in stable-queue which might be from wenyang@linux.alibaba.com are
>
> queue-4.19/sch_cake-avoid-possible-divide-by-zero-in-cake_enqueue.patch
> queue-4.19/regulator-fix-use-after-free-issue.patch
> _______________________________________________
> Cake mailing list
> Cake@lists.bufferbloat.net
> https://lists.bufferbloat.net/listinfo/cake
--
Make Music, Not War
Dave Täht
CTO, TekLibre, LLC
http://www.teklibre.com
Tel: 1-831-435-0729
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Cake] Patch "sch_cake: avoid possible divide by zero in cake_enqueue()" has been added to the 4.19-stable tree
2020-01-11 20:40 ` Dave Taht
@ 2020-01-11 21:20 ` Kevin 'ldir' Darbyshire-Bryant
2020-01-11 21:38 ` Dave Taht
0 siblings, 1 reply; 6+ messages in thread
From: Kevin 'ldir' Darbyshire-Bryant @ 2020-01-11 21:20 UTC (permalink / raw)
To: Dave Taht; +Cc: Cake List, Toke Høiland-Jørgensen
[-- Attachment #1: Type: text/plain, Size: 1604 bytes --]
> On 11 Jan 2020, at 20:40, Dave Taht <dave.taht@gmail.com> wrote:
>
> did this make it into openwrt already?
It’s complicated and it depends what you mean by openwrt.
First off, the fix relates to auto-bandwith mode or whatever it’s called and I don’t think many people use it. Nonetheless:
Is the fix in ’net-next’: yes
Is the fix in 4.19 stable: In the queue for 4.19.95
Is openwrt on 4.19.95: No
Does openwrt use the in-tree version of Cake?: No
Is the fix in the Out-Of-Tree cake git repo: Yes
Has the openwrt CAKE package been bumped to follow cake git repo?: master, yes, as of 2020/01/11 (earlier today)
OpenWrt 19.07 has just been released, its concept of cake package has not been bumped. Neither has 18.06.
It is worth noting that until yesterday/recently the out of tree cake repo had residue in it from some experimental stuff (SCE & updating conntrack marks) and did not represent upstream in-tree CAKE anyway. That situation was corrected AFAIK completely this morning.
Ideally I would like openwrt to use the in-tree CAKE, with ‘feature backports’ from later kernels as backport patches. Unfortunately some targets in openwrt are still on 4.14 kernels so there is no in-tree CAKE to use. Dropping CAKE from pre 4.19 kernels caused a bit of an outcry when I did it, so the next idea was to have a choice of cake kernel module for K4.19 targets, in-tree & out-of-tree CAKE. Unfortunately that exposed a weakness in package dependency selection, so that idea hasn’t flown either. I’m afraid enthusiasm levels then dropped.
[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Cake] Patch "sch_cake: avoid possible divide by zero in cake_enqueue()" has been added to the 4.19-stable tree
2020-01-11 21:20 ` Kevin 'ldir' Darbyshire-Bryant
@ 2020-01-11 21:38 ` Dave Taht
2020-01-12 9:53 ` Kevin 'ldir' Darbyshire-Bryant
2020-01-16 12:47 ` Sebastian Gottschall
0 siblings, 2 replies; 6+ messages in thread
From: Dave Taht @ 2020-01-11 21:38 UTC (permalink / raw)
To: Kevin 'ldir' Darbyshire-Bryant
Cc: Cake List, Toke Høiland-Jørgensen
Thank you for all the gymnastics to keep cake alive in openwrt.
I would still like there to be a sce branch of the out of tree work
that I could point people at
in my lca talk this week, but I understand that's increasingly difficult.
On Sat, Jan 11, 2020 at 1:20 PM Kevin 'ldir' Darbyshire-Bryant
<ldir@darbyshire-bryant.me.uk> wrote:
>
>
>
> > On 11 Jan 2020, at 20:40, Dave Taht <dave.taht@gmail.com> wrote:
> >
> > did this make it into openwrt already?
>
> It’s complicated and it depends what you mean by openwrt.
>
> First off, the fix relates to auto-bandwith mode or whatever it’s called and I don’t think many people use it. Nonetheless:
>
> Is the fix in ’net-next’: yes
> Is the fix in 4.19 stable: In the queue for 4.19.95
>
> Is openwrt on 4.19.95: No
> Does openwrt use the in-tree version of Cake?: No
>
> Is the fix in the Out-Of-Tree cake git repo: Yes
>
> Has the openwrt CAKE package been bumped to follow cake git repo?: master, yes, as of 2020/01/11 (earlier today)
>
> OpenWrt 19.07 has just been released, its concept of cake package has not been bumped. Neither has 18.06.
>
>
> It is worth noting that until yesterday/recently the out of tree cake repo had residue in it from some experimental stuff (SCE & updating conntrack marks) and did not represent upstream in-tree CAKE anyway. That situation was corrected AFAIK completely this morning.
>
> Ideally I would like openwrt to use the in-tree CAKE, with ‘feature backports’ from later kernels as backport patches. Unfortunately some targets in openwrt are still on 4.14 kernels so there is no in-tree CAKE to use. Dropping CAKE from pre 4.19 kernels caused a bit of an outcry when I did it, so the next idea was to have a choice of cake kernel module for K4.19 targets, in-tree & out-of-tree CAKE. Unfortunately that exposed a weakness in package dependency selection, so that idea hasn’t flown either. I’m afraid enthusiasm levels then dropped.
>
>
--
Make Music, Not War
Dave Täht
CTO, TekLibre, LLC
http://www.teklibre.com
Tel: 1-831-435-0729
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Cake] Patch "sch_cake: avoid possible divide by zero in cake_enqueue()" has been added to the 4.19-stable tree
2020-01-11 21:38 ` Dave Taht
@ 2020-01-12 9:53 ` Kevin 'ldir' Darbyshire-Bryant
2020-01-16 12:47 ` Sebastian Gottschall
1 sibling, 0 replies; 6+ messages in thread
From: Kevin 'ldir' Darbyshire-Bryant @ 2020-01-12 9:53 UTC (permalink / raw)
To: Dave Taht; +Cc: Cake List, Toke Høiland-Jørgensen
[-- Attachment #1: Type: text/plain, Size: 1078 bytes --]
> On 11 Jan 2020, at 21:38, Dave Taht <dave.taht@gmail.com> wrote:
>
> Thank you for all the gymnastics to keep cake alive in openwrt.
>
> I would still like there to be a sce branch of the out of tree work
> that I could point people at
> in my lca talk this week, but I understand that's increasingly difficult.
Jonathan advised me that the version of SCE in CAKE was out of date and we didn’t really want openwrt accidentally using the bonus features, hence the ‘no objection’ to removing all the non upstream kernel stuff from master. Perhaps creating an ’SCE’ feature branch is the way forward? Wireguard recently went through a similar change in that now wireguard is in (very recent) kernels, Jason has split development repos into something like ‘Wireguard for upstream’, ‘Wireguard for out-of-tree with loads of compat stubs’ & ‘wireguard userspace tools’.
We have a similar problem in that we have requirement for ‘cake for upstream’, ‘cake for out-of-tree’ & ‘cake for out-of-tree feature dev'
Cheers,
Kevin
[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Cake] Patch "sch_cake: avoid possible divide by zero in cake_enqueue()" has been added to the 4.19-stable tree
2020-01-11 21:38 ` Dave Taht
2020-01-12 9:53 ` Kevin 'ldir' Darbyshire-Bryant
@ 2020-01-16 12:47 ` Sebastian Gottschall
1 sibling, 0 replies; 6+ messages in thread
From: Sebastian Gottschall @ 2020-01-16 12:47 UTC (permalink / raw)
To: cake
dd-wrt has it already :-)
Am 11.01.2020 um 22:38 schrieb Dave Taht:
> Thank you for all the gymnastics to keep cake alive in openwrt.
>
> I would still like there to be a sce branch of the out of tree work
> that I could point people at
> in my lca talk this week, but I understand that's increasingly difficult.
>
> On Sat, Jan 11, 2020 at 1:20 PM Kevin 'ldir' Darbyshire-Bryant
> <ldir@darbyshire-bryant.me.uk> wrote:
>>
>>
>>> On 11 Jan 2020, at 20:40, Dave Taht <dave.taht@gmail.com> wrote:
>>>
>>> did this make it into openwrt already?
>> It’s complicated and it depends what you mean by openwrt.
>>
>> First off, the fix relates to auto-bandwith mode or whatever it’s called and I don’t think many people use it. Nonetheless:
>>
>> Is the fix in ’net-next’: yes
>> Is the fix in 4.19 stable: In the queue for 4.19.95
>>
>> Is openwrt on 4.19.95: No
>> Does openwrt use the in-tree version of Cake?: No
>>
>> Is the fix in the Out-Of-Tree cake git repo: Yes
>>
>> Has the openwrt CAKE package been bumped to follow cake git repo?: master, yes, as of 2020/01/11 (earlier today)
>>
>> OpenWrt 19.07 has just been released, its concept of cake package has not been bumped. Neither has 18.06.
>>
>>
>> It is worth noting that until yesterday/recently the out of tree cake repo had residue in it from some experimental stuff (SCE & updating conntrack marks) and did not represent upstream in-tree CAKE anyway. That situation was corrected AFAIK completely this morning.
>>
>> Ideally I would like openwrt to use the in-tree CAKE, with ‘feature backports’ from later kernels as backport patches. Unfortunately some targets in openwrt are still on 4.14 kernels so there is no in-tree CAKE to use. Dropping CAKE from pre 4.19 kernels caused a bit of an outcry when I did it, so the next idea was to have a choice of cake kernel module for K4.19 targets, in-tree & out-of-tree CAKE. Unfortunately that exposed a weakness in package dependency selection, so that idea hasn’t flown either. I’m afraid enthusiasm levels then dropped.
>>
>>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-01-16 12:48 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-11 8:18 [Cake] Patch "sch_cake: avoid possible divide by zero in cake_enqueue()" has been added to the 4.19-stable tree gregkh
2020-01-11 20:40 ` Dave Taht
2020-01-11 21:20 ` Kevin 'ldir' Darbyshire-Bryant
2020-01-11 21:38 ` Dave Taht
2020-01-12 9:53 ` Kevin 'ldir' Darbyshire-Bryant
2020-01-16 12:47 ` Sebastian Gottschall
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox