From nobody Thu Apr 25 06:35:15 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1557155100; cv=none; d=zoho.com; s=zohoarc; b=UYiOe8kzhbi7jbt+bBj0//Lu++er9vZ1/A8xe3Uux3zWBVjp1euxBjuctGoInOEGwCpOtSpyQGWAk7SSv+WVlvVS2aGFz0FFvdBA1NTzZYV87gyzu4tWb+MQuWyE8BXVMXRFBCOgCFRUo7o1lP3C9etVnZP27+WL1t7wN8Uneyc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557155100; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=5LhnlLwzoK1vM3D3GalzU9pOe4+qjEKuAUar8RMvPUs=; b=bve7NJ7IwhK3mOvkcJgquwDFeaEbWU51x8VxPvearCGXeZ/INqNhDh6RyZaXt6kFDaLKK8/O4Szavar+XKTY96eViJNW8SJ42rdZmx0gcD91Jy/vMRvTWDiodvLPw42Gab7WJj36zFvTdx75tEk3rOHIW8UXG4FNI0DSnc7FW0k= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1557155100888182.11155322642946; Mon, 6 May 2019 08:05:00 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hNf9a-0004MD-Id; Mon, 06 May 2019 15:03:42 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hNf9Z-0004Lm-7r for xen-devel@lists.xenproject.org; Mon, 06 May 2019 15:03:41 +0000 Received: from new1-smtp.messagingengine.com (unknown [66.111.4.221]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 1e4c2b40-7010-11e9-8e99-d39ca5764b89; Mon, 06 May 2019 15:03:34 +0000 (UTC) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailnew.nyi.internal (Postfix) with ESMTP id CDDA4136C5; Mon, 6 May 2019 11:03:33 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Mon, 06 May 2019 11:03:33 -0400 Received: from localhost.localdomain (ip5b412221.dynamic.kabel-deutschland.de [91.65.34.33]) by mail.messagingengine.com (Postfix) with ESMTPA id BBED71037C; Mon, 6 May 2019 11:03:31 -0400 (EDT) X-Inumbo-ID: 1e4c2b40-7010-11e9-8e99-d39ca5764b89 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:in-reply-to:message-id:mime-version :references:references:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=j/pJrzCOwItYX2g5i YLCnlWTe3eZ4MWUfdEkcvCwSsY=; b=6Ery8UZmLD7b8zuTkTUYeatEQOZsiBWVq NYtuDU2FnXdZPIngs/sUvHZY0+oO4wirM3bcF8yAN7/a4yslPyqF6FhjkL4mLZN4 HVRQP8S8G4GcReLK+k+Tau7ko2vLcFVnbhgD5a0e5xwUiO6AL3B8NtvC4A2t5rMd NcrCPwtINc6PXF4BpAoCLov4Oqr2cdKsUEePzayDDa89/HdkUHqfxz5s0PHXuP7N Uf8GdHTC3rlMsamblmVwvA8naUSfI6tzLyyvj8yBa9wmGRkPaE7/ubziLmTg8IG3 H/9Nkpc8Kph989BSfB8prH40x5pe16V8edRg029Pqf93uMO6bHZdg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrjeejgdekiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenog fthfevqddqjfgurhdqufhushhpvggtthdqlhhoficuldehmdenucfjughrpefhvffufffk ofgjfhggjghftgfgsehtkeertdertdejnecuhfhrohhmpeforghrvghkucforghrtgiihi hkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvhhishhisghlvght hhhinhhgshhlrggsrdgtohhmqeenucfkphepledurdeihedrfeegrdeffeenucfrrghrrg hmpehmrghilhhfrhhomhepmhgrrhhmrghrvghksehinhhvihhsihgslhgvthhhihhnghhs lhgrsgdrtghomhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xenproject.org Date: Mon, 6 May 2019 16:50:17 +0200 Message-Id: X-Mailer: git-send-email 2.17.2 In-Reply-To: References: MIME-Version: 1.0 In-Reply-To: References: Subject: [Xen-devel] [PATCH 1/5] xen/bitmap: fix bitmap_fill with zero-sized bitmap X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Tim Deegan , Julien Grall , Jan Beulich Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" When bitmap_fill(..., 0) is called, do not try to write anything. Before this patch, it tried to write almost LONG_MAX, surely overwriting something. Signed-off-by: Marek Marczykowski-G=C3=B3recki Reviewed-by: Andrew Cooper Reviewed-by: Jan Beulich --- Found while debugging framebuffer located above 4GB. In that case 32bit variable for it overflows and framebuffer initialization zeroed unrelated memory. Specifically, it hit mbi->mods_count, so later on bitmap_fill(module_map, mbi->mods_count) in __start_xen() crashed. --- xen/include/xen/bitmap.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xen/include/xen/bitmap.h b/xen/include/xen/bitmap.h index fe3c720..0430c1c 100644 --- a/xen/include/xen/bitmap.h +++ b/xen/include/xen/bitmap.h @@ -126,6 +126,8 @@ static inline void bitmap_fill(unsigned long *dst, int = nbits) size_t nlongs =3D BITS_TO_LONGS(nbits); =20 switch (nlongs) { + case 0: + break; default: memset(dst, -1, (nlongs - 1) * sizeof(unsigned long)); /* fall through */ --=20 git-series 0.9.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel