FAILED: patch "[PATCH] eeprom: at24: check at24_read/write arguments" failed to apply to 4.14-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
Quoted 1 line
From
d9bcd462daf34aebb8de9ad7f76de0198bb5a0f0Mon Sep 17 00:00:00 2001
From: Heiner Kallweit <[email protected]>
Date: Fri, 24 Nov 2017 07:47:50 +0100
Subject: [PATCH] eeprom: at24: check at24_read/write arguments
So far we completely rely on the caller to provide valid arguments. To be on the safe side perform an own sanity check.
drivers/misc/eeprom/at24.c +6 -0
@@ -569,6 +569,9 @@ static int at24_read(void *priv, unsigned int off, void *val, size_t count)if (unlikely (!count))return count; +if (off + count > at24->chip.byte_len) +return -EINVAL ; + client =at24_translate_offset (at24, &off); ret =pm_runtime_get_sync (&client->dev);
@@ -614,6 +617,9 @@ static int at24_write(void *priv, unsigned int off, void *val, size_t count)if (unlikely (!count))return -EINVAL ; +if (off + count > at24->chip.byte_len) +return -EINVAL ; + client =at24_translate_offset (at24, &off); ret =pm_runtime_get_sync (&client->dev);
Greg KH
maintainerQuoted 5 lines · On Mon, Dec 04, 2017 at 11:02:48AM +0100, [email protected] wrote:
The patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
Nevermind, I fixed this up by hand...
greg k-h