Unverified Commit 483887d6 authored by Nathan Chancellor's avatar Nathan Chancellor
Browse files

ANDROID: Incremental fs: Use ERR_CAST in handle_mapped_file()

When building android-mainline with a version of clang that supports
CONFIG_RANDSTRUCT, there are errors about casts from randomized
structures to non-randomized structures:

  fs/incfs/data_mgmt.c:240:10: error: casting from randomized structure pointer type 'struct dentry *' to 'struct data_file *'
                  return (struct data_file *)index_file_dentry;
                         ^
  fs/incfs/data_mgmt.c:257:12: error: casting from randomized structure pointer type 'struct file *' to 'struct data_file *'
                  result = (struct data_file *)bf;
                           ^
  2 errors generated.

As suggested by Kees on aosp/1995750, these casts should actually be
using the ERR_CAST macro, which is a more proper way to pass error
pointers around.

Change-Id: Iab73ac7503235f1147154a01a22ab8608e3daf8b
Fixes: 3f493810 ("ANDROID: Incremental fs: Create mapped file")
Link: https://github.com/ClangBuiltLinux/linux/issues/1652


Suggested-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
parent 0f0ddc32
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment