[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191217074904.GA2474507@kroah.com>
Date: Tue, 17 Dec 2019 08:49:04 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@...hiba.co.jp>
Cc: linux-kernel@...r.kernel.org, stable@...r.kernel.org,
Ming Lei <ming.lei@...hat.com>, Jens Axboe <axboe@...nel.dk>
Subject: Re: [PATCH 4.14 204/267] blk-mq: avoid sysfs buffer overflow with
too many CPU cores
On Tue, Dec 17, 2019 at 01:28:29PM +0900, Nobuhiro Iwamatsu wrote:
> On Mon, Dec 16, 2019 at 06:48:50PM +0100, Greg Kroah-Hartman wrote:
> > From: Ming Lei <ming.lei@...hat.com>
> >
> > commit 8962842ca5abdcf98e22ab3b2b45a103f0408b95 upstream.
> >
> > It is reported that sysfs buffer overflow can be triggered if the system
> > has too many CPU cores(>841 on 4K PAGE_SIZE) when showing CPUs of
> > hctx via /sys/block/$DEV/mq/$N/cpu_list.
> >
> > Use snprintf to avoid the potential buffer overflow.
> >
> > This version doesn't change the attribute format, and simply stops
> > showing CPU numbers if the buffer is going to overflow.
> >
> > Cc: stable@...r.kernel.org
> > Fixes: 676141e48af7("blk-mq: don't dump CPU -> hw queue map on driver load")
> > Signed-off-by: Ming Lei <ming.lei@...hat.com>
> > Signed-off-by: Jens Axboe <axboe@...nel.dk>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> >
>
> This commit also required following commit:
>
> commit d2c9be89f8ebe7ebcc97676ac40f8dec1cf9b43a
> Author: Ming Lei <ming.lei@...hat.com>
> Date: Mon Nov 4 16:26:53 2019 +0800
>
> blk-mq: make sure that line break can be printed
>
> 8962842ca5ab ("blk-mq: avoid sysfs buffer overflow with too many CPU cores")
> avoids sysfs buffer overflow, and reserves one character for line break.
> However, the last snprintf() doesn't get correct 'size' parameter passed
> in, so fixed it.
>
> Fixes: 8962842ca5ab ("blk-mq: avoid sysfs buffer overflow with too many CPU cores")
> Signed-off-by: Ming Lei <ming.lei@...hat.com>
> Signed-off-by: Jens Axboe <axboe@...nel.dk>
>
>
> And this is also required for 4.4, 4.9 and 4.19.
> Please apply.
Thank you for catching this, now queued up.
greg k-h
Powered by blists - more mailing lists