From mboxrd@z Thu Jan 1 00:00:00 1970 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 95967EB64D7 for ; Wed, 21 Jun 2023 04:17:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229516AbjFUER3 (ORCPT ); Wed, 21 Jun 2023 00:17:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229448AbjFUER2 (ORCPT ); Wed, 21 Jun 2023 00:17:28 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CE6E1706 for ; Tue, 20 Jun 2023 21:17:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=JchSKRnjMgCznYKknupBkF9TD5dHCGWbwIuW0emXZI4=; b=tMHC/V0CjqAApcPkt7OdBTnWii u8lwttOtZB5SpLkGTVtJoymLvrpoBahdF+yb7vkJeCvxw/qbZYLHI/69JW3McY9LgISmiAzC2TCdu 0+L5myg3hUjvGOnSerZ8XYLAoR1e9qQxeF5jHUSKBYF6enkjqV2WcDS/RW9xVgmsHjrVh7DkVoLsl LvSpcPIOUydVUdBIq5RVJXFW392el6cMsIIIAh4eVklpl7K/0VSq+XYcbj/G57OiRpSGyu1bM7df4 NNh0hMZEqfuCvaSp8QNCdqWB8/axYdpMHkK/XlUfvG/dvRNlUfva42bAQ6HBKIAGxO/+uIhgIi6fq P3hAekYQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1qBpHZ-00DB42-22; Wed, 21 Jun 2023 04:17:25 +0000 Date: Tue, 20 Jun 2023 21:17:25 -0700 From: Christoph Hellwig To: Jens Axboe Cc: io-uring Subject: Re: [PATCH] io_uring/net: silence sparse warnings on address space Message-ID: References: <222f3e9e-62a4-a57d-b14c-c8e9185ca1ae@kernel.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <222f3e9e-62a4-a57d-b14c-c8e9185ca1ae@kernel.dk> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org On Tue, Jun 20, 2023 at 04:55:05PM -0600, Jens Axboe wrote: > Rather than assign the user pointer to msghdr->msg_control, assign it > to msghdr->msg_control_user to make sparse happy. They are in a union > so the end result is the same, but let's avoid new sparse warnings and > squash this one. Te patch looks good, but I think "silence sparse warning" is a horrible way to write a commit message. Yes, you're silencing sparse, but sparse only complains because we have a type mismatch. So the much better Subject would be something like: io_uring/net: use the correct msghdr union member in io_sendmsg_copy_hdr Use msg_control_user to read the control message in io_sendmsg_copy_hdr as we expect a user pointer, not the kernel pointer in msg_control. The end result is the same, but this avoids a sparse addres space warning. With that: Reviewed-by: Christoph Hellwig (and it's really time we ger the __user and __bitwise annotations checked by hte actual compiler..)