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: <481AFDC2.7030807@s5r6.in-berlin.de>
Date:	Fri, 02 May 2008 13:40:50 +0200
From:	Stefan Richter <stefanr@...6.in-berlin.de>
To:	Harvey Harrison <harvey.harrison@...il.com>
CC:	Andrew Morton <akpm@...ux-foundation.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 7/8] fs: use get_unaligned_* helpers

Harvey Harrison wrote:
>  fs/partitions/ldm.h |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/partitions/ldm.h b/fs/partitions/ldm.h
...
>  /* Most numbers we deal with are big-endian and won't be aligned. */
> -#define BE16(x)			((u16)be16_to_cpu(get_unaligned((__be16*)(x))))
> -#define BE32(x)			((u32)be32_to_cpu(get_unaligned((__be32*)(x))))
> -#define BE64(x)			((u64)be64_to_cpu(get_unaligned((__be64*)(x))))
> +#define BE16(x)		get_unaligned_be16((x))
> +#define BE32(x)		get_unaligned_be32((x))
> +#define BE64(x)		get_unaligned_be64((x))

Why the double parentheses?

More importantly, I would say ldm.c should rather use
get_unaligned_be*() directly.  No need to hide what these macros are
about by using a local alias.

After that, ldm.c should be inspected for whether really all of the
accesses are unaligned.  If there are any which are guaranteed to be
aligned, they should of course be turned into be*_to_cpu().  But
separately from this conversion to get_unaligned_be*().
-- 
Stefan Richter
-=====-==--- -=-= ---=-
http://arcgraph.de/sr/
--
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