Received: by 10.223.164.202 with SMTP id h10csp1754065wrb; Wed, 8 Nov 2017 09:08:26 -0800 (PST) X-Google-Smtp-Source: ABhQp+TPMtLHPBEWdeHFhcDU7M4hEi4lnLBbnVoSXXuOePZC5H826A8GO+25scnCGleftN5v7Y2+ X-Received: by 10.98.212.91 with SMTP id u27mr1162818pfl.201.1510160906204; Wed, 08 Nov 2017 09:08:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510160906; cv=none; d=google.com; s=arc-20160816; b=uYiMScLGrhdQKsn0PKlKKGToYGPCbZgfdYmuFGzAQZIabTMuqFLQBNiJ3WMv80sb4q BoXpw55nb5106TX04oJUNX1lqVNQLwN2eLf2JXuOZPG7kLvLpi4q9SErA7p63rb1hUuH 1mIo7L7imV/fGEDylgfAfSyQIiNsrWL9JWZ2A8ZzqpQJ70boVYlhQMMnSb6WMOR4qxW/ hhAE6gEyJ9Ji6MHbAC96nSVdnCKmAEW52r3n8zTHnr/Bwt6EPvMERDHfhaQUyBIFkItA gQHwfcSpBKsr70mNfsEPqx64Ia3udA93f/RYGc+wAUCIJCmI6mINKv4nhyq8eMNnJuPF JwGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-transfer-encoding:content-language :mime-version:user-agent:date:message-id:subject:from:cc:to :arc-authentication-results; bh=6me27xmD7gt4rTiefvtfEk+G9t44of9m+Thk0Feebls=; b=b0Lh6JRGyYY2esV6wMyqlsSSgCq+dEZhbD8U4KsKEM2mmfp2lA3ikhiIB6tAeAOGFm cGr8ojo8xEScGV/DpXLAcSPPWwu5FQp8sb/QRKCGjipJCxI5c/6nvJBiGadhN22DAguH lDS+5L90+d1WmoSrY92kR6K9rAOS85+EZ6f3Mjda4mqA9hMsLqeXhrD2L8wuHHaaukVr R7CGBWvGszKJPzIxYwaNtQwyrE43Ao+4fDMOhBwiA6lmDBjjnHIhYPOzIq2J/aXCcE5S M28CtrBraOj86BqrRczN9Nnp3Eg1N4v0hV7MoNLYFNADd4vUq5vyQWePZy9UuARBC28+ XeDw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h68si3272915pgc.696.2017.11.08.09.08.14; Wed, 08 Nov 2017 09:08:26 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751886AbdKHRHL (ORCPT + 84 others); Wed, 8 Nov 2017 12:07:11 -0500 Received: from g9t1613g.houston.hpe.com ([15.241.32.99]:24140 "EHLO g9t1613g.houston.hpe.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751350AbdKHRG7 (ORCPT ); Wed, 8 Nov 2017 12:06:59 -0500 Received: from g2t2352.austin.hpe.com (g2t2352.austin.hpe.com [15.233.44.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by g9t1613g.houston.hpe.com (Postfix) with ESMTPS id 279DD60647 for ; Wed, 8 Nov 2017 17:06:59 +0000 (UTC) Received: from G4W9121.americas.hpqcorp.net (exchangepmrr1.us.hpecorp.net [16.210.21.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by g2t2352.austin.hpe.com (Postfix) with ESMTPS id 75E2ABF; Wed, 8 Nov 2017 17:06:58 +0000 (UTC) Received: from G4W9121.americas.hpqcorp.net (2002:10d2:1510::10d2:1510) by G4W9121.americas.hpqcorp.net (2002:10d2:1510::10d2:1510) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Wed, 8 Nov 2017 17:06:19 +0000 Received: from NAM03-DM3-obe.outbound.protection.outlook.com (15.241.52.13) by G4W9121.americas.hpqcorp.net (16.210.21.16) with Microsoft SMTP Server (TLS) id 15.0.1178.4 via Frontend Transport; Wed, 8 Nov 2017 17:06:18 +0000 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=abanman@hpe.com; Received: from Andrews-MacBook-Pro.local (192.48.192.5) by AT5PR8401MB0353.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:741d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.197.13; Wed, 8 Nov 2017 17:06:13 +0000 To: Corey Minyard CC: Dimitri Sivanich , "Anderson, Russ" , Mike Travis , , From: Andrew Banman Subject: [PATCH] drivers/char/ipmi_si: prevent null deref during module exit Message-ID: <988aec06-2127-3120-47a4-5d0131f59a61@hpe.com> Date: Wed, 8 Nov 2017 11:06:03 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [192.48.192.5] X-ClientProxiedBy: BN6PR10CA0037.namprd10.prod.outlook.com (2603:10b6:404:109::23) To AT5PR8401MB0353.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:741d::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1acae910-067f-46b4-6660-08d526cb04bf X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(2017052603249);SRVR:AT5PR8401MB0353; X-Microsoft-Exchange-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Vd/TyY2GIvVFkZBdfIT9v5K9HIM2OB/v0oQd52gMyq6GvmK0fFWIpcL+xirL2TK3+Bs/uL7a/APn/z8OjnT3j7pfLLnrKKxdncyhQ8CQlwn2pxy2UVeLxt1LYLycDdrkxcbYbNuW8058+1wALbaH4QEz47yP9AoglcIsmmUPw/OBFlpBZSk4sggmC5nfCGpOY2pd7bVArukkF4AulqZaoICxtRwJLATBFTZwYOC1EglUFigIo4OoX9QZKL0SFWY5v6HeE6Fw2ULjaj8BfH9+TBaC4Z405O8zfyh728yQwMcBp5+xsCsX5zFezel2RtbjUAd8L5GnCvULbYV0fgUpqfsJmvN+HF2VBA94jJNFAyS+s/keVI;4:pChCeK1uheV2Xx4G+4YQBPGtUC8LOxW5xTrcnrpbZ6xd5DUcn5+qvSZo8wVHRJqGXd4C7BhV2Av6CeZwNgPz4LpC/GzVVpNZRjawLyqZ0nbAdLLkGApW2/v4avVj5kjM3CoOXAN0ek2QIzxlo38ka4Rz+DxCo74nCUhfSIPQW/bLrReIGbZPyV4/QvHigOTocdukE07gYC2cCkVrAOfpaLz0TSsOLuVbvYDKnxZeBspRrtE9sQlOupqDxpwMdc9kZMNsq88Vk+QsX8Wk3GUpq/cA7wk/28o9fnLyxsm1zlQBFv8jNfNaA7IZnbqHjMtC X-Exchange-Antispam-Report-Test: UriScan:(227479698468861); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(93006095)(93001095)(100000703101)(100105400095)(3231021)(10201501046)(3002001)(6055026)(6041248)(20161123564025)(20161123555025)(20161123562025)(20161123560025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:AT5PR8401MB0353;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:AT5PR8401MB0353; X-Forefront-PRVS: 0485417665 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6009001)(346002)(376002)(39860400002)(199003)(189002)(67846002)(189998001)(23676003)(47776003)(478600001)(4326008)(316002)(83506002)(97736004)(36756003)(25786009)(54906003)(58126008)(6116002)(65826007)(3846002)(66066001)(65806001)(230700001)(65956001)(6512007)(6666003)(6916009)(31686004)(86362001)(31696002)(5660300001)(575784001)(8936002)(305945005)(33646002)(50466002)(106356001)(7736002)(64126003)(68736007)(105586002)(81166006)(551934003)(8676002)(16526018)(81156014)(53936002)(50986999)(2906002)(6486002)(6506006)(54356999)(101416001);DIR:OUT;SFP:1102;SCL:1;SRVR:AT5PR8401MB0353;H:Andrews-MacBook-Pro.local;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; Received-SPF: None (protection.outlook.com: hpe.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtBVDVQUjg0MDFNQjAzNTM7MjM6bm5NR0IvOWlFNXhDb1RPQnhoYUNWNXBS?= =?utf-8?B?YlJnTERRb0ZEcWluM25sWEFlcFVTcWdBQ2MxaWxRYjYydlhxalV3YkcvajRT?= =?utf-8?B?L2FhaXlOM0ZzYm5Mc2JvY0Fmb3FCUkM0eTBXU3N4YlprOFdpeUJSNkJ5Y05N?= =?utf-8?B?WGVaUVovQ2Frenp0RWRXNXpoaFVuaFBRaytxZHMydGVVM09rMnk2V3ZZM0xE?= =?utf-8?B?TGVXalFQaTZ1S0FHOVp0bmRpTGllTXhPWjNIWFlBYWVEczBKaUpOYzViSnZQ?= =?utf-8?B?TWZybzdlVXBQQWRmSlVYWFVXdnhYMmZ1bURDMHdaUktFNmc4SHgreUd1dHl1?= =?utf-8?B?NnVuelNkMjdPZnJLVEtmUVZVaUc4dU5VbDI3YmJZdFBrb3RmRXBwOFdKL0pK?= =?utf-8?B?amlKZ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:50TJLrowHUsxGaDuCNabu02vXJWdnj8vnwa7yfHFDtsWhmbQDMx63qAg08LnUoAdkzAhxUOFYigeGw0RyCTQxI/7bf1f2mRyXcCCaRbP3Ro=;7:U13PkTRBZ4z5sD6nrkA8W/7cRe3GaGsBfnoZySYJ5ocSQQVJ2tmfAB4sXu0LQBfRgstFCV/aqSao7Rl5Q8hIUDIbdZvBWHTlL1rxT1sZeDCXIfPrCwD4K2P4DrMcpqhOMV2BD3E4ox/0UE5DND5ESzp5zB47YjbULSbuk3ZlHu5JKSYINt8pOna/e5OPoEsuJpEgtSri8ZgWlXxY+Id4qsDqtMf6SWnCRlGXJCrpSAUeME0J75ruWIQxDXrcLGGH SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Nov 2017 17:06:13.7974 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1acae910-067f-46b4-6660-08d526cb04bf X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-Transport-CrossTenantHeadersStamped: AT5PR8401MB0353 X-OriginatorOrg: hpe.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If there are uninitialized SMIs in the smi_infos list, i.e. with no handlers set, then disable_si_irq() in cleanup_smi_one() will hit a null pointer dereference when the former attempts to start the check enables transaction. Thus, we panic during module exit. Avoid panicking when there are uninitialized SMIs by checking for a handler pointer before starting the check enables transaction. Signed-off-by: Andrew Banman --- drivers/char/ipmi/ipmi_si_intf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index cb5719e..6c0b1b3 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c @@ -442,7 +442,7 @@ static void start_check_enables(struct smi_info *smi_info, bool start_timer) if (start_timer) start_new_msg(smi_info, msg, 2); - else + else if (smi_info->handlers) smi_info->handlers->start_transaction(smi_info->si_sm, msg, 2); smi_info->si_state = SI_CHECKING_ENABLES; } -- 1.8.2.1 From 1583622245827870972@xxx Thu Nov 09 20:37:42 +0000 2017 X-GM-THRID: 1583622245827870972 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread