Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3063218ybc; Thu, 14 Nov 2019 03:27:03 -0800 (PST) X-Google-Smtp-Source: APXvYqwqEbX7cPcE0RKHSI2n22VI7F9Uppwt1QY8f6SaLn+zy0J3DncxPnshxoUm0sYImN/sT/Yt X-Received: by 2002:a50:fc02:: with SMTP id i2mr620095edr.284.1573730823244; Thu, 14 Nov 2019 03:27:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573730823; cv=none; d=google.com; s=arc-20160816; b=Te1ICYaSjHGHd/rl1hASdD9hVhFnfeFXlV1mXKRlgFuy4ibeV1x+KpGP4NijNRLteT wEbUWi2PVJCxnL1pRirUO+DLpxGIsr6Bf+4KWUUCu8VHFDefSIHoAl6rTrfeAtJmYQXf +ZwGgZhVGAyQnvSS+iMw+hyL0G/IuWYQ6ZXSNJWiT6ZSwBJC7eCQPy2GEb+Q0tndhSIc kHzu0xPAPjjcJKc0CD+e5reWUmz3I2KVhU+r2t2VD83nhY+THiG9tO81Wq37zsHcbBdA ci3/sSJoRDBeerp0ijXfdmelEH9lhlORf8OEhZ7rxfYzMitEjQnC3VEYxZOQiOh0+MZU vIoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=pN07Ean0v+JVRaKXRozV3tnTBP+F1Uj6qIjvu29EhGE=; b=MI/t4lM9/pbrslEFwzuea7ENKQPUzqlT5Z989I6Idms89IYlz2u+TJdxx0NgTMPWCB sclELAq24LnAoR/HkOLN282raUvN0cP00btmpCiO4hdVnzRyvHgmK0PBha7xqbPxeKTt 5flGTbh6dY8mac/R+xKUe3e2vTp4oC0P4Gs1tED41kr8muxur65XKrq16XaoPZ7NSNyH ON4NEudwWf1jpOdh47lhuVSJLXnWAYreS8VP6iZyh47jwCxRx47ulXa55ggLRoHNtG5o bEt9Sq65Q64y4XXvrPXDscX5rZ2uVk6o5s6XI2wydMMu11zVEzqMHnRzSRjmoljx/zOB kogw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f13si3809260eda.288.2019.11.14.03.26.38; Thu, 14 Nov 2019 03:27:03 -0800 (PST) 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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726251AbfKNLXl (ORCPT + 99 others); Thu, 14 Nov 2019 06:23:41 -0500 Received: from inva021.nxp.com ([92.121.34.21]:40882 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725977AbfKNLXk (ORCPT ); Thu, 14 Nov 2019 06:23:40 -0500 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id DE89D20001C; Thu, 14 Nov 2019 12:23:34 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 6079D200428; Thu, 14 Nov 2019 12:23:30 +0100 (CET) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 73723402DE; Thu, 14 Nov 2019 19:23:24 +0800 (SGT) From: Anson Huang To: dmitry.torokhov@gmail.com, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, robh@kernel.org, linux-input@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Linux-imx@nxp.com Subject: [PATCH] Input: keyboard - imx_sc: Correct SCU message structure to avoid stack corruption Date: Thu, 14 Nov 2019 19:21:39 +0800 Message-Id: <1573730499-2224-1-git-send-email-Anson.Huang@nxp.com> X-Mailer: git-send-email 2.7.4 X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The SCU message's data field used for receiving response data from SCU should be 32-bit width, as SCU will send back 32-bit width data, correct it to avoid kernel panic of stack protection when CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG is enabled. [ 1.950768] Kernel panic - not syncing: stack-protector: Kernel stack is corrupted [ 1.980607] Workqueue: events imx_sc_check_for_events [ 1.985657] Call trace: [ 1.988104] dump_backtrace+0x0/0x140 [ 1.991768] show_stack+0x14/0x20 [ 1.995090] dump_stack+0xb4/0xf8 [ 1.998407] panic+0x158/0x324 [ 2.001463] print_tainted+0x0/0xa8 [ 2.004950] imx_sc_check_for_events+0x18c/0x190 [ 2.009569] process_one_work+0x198/0x320 [ 2.013579] worker_thread+0x48/0x420 [ 2.017252] kthread+0xf0/0x120 [ 2.020394] ret_from_fork+0x10/0x18 [ 2.023977] SMP: stopping secondary CPUs [ 2.027901] Kernel Offset: disabled [ 2.031391] CPU features: 0x0002,2100600c [ 2.035401] Memory Limit: none Signed-off-by: Anson Huang --- drivers/input/keyboard/imx_sc_key.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/keyboard/imx_sc_key.c b/drivers/input/keyboard/imx_sc_key.c index dd57daa..5379952 100644 --- a/drivers/input/keyboard/imx_sc_key.c +++ b/drivers/input/keyboard/imx_sc_key.c @@ -35,7 +35,7 @@ struct imx_key_drv_data { struct imx_sc_msg_key { struct imx_sc_rpc_msg hdr; - u8 state; + u32 state; }; static int imx_sc_key_notify(struct notifier_block *nb, -- 2.7.4