From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 201B8C10F00 for ; Thu, 28 Feb 2019 15:17:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DB76520C01 for ; Thu, 28 Feb 2019 15:17:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1551367022; bh=I6agssSsUMVZCfUACz/vmywZOF8SnDeRG8l2aCSg4Lc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=wlbJtTlIA1UOhbqu/ehmZa7NlE1SClvevrxwA9lO2qjB7rOo+Wc1It0jFQG3TK40F l+8uno15C9uAtQwIuU9Xz02iCIhaECjNLcijPTo+9JfOaBuG89tFzn38ofWlTBq9Hs gZpv4An9XOnvfloIJ0vmGfzpwIlsOJenDsrMAVTQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387736AbfB1PRA (ORCPT ); Thu, 28 Feb 2019 10:17:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:53636 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733252AbfB1PRA (ORCPT ); Thu, 28 Feb 2019 10:17:00 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (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 90F2820C01; Thu, 28 Feb 2019 15:16:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1551367020; bh=I6agssSsUMVZCfUACz/vmywZOF8SnDeRG8l2aCSg4Lc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=y11qKqzxrBJIZ/EeLq36msZF8wxodcxKjsMHN/ov12dccHAog7hOxWu8x6PmCDo9E h9yFPOHaJm6bzc0Jb0rWaF9vXumqiTFWTSTagtbYzyCoAFykCo9KlzK7I9mbU/Rj1x eLMNwOZRPVtrcouKQynba22Pd83q6/ebbMNN1OG0= Date: Thu, 28 Feb 2019 16:15:43 +0100 From: Greg KH To: Mark Walton Cc: Linus Walleij , Bartosz Golaszewski , Marek Vasut , "linux-gpio@vger.kernel.org" , "stable@vger.kernel.org" Subject: Re: [PATCH v2] gpio: pca953x: Fix dereference of irq data in shutdown Message-ID: <20190228151543.GC1360@kroah.com> References: <20190228142539.GA7744@mark-devvm> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190228142539.GA7744@mark-devvm> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Thu, Feb 28, 2019 at 02:27:33PM +0000, Mark Walton wrote: > If a PCA953x gpio was used as an interrupt and then released, > the shutdown function was trying to extract the pca953x_chip > pointer directly from the irq_data, but in reality was getting > the gpio_chip structure. > > The net effect was that the subsequent writes to the data > structure corrupted data in the gpio_chip structure, which wasn't > immediately obvious until attempting to use the GPIO again in the > future, at which point the kernel panics. > > This fix correctly extracts the pca953x_chip structure via the > gpio_chip structure, as is correctly done in the other irq > functions. > > Fixes: 0a70fe00efea ("gpio: pca953x: Clear irq trigger type on irq shutdown") > Signed-off-by: Mark Walton > --- > drivers/gpio/gpio-pca953x.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read: https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html for how to do this properly.