From nobody Fri May 3 16:29:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1610632907; cv=none; d=zohomail.com; s=zohoarc; b=X3/Xoup54IJ/fx0Esi+vAxAG46IGbcjRIv4VQJbNCpouNqKh+MspmBDSZn2komDZVgYbTzvXe+4KJT7Q5HYhxe6vkPHvtm2GROBKrOwqyNfmr51V8A5dWZVPGwXf9t3UiKwqjZgJew6qL0zgfuzpX7aMS8u1OwWjvIT6TzM8iLo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1610632907; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=ozV+NI5tJw/UDqRBwSjSuM2/yJJ8OSfM2DDUK0Itn6A=; b=UK5BkQbdQSIWT2dSIkOytFiM3guVPNd8h7WsV3pBpPLHpxy1snj1xUYMF9GHUpqX9Y5NuZ5u3fzttxKHYToor7nheGB2MNRvs/Hp6YQtFiD3UwFQK/VOsUU37KeZ8DYnDPrXlITjsyI9KNgkYmPXOn+pmlX3hv91K/N+lW1Feoc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1610632906963909.6967038903315; Thu, 14 Jan 2021 06:01:46 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.67036.119317 (Exim 4.92) (envelope-from ) id 1l03BX-0007GX-El; Thu, 14 Jan 2021 14:01:11 +0000 Received: by outflank-mailman (output) from mailman id 67036.119317; Thu, 14 Jan 2021 14:01:11 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l03BX-0007GQ-Bk; Thu, 14 Jan 2021 14:01:11 +0000 Received: by outflank-mailman (input) for mailman id 67036; Thu, 14 Jan 2021 14:01:10 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l03BW-0007GL-J3 for xen-devel@lists.xenproject.org; Thu, 14 Jan 2021 14:01:10 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id de20bc0a-eb8c-440e-95fb-f8a31c718429; Thu, 14 Jan 2021 14:01:06 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 9DAA8ACB0; Thu, 14 Jan 2021 14:01:05 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: de20bc0a-eb8c-440e-95fb-f8a31c718429 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1610632865; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ozV+NI5tJw/UDqRBwSjSuM2/yJJ8OSfM2DDUK0Itn6A=; b=TlU/iV0/2lOkYm+I3mD7V1rP/0kFhrvYrFySS5m9s+tHP9zJhnErkxZSPXPxYOegsj+FaZ B/bXupI37yIA/if1oxxk/SZkllIGAaNgcuhs6JE60FwcNWqqXzzLSqQw37bQ9gbX4m+RJH HEqqLOlcqUNa+RkZvnkZboRIgMbP7/I= To: "xen-devel@lists.xenproject.org" Cc: Christopher Clark From: Jan Beulich Subject: [PATCH] argo: don't leak stack contents when returning ring info Message-ID: Date: Thu, 14 Jan 2021 15:01:06 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @suse.com) Content-Type: text/plain; charset="utf-8" The max_message_size field of the output gets filled only when the flags field is non-zero. Don't copy back uninitialized data to guest context. Signed-off-by: Jan Beulich --- a/xen/common/argo.c +++ b/xen/common/argo.c @@ -1405,7 +1405,8 @@ fill_ring_data(const struct domain *curr rcu_unlock_domain(dst_d); =20 if ( !ret && (__copy_field_to_guest(data_ent_hnd, &ent, flags) || - __copy_field_to_guest(data_ent_hnd, &ent, max_message_si= ze)) ) + (ent.flags && + __copy_field_to_guest(data_ent_hnd, &ent, max_message_s= ize))) ) return -EFAULT; =20 return ret;