From 2ccbb92f7facdf504b987f2ca7158b6ef19b6cb2 Mon Sep 17 00:00:00 2001 From: Aaron Ding Date: Thu, 5 Aug 2021 18:02:23 +0800 Subject: [PATCH] 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 Signed-off-by: Daniel Mentz Signed-off-by: Elliot Berman Change-Id: I7ad40df213897314c439480f22a2ef4712e84025 (cherry picked from commit 5ec931a85350cd1914f53949d32214583421e155) --- fs/userfaultfd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/userfaultfd.c b/fs/userfaultfd.c index e08cdbe51bc7..bda175d8f3c6 100644 --- a/fs/userfaultfd.c +++ b/fs/userfaultfd.c @@ -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;