mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: "Choi, Yuho" <yqc5929@psu.edu>
Cc: "hansg@kernel.org" <hansg@kernel.org>,
	"mchehab@kernel.org" <mchehab@kernel.org>,
	"andy@kernel.org" <andy@kernel.org>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"sakari.ailus@linux.intel.com" <sakari.ailus@linux.intel.com>,
	"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
	"linux-staging@lists.linux.dev" <linux-staging@lists.linux.dev>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] media: atomisp: fix UAF and memory leak in gc2335
Date: Fri, 20 Mar 2026 10:18:03 +0200	[thread overview]
Message-ID: <ab0Cu8NnIt-m7pQc@ashevche-desk.local> (raw)
In-Reply-To: <54321DD5-808B-441A-8F68-B812A3D72E5E@psu.edu>

On Thu, Mar 19, 2026 at 07:30:10PM +0000, Choi, Yuho wrote:
> From: Yuho Choi <yqc5929@psu.edu>
> Date: Wed, 18 Mar 2026 17:08:57 -0400
> Subject: [PATCH] media: atomisp: gc2335: fix UAF and memory leak

Make sure you understand the tools and how properly to send patches

Also note, your patch is mangled and may not be applied.

> This commit addresses two potential resource management vulnerabilities

Please, take your time to study Submitting Patches documentation,
in particular on how to use imperative mode.

> within the gc2235_probe function's error handling paths.

As below refer to the function as func():

gc2235_probe()

> 1.  UAF: If media_entity_pads_init fails, the driver
>     invokes gc2235_remove(), which frees the 'dev' object.
>     The execution flow then inadvertently fails through to
>     atomis_register_i2c_module(), dereferencing the freed 'dev' pointer.
> 2.  Memory Leak: If atomisp_register_i2c_module() fails, the function
>     returns the error code immediately without executing any teardown
>     routines. This leavs the 'dev' structure, v4l2 control handler,
>     and media entity permanently orphaned.
> 
> This fix follows a standard goto-based teadown routines to ensure all
> allocated resources are freed in reverse order.

-- 
With Best Regards,
Andy Shevchenko



       reply	other threads:[~2026-03-20  8:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <54321DD5-808B-441A-8F68-B812A3D72E5E@psu.edu>
2026-03-20  8:18 ` Andy Shevchenko [this message]
2026-03-20 14:15   ` Choi, Yuho

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ab0Cu8NnIt-m7pQc@ashevche-desk.local \
    --to=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hansg@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=mchehab@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=yqc5929@psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®