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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C8849CFC538 for ; Mon, 14 Oct 2024 10:30:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=qmD2WoaHNSnvqE0DuzY0mlqEwvDIgNxaYNlJNDnAd4k=; b=jXS/8ZdzQpg7ZwNuE68spJ+ZSt ypjW9zvXtZ880EXQge/7Pl6mSdFMMfCokPiOVXkp5rbvry+VaL/tUz3krr5GK584Ndt+Gt8bMuAbZ lf388RjEaJrt7y5D9PaENyUfWFt3TggajBeUzVVXeJWZ7pjRVqLazwqdFmTJp2mDcMZevLO7imWTb N+gnGm9Z58iIvEBSCWro++0H6w3HHoxxcsUFs3qXOYHd8aqhUbWbBdF6b5yU2U8O86kH7oKlEW67T YUfQthz/FGuPyQdKpuwiSkxazbMJ4GtNbRRoCTDkrMZcj5e7EgQC4U+So8n4m0mraQCHcTtDTZPXF ASy+/ErQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0ILS-00000004hd9-1UF4; Mon, 14 Oct 2024 10:30:34 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0Hzf-00000004e61-3xZQ for linux-arm-kernel@lists.infradead.org; Mon, 14 Oct 2024 10:08:05 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C8DD11007; Mon, 14 Oct 2024 03:08:32 -0700 (PDT) Received: from bogus (e133711.arm.com [10.1.196.55]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8DFA73F51B; Mon, 14 Oct 2024 03:08:02 -0700 (PDT) Date: Mon, 14 Oct 2024 11:08:00 +0100 From: Sudeep Holla To: Gavin Shan Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, shan.gavin@gmail.com Subject: Re: [PATCH] firmware: arm_ffa: Fix warning caused by export_uuid() Message-ID: References: <20241014004724.991353-1-gshan@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20241014004724.991353-1-gshan@redhat.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241014_030804_053841_E37F961A X-CRM114-Status: GOOD ( 11.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Oct 14, 2024 at 10:47:24AM +1000, Gavin Shan wrote: > Run into build warning caused by export_uuid() where the UUID's > length exceeds that of ffa_value_t::a2, as the following warning > messages indicate. > > In function ‘fortify_memcpy_chk’, > inlined from ‘export_uuid’ at ./include/linux/uuid.h:88:2, > inlined from ‘ffa_msg_send_direct_req2’ at drivers/firmware/arm_ffa/driver.c:488:2: > ./include/linux/fortify-string.h:571:25: error: call to ‘__write_overflow_field’ \ > declared with attribute warning: detected write beyond size of field (1st parameter); \ > maybe use struct_group()? [-Werror=attribute-warning] > 571 | __write_overflow_field(p_size_field, size); > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > Fix it by not passing a plain buffer to memcpy() to avoid the overflow > and underflow warning, similar to what have been done to copy over the > struct ffa_send_direct_data2. > Are you observing this just on the upstream or -next as well? There is a fix in the -next which I haven't sent to soc team yet, will do so soon. -- Regards, Sudeep