Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp824133rdb; Fri, 23 Feb 2024 00:34:39 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVf/aFNMv+vsxLPzOEVnF3FREeZsul/kZMQeo+CBkAMfQ3Z/qNmbSn5GP2i77vGh06q8A4vLTFkimL7Py6tlgYKixvbGaXFLSpqWUidjg== X-Google-Smtp-Source: AGHT+IEYCYGcT3FSDfMOXUBt1a8pmFbNeGYJy8cbOmE+LJg7l+sXSClmSr0f6d6GnBFQTzhqrNcS X-Received: by 2002:a05:6808:10c1:b0:3c1:5482:770e with SMTP id s1-20020a05680810c100b003c15482770emr1589074ois.10.1708677279427; Fri, 23 Feb 2024 00:34:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708677279; cv=pass; d=google.com; s=arc-20160816; b=Usls89PjBkqrqjJPY3P5y53xN4phi5sChovuWXjFRGdEARGzHCr49wBNpWyfJAemCh O+Xmk4oLSmX65+9HeCsEALYXqduGwlHVj+98njExqncaz6GNPkQ7l1ozlyzv7UnGIKTY Murdm19D0GPzUgumKFcnL9okQfQHqfCWJGjjiFyEwmeAOOoA2MpXRXNRl+z4311rRLpm demnhqCm1PEmiRpYNzLFHcKB40+MkbifNJ3nwwFiSpUWLS7cty9CSC7mBeeRcZYMOFc2 I1zkMj4t02mcO9oEAcwGqaaZcFpz4zPhBXjNjuLDtWcR3vzs1SuuBWGR/mOmmqR2Xggd 4P6Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=BGcOet3ScuKg5kimztYFtWpdeXskQyF1v47k/1J0zxc=; fh=i+fRmcZm7VEId+XTbFVh3lkleeNHNO9lij90JT6Nz+c=; b=bQxfXRY6T3pmbDOv5P7ZIrHX04v3aelyTkFV9izbJp3Q+jzmlQJwcN2qFqLmiDGdlv xsaiwqdb5iZihpIaHzp4dstCf2X+QLZu91H/WpCn+yJth1svF+U3aOONaz49KznxtvC1 Qust0I2MsHAVS8S1t+vp38C+cBbG9DbH+zSMsaKxA+csvOsm8daarFSndpWZJ+1STJ63 8eb9Rt80EHg9TvRswsVzUkuRLCTulxT48BGeaxPxhgeM/CzEUMlVl4btTM27URsxO4H/ XwvB2f+L3Av93qKcEtFNQPKAfB0MoL771kXt44AT2Ta41fKMSXKs3hqQW713+GLDrSJx 8u7g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=VgbPUV1v; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-77931-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77931-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id m65-20020a632644000000b005cda184c281si11697925pgm.199.2024.02.23.00.34.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 00:34:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77931-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=VgbPUV1v; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-77931-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77931-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 1F6F4287335 for ; Fri, 23 Feb 2024 08:34:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EA8394F5F8; Fri, 23 Feb 2024 08:28:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="VgbPUV1v" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 74F7717BAC; Fri, 23 Feb 2024 08:28:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708676915; cv=none; b=NedCMmzAfbDj8Uo1S5MXot05icABGzsCfBlTg2koMsYh5pago+q1as6yS2PxZNoEet5rzFICf82X8TRp6+Hr94Pz1/nU0+clJ3Rx02bxfKA3aT3jiTbuMJ53D9TSnxTh/c3j8TTnyDL66VqYjm03HEt0u7/AzPPu0eegy5FZQEM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708676915; c=relaxed/simple; bh=cWWIxYRgoOxuJ68j1q9tZim4FqZAlZlra0e2EyXAcqQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=mboc+jDOcp2MvCYQzzUvyByRGsXvFiJ0RHxDTsespbPPrZIsJYlW/C80J0+EEK6SHCYCIAq2BnUWnlqNjY/pHa1RtuRah+5y91rqVzkqcUwCJDqp0FzchuMmmK9j9hAiwGsRKQET1dl8Tluv6DyZJUPNEKIoT/vasq+AjWujXa8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=VgbPUV1v; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1708676911; bh=cWWIxYRgoOxuJ68j1q9tZim4FqZAlZlra0e2EyXAcqQ=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=VgbPUV1vaOZ1+Qy2HpOhr+qA2MyPZzmIs2aDRGaC6TtZeyXnn8i6yskawRRSDVrIr B7vzNaGsr5cDdjRyl/AVD5xnzSCyfnsxkYTjU2fhroXaPw6CJyPpPLY2K/AWhEjsOi imunYIf5BH1qCEiANnOjuadrvXGj9oeS+UHsE5f1WeKi+zwuFOvzVQZnzwoQDTktla eXsGErXMmAoCKIFh4b/kWkmLJM8UpfW+RdLSTbi4DUXw9cqdlkGPAhOp+DWxHfkSqF Ku9H6p347w1ZUsibw5cvdWulxsKjJzRM6h/UPryhiwhKm16Axs4TBhuMg5v4AuE0Qa YhdbTBqgKGo+w== Received: from [100.113.186.2] (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madrid.collaboradmins.com (Postfix) with ESMTPSA id 30BC437813DF; Fri, 23 Feb 2024 08:28:30 +0000 (UTC) Message-ID: <298d953d-6320-4dda-b31e-c9503dc91cdb@collabora.com> Date: Fri, 23 Feb 2024 09:28:29 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3,2/2] media: mediatek: vcodec: adding lock to protect encoder context list Content-Language: en-US To: Yunfei Dong , =?UTF-8?Q?N=C3=ADcolas_F_=2E_R_=2E_A_=2E_Prado?= , Nicolas Dufresne , Hans Verkuil , Benjamin Gaignard , Nathan Hebert , Irui Wang Cc: Hsin-Yi Wang , Fritz Koenig , Daniel Vetter , Steve Cho , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Project_Global_Chrome_Upstream_Group@mediatek.com References: <20240222092609.31382-1-yunfei.dong@mediatek.com> <20240222092609.31382-3-yunfei.dong@mediatek.com> From: AngeloGioacchino Del Regno In-Reply-To: <20240222092609.31382-3-yunfei.dong@mediatek.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Il 22/02/24 10:26, Yunfei Dong ha scritto: > The ctx_list will be deleted when scp getting unexpected behavior, then the > ctx_list->next will be NULL, the kernel driver maybe access NULL pointer in > function vpu_enc_ipi_handler when going through each context, then reboot. > > Need to add lock to protect the ctx_list to make sure the ctx_list->next isn't > NULL pointer. > > Fixes: 1972e32431ed ("media: mediatek: vcodec: Fix possible invalid memory access for encoder") > Signed-off-by: Yunfei Dong Reviewed-by: AngeloGioacchino Del Regno