From patchwork Fri Aug 5 11:54:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dylan Yudaken X-Patchwork-Id: 12937208 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9377C00140 for ; Fri, 5 Aug 2022 11:55:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240579AbiHELzd (ORCPT ); Fri, 5 Aug 2022 07:55:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240504AbiHELz0 (ORCPT ); Fri, 5 Aug 2022 07:55:26 -0400 Received: from mx0a-00082601.pphosted.com (mx0b-00082601.pphosted.com [67.231.153.30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 223ECDF9B for ; Fri, 5 Aug 2022 04:55:23 -0700 (PDT) Received: from pps.filterd (m0001303.ppops.net [127.0.0.1]) by m0001303.ppops.net (8.17.1.5/8.17.1.5) with ESMTP id 275A41PW012676 for ; Fri, 5 Aug 2022 04:55:23 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=facebook; bh=dzm6lFTYPM8VXyoRvfuf+LKZFL9the2YikdgW3RO2N0=; b=L6wv9Y3OBuxC6dwdRqK1np8Wf/tTrzXzGq913O9CA1FwaA3maRktKvDAqnI2P+PJLDeV sc2o81Trm9BMvwCPFh7Zetv8bqh12uDgpV8zqCmZEJ8rEDCuBBl5v3GCty7iS1FWRVH4 loRzwgHnb3itfogbxSfE2LgWkIzabIVNUTw= Received: from mail.thefacebook.com ([163.114.132.120]) by m0001303.ppops.net (PPS) with ESMTPS id 3hs14g8eea-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 05 Aug 2022 04:55:23 -0700 Received: from twshared25107.07.ash9.facebook.com (2620:10d:c085:208::f) by mail.thefacebook.com (2620:10d:c085:11d::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Fri, 5 Aug 2022 04:55:01 -0700 Received: by devbig038.lla2.facebook.com (Postfix, from userid 572232) id 4DCDE418592C; Fri, 5 Aug 2022 04:54:53 -0700 (PDT) From: Dylan Yudaken To: Jens Axboe , Pavel Begunkov , CC: , Dylan Yudaken , kernel test robot Subject: [PATCH] io_uring: fix io_recvmsg_prep_multishot casts Date: Fri, 5 Aug 2022 04:54:50 -0700 Message-ID: <20220805115450.3921352-1-dylany@fb.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-FB-Internal: Safe X-Proofpoint-ORIG-GUID: G8bQa22q-Ln8sameEbQ4FGeGN3vIBe54 X-Proofpoint-GUID: G8bQa22q-Ln8sameEbQ4FGeGN3vIBe54 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-05_05,2022-08-05_01,2022-06-22_01 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org Fix casts missing the __user parts. This seemed to only cause errors on the alpha build, but it was definitely an oversight. Reported-by: kernel test robot Fixes: 9bb66906f23e ("io_uring: support multishot in recvmsg") Signed-off-by: Dylan Yudaken --- Hi, I tried to reproduce this issue to be sure this fixes it, but I could not get the warnings out of the gcc I have locally. That being said it seems like a fairly clear fix. io_uring/net.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) base-commit: b2a88c212e652e94f1e4b635910972ac57ba4e97 diff --git a/io_uring/net.c b/io_uring/net.c index 32fc3da04e41..fa7a28b6bad5 100644 --- a/io_uring/net.c +++ b/io_uring/net.c @@ -575,12 +575,12 @@ static int io_recvmsg_prep_multishot(struct io_async_msghdr *kmsg, if (kmsg->controllen) { unsigned long control = ubuf + hdr - kmsg->controllen; - kmsg->msg.msg_control_user = (void *) control; + kmsg->msg.msg_control_user = (void __user *) control; kmsg->msg.msg_controllen = kmsg->controllen; } sr->buf = *buf; /* stash for later copy */ - *buf = (void *) (ubuf + hdr); + *buf = (void __user *) (ubuf + hdr); kmsg->payloadlen = *len = *len - hdr; return 0; }