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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAFNq8R7xYA2GTpWE-5rHr5c-xX0ZONKHX6wSbra2MDo1M2DSHQ@mail.gmail.com>
Date:	Fri, 31 Oct 2014 18:14:19 +0800
From:	Li Haifeng <omycle@...il.com>
To:	Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
Cc:	open list <linux-kernel@...r.kernel.org>,
	"open list:MEMORY MANAGEMENT" <linux-mm@...ck.org>
Subject: [PATCH] Frontswap: fix the condition in BUG_ON

>From 012a564c7210346b99d12e3d2485542bb090586e Mon Sep 17 00:00:00 2001
From: Haifeng Li <omycle@...il.com>
Date: Fri, 31 Oct 2014 17:40:44 +0800
Subject: [PATCH] Frontswap: fix the condition in BUG_ON

The largest index of swap device is MAX_SWAPFILES-1. So the type
should be less than MAX_SWAPFILES.

Signed-off-by: Haifeng Li <omycle@...il.com>
---
 mm/frontswap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/frontswap.c b/mm/frontswap.c
index c30eec5..1b80c05 100644
--- a/mm/frontswap.c
+++ b/mm/frontswap.c
@@ -182,7 +182,7 @@ void __frontswap_init(unsigned type, unsigned long *map)
        if (frontswap_ops)
                frontswap_ops->init(type);
        else {
-               BUG_ON(type > MAX_SWAPFILES);
+               BUG_ON(type >= MAX_SWAPFILES);
                set_bit(type, need_init);
        }
 }
-- 
1.9.1
--
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