Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp5451548imm; Tue, 16 Oct 2018 10:25:11 -0700 (PDT) X-Google-Smtp-Source: ACcGV62yItu2kcd05bBCEU6bhUizTW8OrEYCcxTfnaWZ8JZd7F+OqMCcxg7iWeGVoXg+R+LV08PG X-Received: by 2002:a17:902:b611:: with SMTP id b17-v6mr22382330pls.217.1539710711368; Tue, 16 Oct 2018 10:25:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539710711; cv=none; d=google.com; s=arc-20160816; b=VlozNtM2OySJ1JisNhd5+sYnfR3jeprOfZEHL5lhxm3EiS5++WzRn3KIbKr6BPoVEI q2HsvC+n/TwG4+Gm9rgvU2Qm5WvGEIDG/jWp8kEueBq6vxuyKMFjyk/fgtTjy0oB0rw3 pBSTWCWodMYYu/yGGiJFM6SFlGBOEgQVEDm7Qpvyl7uvp/ObhSG5N0fUMtIk+tchSP/q iZ6Pw/qfouhh1pylSx/nT9mVAPMqFu10qFgzBoyBo4qnbvRdnw4P7NtBz07auJAD7fh4 POS+7iGQnr8lCtwRPyIdyejKrVkSU4sx61xuPq8MQV2rd0ICHoSbMOuNzbiJ1HGRiMcY 4dSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=PWk0eDye31CztORRodVPzyaantrrXAS3CFWhGGgH3Bg=; b=btUOe/DX5kPiK/A8s54Fnlh0c277mfUrnMI1j9W8UwiSOrERNRYFu9g+CKflZZl+7W 4KanplacEPjVZkYPKsoVxF/kgXeMN9IZ0a8Jd57ULw0JDSPWQEs2iBzw7zYh2lIYjrii Jy1PzfAyWcTc68QsmVGeuQUS79XePSd81+VQ6WWRdmsM7TUImZ0FDFkyfefhJlppOnhv Te92oUJsSDSXmTTYSi8Gd1bc9AE+yfYbBJUUKeod9R7rZXUcA10ujRhCusNmzDqzLlwS r6MQnhPSgvjqo9q+US8/3SMU11OnasBpkEKw+DAA3XqCY/383i3sONYWfAWCYCU8Yc4n yCRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=olDahVgK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u1-v6si14752441pgq.1.2018.10.16.10.24.55; Tue, 16 Oct 2018 10:25:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=olDahVgK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731326AbeJQBOi (ORCPT + 99 others); Tue, 16 Oct 2018 21:14:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:33050 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730397AbeJQBOh (ORCPT ); Tue, 16 Oct 2018 21:14:37 -0400 Received: from localhost (ip-213-127-77-176.ip.prioritytelecom.net [213.127.77.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 667B420866; Tue, 16 Oct 2018 17:23:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539710591; bh=TveAc/FQmCnPxnbfVPxAc6xnACe3zB7WWXzsmPTsklA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=olDahVgK5fuFMXUz0ne7fyYpOchHqefOG0Jy7Pe6xC1ivbPI9FyE6M3fylb03jk65 oq5n+iU1zU4DCAerVBNpZn6R0yTcDr2T8rNqO3j7uWCmrJLi/EWxAglCdOnTjCiQ7q t9eo/Jf0Z7fPFE4IpNsRD8YXVWVLubH6iQBIi86s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Edgar Cherkasov , Viktor Krasnov , Michael Brunner , Wolfram Sang Subject: [PATCH 4.9 20/71] i2c: i2c-scmi: fix for i2c_smbus_write_block_data Date: Tue, 16 Oct 2018 19:09:17 +0200 Message-Id: <20181016170540.399994057@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181016170539.315587743@linuxfoundation.org> References: <20181016170539.315587743@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Edgar Cherkasov commit 08d9db00fe0e300d6df976e6c294f974988226dd upstream. The i2c-scmi driver crashes when the SMBus Write Block transaction is executed: WARNING: CPU: 9 PID: 2194 at mm/page_alloc.c:3931 __alloc_pages_slowpath+0x9db/0xec0 Call Trace: ? get_page_from_freelist+0x49d/0x11f0 ? alloc_pages_current+0x6a/0xe0 ? new_slab+0x499/0x690 __alloc_pages_nodemask+0x265/0x280 alloc_pages_current+0x6a/0xe0 kmalloc_order+0x18/0x40 kmalloc_order_trace+0x24/0xb0 ? acpi_ut_allocate_object_desc_dbg+0x62/0x10c __kmalloc+0x203/0x220 acpi_os_allocate_zeroed+0x34/0x36 acpi_ut_copy_eobject_to_iobject+0x266/0x31e acpi_evaluate_object+0x166/0x3b2 acpi_smbus_cmi_access+0x144/0x530 [i2c_scmi] i2c_smbus_xfer+0xda/0x370 i2cdev_ioctl_smbus+0x1bd/0x270 i2cdev_ioctl+0xaa/0x250 do_vfs_ioctl+0xa4/0x600 SyS_ioctl+0x79/0x90 do_syscall_64+0x73/0x130 entry_SYSCALL_64_after_hwframe+0x3d/0xa2 ACPI Error: Evaluating _SBW: 4 (20170831/smbus_cmi-185) This problem occurs because the length of ACPI Buffer object is not defined/initialized in the code before a corresponding ACPI method is called. The obvious patch below fixes this issue. Signed-off-by: Edgar Cherkasov Acked-by: Viktor Krasnov Acked-by: Michael Brunner Signed-off-by: Wolfram Sang Signed-off-by: Greg Kroah-Hartman --- drivers/i2c/busses/i2c-scmi.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/i2c/busses/i2c-scmi.c +++ b/drivers/i2c/busses/i2c-scmi.c @@ -152,6 +152,7 @@ acpi_smbus_cmi_access(struct i2c_adapter mt_params[3].type = ACPI_TYPE_INTEGER; mt_params[3].integer.value = len; mt_params[4].type = ACPI_TYPE_BUFFER; + mt_params[4].buffer.length = len; mt_params[4].buffer.pointer = data->block + 1; } break;