* [PATCH] ath9k: off by one in ath9k_hw_nvram_read_array()
@ 2017-04-06 5:12 ` Dan Carpenter
0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2017-04-06 5:12 UTC (permalink / raw)
To: QCA ath9k Development, Gabor Juhos
Cc: Kalle Valo, linux-wireless, kernel-janitors
The > should be >= or we read one space beyond the end of the array.
Fixes: ab5c4f71d8c7 ("ath9k: allow to load EEPROM content via firmware API")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/net/wireless/ath/ath9k/eeprom.c b/drivers/net/wireless/ath/ath9k/eeprom.c
index fb80ec86e53d..6ccf24814514 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom.c
@@ -112,7 +112,7 @@ void ath9k_hw_usb_gen_fill_eeprom(struct ath_hw *ah, u16 *eep_data,
static bool ath9k_hw_nvram_read_array(u16 *blob, size_t blob_size,
off_t offset, u16 *data)
{
- if (offset > blob_size)
+ if (offset >= blob_size)
return false;
*data = blob[offset];
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] ath9k: off by one in ath9k_hw_nvram_read_array()
@ 2017-04-06 5:12 ` Dan Carpenter
0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2017-04-06 5:12 UTC (permalink / raw)
To: QCA ath9k Development, Gabor Juhos
Cc: Kalle Valo, linux-wireless, kernel-janitors
The > should be >= or we read one space beyond the end of the array.
Fixes: ab5c4f71d8c7 ("ath9k: allow to load EEPROM content via firmware API")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/net/wireless/ath/ath9k/eeprom.c b/drivers/net/wireless/ath/ath9k/eeprom.c
index fb80ec86e53d..6ccf24814514 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom.c
@@ -112,7 +112,7 @@ void ath9k_hw_usb_gen_fill_eeprom(struct ath_hw *ah, u16 *eep_data,
static bool ath9k_hw_nvram_read_array(u16 *blob, size_t blob_size,
off_t offset, u16 *data)
{
- if (offset > blob_size)
+ if (offset >= blob_size)
return false;
*data = blob[offset];
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: ath9k: off by one in ath9k_hw_nvram_read_array()
2017-04-06 5:12 ` Dan Carpenter
@ 2017-04-19 13:58 ` Kalle Valo
-1 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2017-04-19 13:58 UTC (permalink / raw)
To: Dan Carpenter
Cc: QCA ath9k Development, Gabor Juhos, Kalle Valo, linux-wireless,
kernel-janitors
Dan Carpenter <dan.carpenter@oracle.com> wrote:
> The > should be >= or we read one space beyond the end of the array.
>
> Fixes: ab5c4f71d8c7 ("ath9k: allow to load EEPROM content via firmware API")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/net/wireless/ath/ath9k/eeprom.c b/drivers/net/wireless/ath/ath9k/eeprom.c
> index fb80ec86e53d..6ccf24814514 100644
> --- a/drivers/net/wireless/ath/ath9k/eeprom.c
> +++ b/drivers/net/wireless/ath/ath9k/eeprom.c
> @@ -112,7 +112,7 @@ void ath9k_hw_usb_gen_fill_eeprom(struct ath_hw *ah, u16 *eep_data,
> static bool ath9k_hw_nvram_read_array(u16 *blob, size_t blob_size,
> off_t offset, u16 *data)
> {
> - if (offset > blob_size)
> + if (offset >= blob_size)
> return false;
>
> *data = blob[offset];
Patch applied to ath-next branch of ath.git, thanks.
b7dcf68f383a ath9k: off by one in ath9k_hw_nvram_read_array()
--
https://patchwork.kernel.org/patch/9666031/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: ath9k: off by one in ath9k_hw_nvram_read_array()
@ 2017-04-19 13:58 ` Kalle Valo
0 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2017-04-19 13:58 UTC (permalink / raw)
To: Dan Carpenter
Cc: QCA ath9k Development, Gabor Juhos, Kalle Valo, linux-wireless,
kernel-janitors
Dan Carpenter <dan.carpenter@oracle.com> wrote:
> The > should be >= or we read one space beyond the end of the array.
>
> Fixes: ab5c4f71d8c7 ("ath9k: allow to load EEPROM content via firmware API")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/net/wireless/ath/ath9k/eeprom.c b/drivers/net/wireless/ath/ath9k/eeprom.c
> index fb80ec86e53d..6ccf24814514 100644
> --- a/drivers/net/wireless/ath/ath9k/eeprom.c
> +++ b/drivers/net/wireless/ath/ath9k/eeprom.c
> @@ -112,7 +112,7 @@ void ath9k_hw_usb_gen_fill_eeprom(struct ath_hw *ah, u16 *eep_data,
> static bool ath9k_hw_nvram_read_array(u16 *blob, size_t blob_size,
> off_t offset, u16 *data)
> {
> - if (offset > blob_size)
> + if (offset >= blob_size)
> return false;
>
> *data = blob[offset];
Patch applied to ath-next branch of ath.git, thanks.
b7dcf68f383a ath9k: off by one in ath9k_hw_nvram_read_array()
--
https://patchwork.kernel.org/patch/9666031/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-04-19 13:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-06 5:12 [PATCH] ath9k: off by one in ath9k_hw_nvram_read_array() Dan Carpenter
2017-04-06 5:12 ` Dan Carpenter
2017-04-19 13:58 ` Kalle Valo
2017-04-19 13:58 ` Kalle Valo
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.