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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 20 Dec 2011 09:31:33 -0800
From:	"Williams, Dan J" <dan.j.williams@...el.com>
To:	Tao Ma <tm@....ma>
Cc:	linux-kernel@...r.kernel.org, linux-scsi@...r.kernel.org,
	Jens Axboe <axboe@...nel.dk>,
	"Nadolski, Edmund" <edmund.nadolski@...el.com>,
	Meelis Roos <mroos@...ee>
Subject: Re: [PATCH] block: warn the wrong tag only if it is greater than real_max_depth.

[ adding original bug reporters ]

On Tue, Dec 20, 2011 at 7:58 AM, Tao Ma <tm@....ma> wrote:
> From: Tao Ma <boyu.mt@...bao.com>
>
> In queue depth decreases, we could meet with a tag greater than max_depth,
> but it should never be greater than real_max_depth. So only WARN if
> it is greater than real_max_depth and let it complets if it is greater
> than max_depth.
>
> Reported-by: Dan Williams <dan.j.williams@...el.com>
> Cc: Jens Axboe <axboe@...nel.dk>
> Signed-off-by: Tao Ma <boyu.mt@...bao.com>
> ---
>  block/blk-tag.c |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/block/blk-tag.c b/block/blk-tag.c
> index e74d6d1..1c50d34 100644
> --- a/block/blk-tag.c
> +++ b/block/blk-tag.c
> @@ -286,12 +286,12 @@ void blk_queue_end_tag(struct request_queue *q, struct request *rq)
>
>        BUG_ON(tag == -1);
>
> -       if (unlikely(tag >= bqt->max_depth)) {
> +       if (unlikely(tag >= bqt->real_max_depth)) {
>                /*
> -                * This can happen after tag depth has been reduced.
> -                * But tag shouldn't be larger than real_max_depth.
> +                * tag shouldn't be larger than real_max_depth.
>                 */
> -               WARN_ON(tag >= bqt->real_max_depth);
> +               WARN(1, "tag %d, bqt->real_max_depth %d\n",
> +                    tag, bqt->real_max_depth);
>                return;
>        }

You can use the WARN macro in the if() statement, and maybe it should
only trigger once??

diff --git a/block/blk-tag.c b/block/blk-tag.c
index 918d82c..19cdde4 100644
--- a/block/blk-tag.c
+++ b/block/blk-tag.c
@@ -291,12 +291,13 @@ void blk_queue_end_tag(struct request_queue *q,
struct request *rq)

        BUG_ON(tag == -1);

-       if (unlikely(tag >= bqt->max_depth)) {
+       if (WARN_ONCE(tag >= bqt->real_max_depth,
+                     "%s: tag %d greater than tag map size: %d\n",
+                     __func__, tag, bqt->real_max_depth)) {
                /*
                 * This can happen after tag depth has been reduced.
                 * But tag shouldn't be larger than real_max_depth.
                 */
-               WARN_ON(tag >= bqt->real_max_depth);
                return;
        }
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