Re: [PATCH] kasan: avoid overflowing quarantine size on low memory systems

2016-08-30 Thread amanda4ray
On Monday, August 1, 2016 at 10:59:29 AM UTC-4, Alexander Potapenko wrote: > If the total amount of memory assigned to quarantine is less than the > amount of memory assigned to per-cpu quarantines, |new_quarantine_size| > may overflow. Instead, set it to zero. > > Reported-by: Dmitry Vyukov

Re: [PATCH] kasan: avoid overflowing quarantine size on low memory systems

2016-08-30 Thread amanda4ray
On Monday, August 1, 2016 at 10:59:29 AM UTC-4, Alexander Potapenko wrote: > If the total amount of memory assigned to quarantine is less than the > amount of memory assigned to per-cpu quarantines, |new_quarantine_size| > may overflow. Instead, set it to zero. > > Reported-by: Dmitry Vyukov >

Re: [PATCH] kasan: avoid overflowing quarantine size on low memory systems

2016-08-02 Thread Andrey Ryabinin
On 08/01/2016 05:59 PM, Alexander Potapenko wrote: > If the total amount of memory assigned to quarantine is less than the > amount of memory assigned to per-cpu quarantines, |new_quarantine_size| > may overflow. Instead, set it to zero. > Just curious, how did find this? Overflow is possible

Re: [PATCH] kasan: avoid overflowing quarantine size on low memory systems

2016-08-02 Thread Andrey Ryabinin
On 08/01/2016 05:59 PM, Alexander Potapenko wrote: > If the total amount of memory assigned to quarantine is less than the > amount of memory assigned to per-cpu quarantines, |new_quarantine_size| > may overflow. Instead, set it to zero. > Just curious, how did find this? Overflow is possible

Re: [PATCH] kasan: avoid overflowing quarantine size on low memory systems

2016-08-02 Thread Alexander Potapenko
On Tue, Aug 2, 2016 at 12:23 PM, Andrey Ryabinin wrote: > > > On 08/02/2016 01:07 PM, Alexander Potapenko wrote: >> On Tue, Aug 2, 2016 at 12:05 PM, Dmitry Vyukov wrote: >>> On Tue, Aug 2, 2016 at 12:00 PM, Andrey Ryabinin Why WARN? I'd

Re: [PATCH] kasan: avoid overflowing quarantine size on low memory systems

2016-08-02 Thread Alexander Potapenko
On Tue, Aug 2, 2016 at 12:23 PM, Andrey Ryabinin wrote: > > > On 08/02/2016 01:07 PM, Alexander Potapenko wrote: >> On Tue, Aug 2, 2016 at 12:05 PM, Dmitry Vyukov wrote: >>> On Tue, Aug 2, 2016 at 12:00 PM, Andrey Ryabinin Why WARN? I'd suggest pr_warn_once(); >>> >>> >>> I would

Re: [PATCH] kasan: avoid overflowing quarantine size on low memory systems

2016-08-02 Thread Andrey Ryabinin
On 08/02/2016 01:07 PM, Alexander Potapenko wrote: > On Tue, Aug 2, 2016 at 12:05 PM, Dmitry Vyukov wrote: >> On Tue, Aug 2, 2016 at 12:00 PM, Andrey Ryabinin >>> >>> Why WARN? I'd suggest pr_warn_once(); >> >> >> I would suggest to just do something useful. Setting

Re: [PATCH] kasan: avoid overflowing quarantine size on low memory systems

2016-08-02 Thread Andrey Ryabinin
On 08/02/2016 01:07 PM, Alexander Potapenko wrote: > On Tue, Aug 2, 2016 at 12:05 PM, Dmitry Vyukov wrote: >> On Tue, Aug 2, 2016 at 12:00 PM, Andrey Ryabinin >>> >>> Why WARN? I'd suggest pr_warn_once(); >> >> >> I would suggest to just do something useful. Setting quarantine >>

Re: [PATCH] kasan: avoid overflowing quarantine size on low memory systems

2016-08-02 Thread Dmitry Vyukov
On Tue, Aug 2, 2016 at 12:07 PM, Alexander Potapenko wrote: > On Tue, Aug 2, 2016 at 12:05 PM, Dmitry Vyukov wrote: >> On Tue, Aug 2, 2016 at 12:00 PM, Andrey Ryabinin >> wrote: >>> >>> >>> On 08/01/2016 05:59 PM, Alexander

Re: [PATCH] kasan: avoid overflowing quarantine size on low memory systems

2016-08-02 Thread Dmitry Vyukov
On Tue, Aug 2, 2016 at 12:07 PM, Alexander Potapenko wrote: > On Tue, Aug 2, 2016 at 12:05 PM, Dmitry Vyukov wrote: >> On Tue, Aug 2, 2016 at 12:00 PM, Andrey Ryabinin >> wrote: >>> >>> >>> On 08/01/2016 05:59 PM, Alexander Potapenko wrote: If the total amount of memory assigned to

