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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87ehyz8kqe.fsf@devron.myhome.or.jp>
Date:	Thu, 29 Sep 2011 23:51:53 +0900
From:	OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
To:	Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: [PATCHv3] fat: don't use custom hex_to_bin()

Andy Shevchenko <andriy.shevchenko@...ux.intel.com> writes:

> +					/* The ip contains 2 bytes in little
> +					 * endian format. We need to get them
> +					 * in native endian. */
> +
> +					rc = hex2bin(op++, ip + 3, 1);
> +					if (rc < 0)
> +						return -EINVAL;
> +
> +					rc = hex2bin(op++, ip + 1, 1);
> +					if (rc < 0)
>  						return -EINVAL;
> -					}
> -					*op++ = ec & 0xFF;
> -					*op++ = ec >> 8;
> +

It will not work for big endian arch correctly like original code.

"ip" is made like following,

			if (uni_xlate == 1) {
				*op++ = ':';
				op = pack_hex_byte(op, ec >> 8);
				op = pack_hex_byte(op, ec);
				len -= 5;
			} else {


Maybe, my explanation was not good. Like above, "ip" format is like
":1234" (can say big endian, it's the string though), so, this code made
a unicode char (op) as little endian.

Thanks.
-- 
OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
--
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