Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp647129pxb; Wed, 3 Mar 2021 11:39:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJzW4i2gua4f3OE773SoU7/kO0LBwMIkUNBJclzjrB3kCcqpbNVDeAbjLwm++QmvOqGhMN0G X-Received: by 2002:a17:906:4d44:: with SMTP id b4mr428879ejv.338.1614800376249; Wed, 03 Mar 2021 11:39:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614800376; cv=none; d=google.com; s=arc-20160816; b=eR+2n1W738aEDXd8ptj2Nm1WV68THrpuktMHO5rTGRtlGmiKM9CLtmWTcbDq37Eurm CiDVbXVO/f5EVcdBX/WQSk/lnG+nuCJo0prCNgaZTF5iBmO1b33m0mPHt4zOzW7z4b69 oPAYrPsZiQD0Vfu90E7gnsoOVlQz2BL5GUT3MdEmaStP4ZDF/YUrmOg+YsicijyAHI+j kWSlRx9DjXW6KDbzCfBZYrBsu7XnahmQOPqoDeOPOxnTAt/I45E9D+7VMXO8Sd4sXvjT NbpyLAseb6nd4nPjM+0Nj/53Q1qZvr8w80+mzeWcayseiLk6nQ4TI3XDYRj8HX1owKpT 74Ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=4U8DkMMBW8HrCdUe7T/4eGfziBZUY0x4McjkXn/Nx3Q=; b=eUE0GCW4WbGYoR2p6JlTyh6nzqpdQGg7QgIAe3/qRlB4BsNIolrHs+gzjgwbp1n4j2 CDcZTtcZ9BctsE6hb/xzFFe4iMPfhQvxdlQiluFLrgnmcekwFty4vb8uw748zI7U4idQ u4+PpOio0Dr1DEPClniQ1R3qLq+lWURnz9G3YT5gkF0Jlhfpi2Cb3sKmDrXYECATVhFm aTfE0QFsqbdmuI3cV8EQbLWth6qPWjO2bQRNaNgH5ASDkpsV9BkIAW7BvkJvvaqrrVzP g+Th54+bwAjNZfkPaHQVPsirZYjXkoS5adpV1OQKeXZYXWj/IGhBCiv8CAAc9uPlLa1L vSaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MDdJ5UTB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z23si17610533edm.39.2021.03.03.11.38.05; Wed, 03 Mar 2021 11:39:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MDdJ5UTB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348917AbhCBB0a (ORCPT + 99 others); Mon, 1 Mar 2021 20:26:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:38012 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239556AbhCATKS (ORCPT ); Mon, 1 Mar 2021 14:10:18 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id D87F365198; Mon, 1 Mar 2021 17:11:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614618680; bh=Xdp7RkbAmR5eSRDTFJg/JPFqPfFBtL/+DLixpAY9Mpg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MDdJ5UTBm/BSzpuZv7CTPI6acKvr5D7erU2v+8viXa5noKMSZNiYEAwxl5sfLHFNJ qCa5lAPGbFbnFOVZW0MVTmRBh8SeT8xPw0Xa7HbnrZa14JG3CbYKlrItPv8iAwegZc 9sFz7QSqpjYiL7ywyI0mBa0+V/e/P3UuqGVnByJo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tomi Valkeinen , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.10 178/663] media: ti-vpe: cal: fix write to unallocated memory Date: Mon, 1 Mar 2021 17:07:06 +0100 Message-Id: <20210301161150.593841931@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161141.760350206@linuxfoundation.org> References: <20210301161141.760350206@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tomi Valkeinen [ Upstream commit 5a402af5e19f215689e8bf3cc244c21d94eba3c4 ] The asd allocated with v4l2_async_notifier_add_fwnode_subdev() must be of size cal_v4l2_async_subdev, otherwise access to cal_v4l2_async_subdev->phy will go to unallocated memory. Fixes: 8fcb7576ad19 ("media: ti-vpe: cal: Allow multiple contexts per subdev notifier") Signed-off-by: Tomi Valkeinen Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/platform/ti-vpe/cal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/ti-vpe/cal.c b/drivers/media/platform/ti-vpe/cal.c index 59a0266b1f399..2eef245c31a17 100644 --- a/drivers/media/platform/ti-vpe/cal.c +++ b/drivers/media/platform/ti-vpe/cal.c @@ -406,7 +406,7 @@ static irqreturn_t cal_irq(int irq_cal, void *data) */ struct cal_v4l2_async_subdev { - struct v4l2_async_subdev asd; + struct v4l2_async_subdev asd; /* Must be first */ struct cal_camerarx *phy; }; @@ -472,7 +472,7 @@ static int cal_async_notifier_register(struct cal_dev *cal) fwnode = of_fwnode_handle(phy->sensor_node); asd = v4l2_async_notifier_add_fwnode_subdev(&cal->notifier, fwnode, - sizeof(*asd)); + sizeof(*casd)); if (IS_ERR(asd)) { phy_err(phy, "Failed to add subdev to notifier\n"); ret = PTR_ERR(asd); -- 2.27.0