ANDROID: userfaultfd: Fix merge resolution: validate_range()

On the android12-5.10 branch, commit 4a5cf92412ab ("BACKPORT: FROMGIT:
userfaultfd: add UFFDIO_CONTINUE ioctl") added a new call site for the
function validate_range(). Meanwhile, on the 5.10 stable branch, commit
0b591c020d280 ("userfaultfd: do not untag user pointers") changed the
function signature of validate_range() and updated all call sites
accordingly. However, since these two commits happened on different
branches, the new call site in userfaultfd_continue() has not been
updated accordingly. This has arguably been missed in the merge commit
66379c1ee513 ("Merge tag 'android12-5.10.66_r00' into
android12-5.10").

This patch fixes the following build breakage

./common/fs/userfaultfd.c:1875:32: error: incompatible pointer to integer conversion passing '__u64 *' (aka 'unsigned long long *') to parameter of type '__u64' (aka 'unsigned long long'); remove & [-Werror,-Wint-conversion]

        ret = validate_range(ctx->mm, &uffdio_continue.range.start,
                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
./common/fs/userfaultfd.c:1245:14: note: passing argument to parameter 'start' here
                                          __u64 start, __u64 len)
                                                ^
1 error generated.

Fixes: 66379c1ee513 ("Merge tag 'android12-5.10.66_r00' into android12-5.10")
Signed-off-by: Aaron Ding <aaronding@google.com>
Signed-off-by: Daniel Mentz <danielmentz@google.com>
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Change-Id: I7ad40df213897314c439480f22a2ef4712e84025
(cherry picked from commit 5ec931a85350cd1914f53949d32214583421e155)
(cherry picked from commit 2ccbb92f7facdf504b987f2ca7158b6ef19b6cb2)
This commit is contained in:
Aaron Ding
2021-08-05 18:02:23 +08:00
committed by Daniel Norman
parent b8aabd7d50
commit 69c623f0df

View File

@ -1872,7 +1872,7 @@ static int userfaultfd_continue(struct userfaultfd_ctx *ctx, unsigned long arg)
sizeof(uffdio_continue) - (sizeof(__s64))))
goto out;
ret = validate_range(ctx->mm, &uffdio_continue.range.start,
ret = validate_range(ctx->mm, uffdio_continue.range.start,
uffdio_continue.range.len);
if (ret)
goto out;