Bugfix: A patch that fixes a minor loop device bug

Nimrod Zimerman (zimerman@forfree.at)
Fri, 7 Aug 1998 17:42:51 +0300


Hello.

Below is a patch that fixes a minor bug with the loop device. The problem is
with an empty XOR encryption password, that causes a division by zero.
The fix: Empty XOR passwords are rejected.

The patch can be applied on both kernel 2.0.35 and kernel 2.1.115,
though it has only been tested on 2.0.35.

Here goes:

======
--- loop.c.original.loop-fix Fri Aug 7 13:09:59 1998
+++ loop.c Fri Aug 7 17:28:29 1998
@@ -17,3 +17,7 @@
+ *
+ * Zero length XOR encryption passwords caused a division by zero -
+ * they are now rejected.
+ * By Nimrod Zimerman <zimerman@forfree.at>, August 7, 1998.
*/

#include <linux/module.h>
@@ -365,7 +369,7 @@
case LO_CRYPT_NONE:
break;
case LO_CRYPT_XOR:
- if (info.lo_encrypt_key_size < 0)
+ if (info.lo_encrypt_key_size <= 0)
return -EINVAL;
break;
#ifdef DES_AVAILABLE
======

Nimrod

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html