From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 637E01F9ECB for ; Fri, 6 Feb 2026 13:39:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770385197; cv=none; b=qaOgAcIkedcHf8NF0SJZq5Na9jLIYbNQiCKrmzusY9sGMrrsdTgdIdDxvzdkdGfAxbBtCdpxNDbDHqb3EovNU7jSpJcpyaz1K9I2vUzkJp1GNIPzHKwK/EPS7SoYDYseY2ONlh3iy9cdjTlBbal0JVL98B0Cx6kSuBy2lQiiFgc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770385197; c=relaxed/simple; bh=ui9sKOmtWTpThirBsaM2PaQ100m/96b72nH4caIV4lE=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=cnIFpD2kMcQdmebfXjj3TFX6oW9U247PVyKzs1H4RxVr+1mY2DpxyGj3Tgqo3IFbpEh10QrX698xwvhzvCcHa3nEkOQGIeoxk6aZCAkGOfT+WVbOytbM5N0Mop1X0t7m46FEKPe6TeY4yJ6sh3d3OBHa2B2gKBlVABjXn15KWXA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=ck16nTLI; arc=none smtp.client-ip=209.85.128.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ck16nTLI" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-482f454be5bso26157105e9.0 for ; Fri, 06 Feb 2026 05:39:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1770385196; x=1770989996; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:message-id:subject:cc :to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=+DpawWM0L1bjHsi3UTj4Y3hlyX0qOr0v1C1K5DEznKQ=; b=ck16nTLIhwLgb1TejJUNXo2fCxd04cwkDU8JARz6rpTeJKRj5JqpedGki2Oty3Yd19 69y/8WNn2kx2tONjqWCiPrhUitUsnklpUnnDd5lkF5uTYkT6pIBaqVCbDRubQVh4/hrd BoMU00I6DrRyTvjE7q8E5MSLUtInrRxXcsu00IPMbPayvjhSmMFFWvPTsktTEvC1yN9P hYF4nJWBmRnUwUK9w8KT8HodbL3RVmUEgtMpJDF1gKGvv1M5XehsgwMj5Hgy1L666tFV CP2YJ3rjMRNfH/nyPvr6AT+sgDiV+s5LkOEz9F7tJ2l4s76dfMyK7l+dc9JTnQPZUKBP B5Lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770385196; x=1770989996; h=in-reply-to:content-disposition:mime-version:message-id:subject:cc :to:from:date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=+DpawWM0L1bjHsi3UTj4Y3hlyX0qOr0v1C1K5DEznKQ=; b=XhKfp99GwrH8VulzvbERkXXdTi3Shx5tV2vgCrjbDAXruWMz4Ay7+kJKVg15mubvp0 wZgZgkFXeZuOhfu8CSoIn04sEZgy3c5lQC51wqIvaADbheLs7/5IdTz03gvSVj2qq3xg 5tw0ld4tRBg9BelS+sE9zedsNmdBrZ8+2kvVlwxSElOJSOa+ElYj4wDozZegQ5qiGEp1 CL/fRTt2Th4ruEGSuDjzh8wKXGJtb8TgLQ0cXw0vH1nHYREK3U5UeICls3gvl9FQyHDF grBC7jLmyqqeK3kzay2cCQ21rziDmmkIpGHW+lKanWSzVs5rFJh7BU7AscWtd8E/1gRB POqQ== X-Forwarded-Encrypted: i=1; AJvYcCXw40qS5ttROTgXcyDQYgrBPV5sr+2NwJ6k0p0YZVN27YiU/tYx5gZuyp4IWTgkF1lRh6Er2s7b0TVn2Kg=@vger.kernel.org X-Gm-Message-State: AOJu0YwEIoFRBZmQcwYeh1vld803KE0DI3m21tnYoTYvJP9IPx82myjc ZEQXO0ykpKWcKhXghqEAoORSsePBbQUJJ7Ix7yALgBeO89eGYYwbA5a6C5yhJIsruNM= X-Gm-Gg: AZuq6aL5KKzCXjwKGUFUVpks3T8lI9EYAMaLCgTgOaSxNAA6VEEqGRSnEIIwcUiNB2w jcXzayU1BQUk6jvNYxV5ghj9wmNDDGl6d0DHPyxhot/CLoMlpN3BrEHqdx2iV9GT85jdd83mqk7 MXDvPBHnqaXKR6omFo896FqKC7kLf+DafuvPuxXIp6cbrI6+8Y/nohmnrfNw0wMbPEpKmjU1Xf4 PrQFcYwMVbP6uEaGbaLqEi4TA/tg6DV2HmDMlPBHluVEbnUyJoEeUQszi+aOBvD3vD00xNcky4k eNuFQBhvXmQa6BiuSsMuUrh6IHg9TN1Mg92PXypx+rOuYfZ2qhmcRleKSzvNyyA5LlwKfxqtHGb AdrKdYi2GTTb4sxSaq92qzcypICdD44nwe60KnDO6XOtDNEfPM12RbgvKS0H3hEZ3KS6p/VAa47 t/+r3eTe+Tm1f1VRDvicMsDxhnrmk= X-Received: by 2002:a05:600c:5619:b0:477:a71c:d200 with SMTP id 5b1f17b1804b1-4831791784bmr62231045e9.11.1770385195657; Fri, 06 Feb 2026 05:39:55 -0800 (PST) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48317d33f5fsm133089325e9.5.2026.02.06.05.39.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Feb 2026 05:39:55 -0800 (PST) Date: Fri, 6 Feb 2026 16:39:52 +0300 From: Dan Carpenter To: Dikshita Agarwal Cc: Abhinav Kumar , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel Subject: [bug report] media: iris: gen1: Destroy internal buffers after FW releases Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: [ Smatch checking is paused while we raise funding. #SadFace https://lore.kernel.org/all/aTaiGSbWZ9DJaGo7@stanley.mountain/ -dan ] Hello Dikshita Agarwal, Commit 1dabf00ee206 ("media: iris: gen1: Destroy internal buffers after FW releases") from Dec 29, 2025 (linux-next), leads to the following Smatch static checker warning: drivers/media/platform/qcom/iris/iris_buffer.c:588 iris_release_internal_buffers() error: dereferencing freed memory 'buffer' (line 585) drivers/media/platform/qcom/iris/iris_buffer.c 572 static int iris_release_internal_buffers(struct iris_inst *inst, 573 enum iris_buffer_type buffer_type) 574 { 575 const struct iris_hfi_command_ops *hfi_ops = inst->core->hfi_ops; 576 struct iris_buffers *buffers = &inst->buffers[buffer_type]; 577 struct iris_buffer *buffer, *next; 578 int ret; 579 580 list_for_each_entry_safe(buffer, next, &buffers->list, list) { 581 if (buffer->attr & BUF_ATTR_PENDING_RELEASE) 582 continue; 583 if (!(buffer->attr & BUF_ATTR_QUEUED)) 584 continue; 585 ret = hfi_ops->session_release_buf(inst, buffer); The commit adds a free of buffer to ->session_release_buf(). 586 if (ret) 587 return ret; --> 588 buffer->attr |= BUF_ATTR_PENDING_RELEASE; ^^^^^^^^^^^^ Use after free. 589 } 590 591 return 0; 592 } regards, dan carpenter