[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMRc=MfhMZPfCRGBwsWQFxvyWtL5mE9A21vNGSKhM-Kc2h5xrA@mail.gmail.com>
Date: Tue, 23 Apr 2024 10:13:54 +0200
From: Bartosz Golaszewski <brgl@...ev.pl>
To: Daniel Okazaki <dtokazaki@...gle.com>
Cc: Arnd Bergmann <arnd@...db.de>, Greg Kroah-Hartman <gregkh@...uxfoundation.org>, kernel-team@...roid.com,
linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] eeprom: at24: fix memory corruption race condition
On Mon, Apr 22, 2024 at 7:43 PM Daniel Okazaki <dtokazaki@...gle.com> wrote:
>
> If the eeprom is not accessible, an nvmem device will be registered, the
> read will fail, and the device will be torn down. If another driver
> accesses the nvmem device after the teardown, it will reference
> invalid memory.
>
> Move the failure point before registering the nvmem device.
>
> Signed-off-by: Daniel Okazaki <dtokazaki@...gle.com>
> Fixes: b20eb4c1f026 ("eeprom: at24: drop unnecessary label")
> ---
I will take this patch because it does make sense but for the record:
this doesn't fully fix the issue with the nvmem race when tearing down
the device.
Bart
Powered by blists - more mailing lists