Re: [PATCH] kasan: avoid overflowing quarantine size on low memory systems

2016-08-02 Thread Alexander Potapenko
On Tue, Aug 2, 2016 at 12:05 PM, Dmitry Vyukov wrote: > On Tue, Aug 2, 2016 at 12:00 PM, Andrey Ryabinin > wrote: >> >> >> On 08/01/2016 05:59 PM, Alexander Potapenko wrote: >>> If the total amount of memory assigned to quarantine is less than the >>>

Re: [PATCH] kasan: avoid overflowing quarantine size on low memory systems

2016-08-02 Thread Alexander Potapenko
On Tue, Aug 2, 2016 at 12:05 PM, Dmitry Vyukov wrote: > On Tue, Aug 2, 2016 at 12:00 PM, Andrey Ryabinin > wrote: >> >> >> On 08/01/2016 05:59 PM, Alexander Potapenko wrote: >>> If the total amount of memory assigned to quarantine is less than the >>> amount of memory assigned to per-cpu

Re: [PATCH] kasan: avoid overflowing quarantine size on low memory systems

2016-08-02 Thread Dmitry Vyukov
On Tue, Aug 2, 2016 at 12:00 PM, Andrey Ryabinin wrote: > > > On 08/01/2016 05:59 PM, Alexander Potapenko wrote: >> If the total amount of memory assigned to quarantine is less than the >> amount of memory assigned to per-cpu quarantines, |new_quarantine_size| >> may

Re: [PATCH] kasan: avoid overflowing quarantine size on low memory systems

2016-08-02 Thread Dmitry Vyukov
On Tue, Aug 2, 2016 at 12:00 PM, Andrey Ryabinin wrote: > > > On 08/01/2016 05:59 PM, Alexander Potapenko wrote: >> If the total amount of memory assigned to quarantine is less than the >> amount of memory assigned to per-cpu quarantines, |new_quarantine_size| >> may overflow. Instead, set it to

Re: [PATCH] kasan: avoid overflowing quarantine size on low memory systems

2016-08-02 Thread Alexander Potapenko
On Tue, Aug 2, 2016 at 12:00 PM, Andrey Ryabinin wrote: > > > On 08/01/2016 05:59 PM, Alexander Potapenko wrote: >> If the total amount of memory assigned to quarantine is less than the >> amount of memory assigned to per-cpu quarantines, |new_quarantine_size| >> may

Re: [PATCH] kasan: avoid overflowing quarantine size on low memory systems

2016-08-02 Thread Alexander Potapenko
On Tue, Aug 2, 2016 at 12:00 PM, Andrey Ryabinin wrote: > > > On 08/01/2016 05:59 PM, Alexander Potapenko wrote: >> If the total amount of memory assigned to quarantine is less than the >> amount of memory assigned to per-cpu quarantines, |new_quarantine_size| >> may overflow. Instead, set it to

Re: [PATCH] kasan: avoid overflowing quarantine size on low memory systems

2016-08-01 Thread Andrew Morton
On Mon, 1 Aug 2016 16:59:23 +0200 Alexander Potapenko wrote: > If the total amount of memory assigned to quarantine is less than the > amount of memory assigned to per-cpu quarantines, |new_quarantine_size| > may overflow. Instead, set it to zero. > > ---

Re: [PATCH] kasan: avoid overflowing quarantine size on low memory systems

2016-08-01 Thread Andrew Morton
On Mon, 1 Aug 2016 16:59:23 +0200 Alexander Potapenko wrote: > If the total amount of memory assigned to quarantine is less than the > amount of memory assigned to per-cpu quarantines, |new_quarantine_size| > may overflow. Instead, set it to zero. > > --- a/mm/kasan/quarantine.c > +++

[PATCH] kasan: avoid overflowing quarantine size on low memory systems

2016-08-01 Thread Alexander Potapenko
If the total amount of memory assigned to quarantine is less than the amount of memory assigned to per-cpu quarantines, |new_quarantine_size| may overflow. Instead, set it to zero. Reported-by: Dmitry Vyukov Fixes: 55834c59098d ("mm: kasan: initial memory quarantine

[PATCH] kasan: avoid overflowing quarantine size on low memory systems

2016-08-01 Thread Alexander Potapenko
If the total amount of memory assigned to quarantine is less than the amount of memory assigned to per-cpu quarantines, |new_quarantine_size| may overflow. Instead, set it to zero. Reported-by: Dmitry Vyukov Fixes: 55834c59098d ("mm: kasan: initial memory quarantine implementation")