Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3285378imm; Sun, 29 Jul 2018 15:02:49 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdRvFvI2abDZrwELvv2StOuLgt7sMBfbF2K99mWn2Ly2tRc7zWnQcFmy1ene0yA65BcdZYu X-Received: by 2002:a62:da10:: with SMTP id c16-v6mr5201074pfh.106.1532901769678; Sun, 29 Jul 2018 15:02:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532901769; cv=none; d=google.com; s=arc-20160816; b=Meda66bSg2eom5Q4IqAHyRjuuUEnbbK3RowwN2N310Gi8+gaI0rfUlyUAOVVW2Cs3u 8/Q/l5yMbCh5pjq+N9nlsXn+oGZdTE7pSjR9/FzHCcC6VloDrbW8TJXzeM5kd2teSBK6 BHYwg6TkAGvCDzMk/5Xw1AM25qCs10U97mw/9KCc66xkjO3glOux9lxVLkfrNV/xvQzw 8RWeOS3xLd5QE/odZ7JcKoltcKVPNFrpV/o8Owribq6ttoO1dhYICY19UZtqtVR2xfUg /9h7tVClkAeMzA8uRm1wzrsPcIkPOO5Dm/BWwAdHYbaMpOzWeEKbsvagCwiGZHdv7vzU VEvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=5gNxDYP8f1bF8Bl/sa2d4WEEauYaVxCms3equItjypM=; b=ztcjwY/dzeG2BWd7SKqae4RJRshJoyjiYPaq9YTXW4j5S9WZn+Hq1L8HHBrmURQ1U2 ZM46e0TXy45gRKhOjPqOmzL+G2LooJbNX320AO3FYi5OwyUNjSaDDHQJLSWL/ps21qzz ycJ16ACBwJtnxlR1cc5IwiYk3KEqCcQmF6oSXY5u3EyhTQwZdCFkGng4uVk6Z4cZcQte 37vz9LK1KyDKN3FS5uooFxyteZFIqrMEC0XtQ92VWrHPKNvwHFtnuyeNaA3gkJBSW3k3 mR8+HRbhjwI/A1TJtidfXqP7JZpbPk52IYfkxW3tikFng/ycfZNWoDNk6LzA4n00zUh5 Sbug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=b5hSoDT9; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c32-v6si8329333plj.277.2018.07.29.15.02.35; Sun, 29 Jul 2018 15:02:49 -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=@linaro.org header.s=google header.b=b5hSoDT9; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728697AbeG2Wpq (ORCPT + 99 others); Sun, 29 Jul 2018 18:45:46 -0400 Received: from mail-it0-f67.google.com ([209.85.214.67]:53623 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726712AbeG2Wpq (ORCPT ); Sun, 29 Jul 2018 18:45:46 -0400 Received: by mail-it0-f67.google.com with SMTP id 72-v6so14624700itw.3 for ; Sun, 29 Jul 2018 14:13:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5gNxDYP8f1bF8Bl/sa2d4WEEauYaVxCms3equItjypM=; b=b5hSoDT9A6zqZfavzW/duijaMkbyQPrdrEATVRU80y7fQ/HKvItoYLY1eYeFfqe3Y1 JeR7IBTvz+4vCF3XEUJMVRf2EHFg6MmPEc1wWFxspgnxBn3ud1eSE6A58u8v1k0os1X1 +gEP69VxuQkWrIyAStaQoGvY1ranEh6b9zhnA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5gNxDYP8f1bF8Bl/sa2d4WEEauYaVxCms3equItjypM=; b=VjAFgr9Pkf8zDF8z1uGQrkDclSrpRP7C41+kBkuC08DUAfYmLf2JKXPTE+P4VF40SX gMe0cjZoNq3ml1udCoKz4m8rCyVx36Hp5EWed6InbS5JYnO38fxRA2bg2oFE10tXGHNM Aku5ZRcq5W+Ck5WWSQhr3C7gNINqiCzUqoQ8j94Ccbed7HK3ODxw2Bo005vyVEGZiu1v i8EwlKsM2sdHqIZE7owHnSEnHst6Zl/z8hcdOpDnKiVK7dys+m1xjY/5Mct+iB52UR6m kTWyTK5elHhEyC9RlKpUgmS8f2BVIE6I8vexV1kcOOXD2+st0fe7hPK24wnieqFC4YEY pdqQ== X-Gm-Message-State: AOUpUlHWFZ7p67nrW7fA4AaHyIIujZ1BQrv2YXsmja9NR8yXLIegNz9W gjWrOMUjnunDYJlCK7aGwkGpqQIxVXQQczD65pVAXOob X-Received: by 2002:a24:2c49:: with SMTP id i70-v6mr12590639iti.135.1532898834034; Sun, 29 Jul 2018 14:13:54 -0700 (PDT) MIME-Version: 1.0 References: <20180723165330.25213-1-vasilyev@ispras.ru> In-Reply-To: <20180723165330.25213-1-vasilyev@ispras.ru> From: Linus Walleij Date: Sun, 29 Jul 2018 23:13:42 +0200 Message-ID: Subject: Re: [PATCH] gpio: ml-ioh: Fix buffer underwrite on probe error path To: vasilyev@ispras.ru Cc: "open list:GPIO SUBSYSTEM" , "linux-kernel@vger.kernel.org" , ldv-project@linuxtesting.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 23, 2018 at 6:54 PM Anton Vasilyev wrote: > If ioh_gpio_probe() fails on devm_irq_alloc_descs() then chip may point > to any element of chip_save array, so reverse iteration from pointer chip > may become chip_save[-1] and gpiochip_remove() will operate with wrong > memory. > > The patch fix the error path of ioh_gpio_probe() to correctly bypass > chip_save array. > > Found by Linux Driver Verification project (linuxtesting.org). > > Signed-off-by: Anton Vasilyev Patch applied, nice work! Yours, Linus Walleij