Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2256889imm; Thu, 18 Oct 2018 11:31:00 -0700 (PDT) X-Google-Smtp-Source: ACcGV600DgOVg8LMEzXLgj0vG1C+O/6aRfmSflderJN0DZ/HQWUplWBhauBavCVSqOszrQWvoWHc X-Received: by 2002:a17:902:6b46:: with SMTP id g6-v6mr30076430plt.19.1539887460659; Thu, 18 Oct 2018 11:31:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539887460; cv=none; d=google.com; s=arc-20160816; b=DEUrHYaVhje0ZGpb475lsO94AR0Y20Oz3Hza2pwz6M+B1BUu6I2gIyWbZ5+1sHBg3a HwRICEkbFDK08MrctNpcyPZsQvJwLxqVMDCXZ6/3IXlQtswG09z/ZaOhzlCxONb3Rl0z MUKgp3jdFO/FOE6Yeh8HvmV9rDN9BJBNs5BQOQxhgEmzmdl8hFZIKSiXsu5M1gj9llgt dvM1McDnHkn+4LsCN0uXGMgJ3B+VBMe9Zdnx8WFF1DwoElghDj7EVSp+BTxpMIEgF29R UnCV9Ejd98o7Qfnlbd9Gz46Xc/5jQau8tdHRAch3nE6VSK3euTHwx+ajSkdhCKYLgh35 Eawg== 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=k42VfWCgfNU97N4B8ZzAxrVJmtqIRJvZd3TUw6KdVjE=; b=HIWzUUXAA01V6keJhFIymAT/tphfwHVo6yhFf1/brWxMPq1qxRlXl/o1UK+ufKGdEx 1AADOf8bVijE6cLTZze6g2wHkUxyYSVo2m1wxqJ0MoftQ8Lc3YJSwe92qa866uwi7Q9L uD5Or4VZkHkxouXfHbk2UJCsKpLT0xuwUVuku6ff1BobI5NHnpbrfUm5BU9xJpYwsAQV GZaCzcL2jzAD10YXCL3N0EwGxMIbCKgSoNqpLVMdbB+Dp51Uc1ts9vRAWM7UNieZJz2g 1nlnYJ+UadHsWePgMer0PMCHGBGZoGEvy2LhKNNuc+R4nbaIj1eSblhXE+9NUK/vwDe/ 69Jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=RY9jV5F8; 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 i9-v6si21112608plt.111.2018.10.18.11.30.45; Thu, 18 Oct 2018 11:31:00 -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=RY9jV5F8; 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 S1730206AbeJSCHO (ORCPT + 99 others); Thu, 18 Oct 2018 22:07:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:55754 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730194AbeJSCHM (ORCPT ); Thu, 18 Oct 2018 22:07:12 -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 0E8E221486; Thu, 18 Oct 2018 18:05:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539885905; bh=TV5fzo2lta6jTgCJCIqe5e0BsMr3c2qb5qBSPzCjRPE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RY9jV5F8PrSjYS+JrD208AAQaB0bTFQkkvHmVL/piZEKZ/UcGDUV0uOaShMgCUrgY Sv3hk5omJcSsOnVlNrIM1IuNROmpHk7cSY6pmLsLYKs0queiJRvXL0OUqv7e/XPzvb rwC/rBco4iIx2BC3FPKUtF6xIQVRWGlf44/wScWI= 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.4 14/48] i2c: i2c-scmi: fix for i2c_smbus_write_block_data Date: Thu, 18 Oct 2018 19:54:49 +0200 Message-Id: <20181018175428.758923912@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181018175427.133690306@linuxfoundation.org> References: <20181018175427.133690306@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.4-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;