All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: wfx: fix potential vulnerability to spectre
@ 2019-10-11 10:15 ` Jerome Pouiller
  0 siblings, 0 replies; 10+ messages in thread
From: Jerome Pouiller @ 2019-10-11 10:15 UTC (permalink / raw)
  To: devel
  Cc: linux-kernel, Greg Kroah-Hartman, Jerome Pouiller,
	kbuild test robot, Dan Carpenter

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

array_index_nospec() should be applied after a bound check.

Fixes: 9bca45f3d6924f19f29c0d019e961af3f41bdc9e ("staging: wfx: allow to send 802.11 frames")
Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/wfx.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h
index 489836837b0a..4c0f2836015c 100644
--- a/drivers/staging/wfx/wfx.h
+++ b/drivers/staging/wfx/wfx.h
@@ -138,6 +138,7 @@ static inline struct wfx_vif *wdev_to_wvif(struct wfx_dev *wdev, int vif_id)
 		dev_dbg(wdev->dev, "requesting non-existent vif: %d\n", vif_id);
 		return NULL;
 	}
+	vif_id = array_index_nospec(vif_id, ARRAY_SIZE(wdev->vif));
 	if (!wdev->vif[vif_id]) {
 		dev_dbg(wdev->dev, "requesting non-allocated vif: %d\n", vif_id);
 		return NULL;
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH] staging: wfx: fix potential vulnerability to spectre
@ 2019-10-11 10:15 ` Jerome Pouiller
  0 siblings, 0 replies; 10+ messages in thread
From: Jerome Pouiller @ 2019-10-11 10:15 UTC (permalink / raw)
  To: devel; +Cc: Greg Kroah-Hartman, linux-kernel, Dan Carpenter

From: Jérôme Pouiller <jerome.pouiller@silabs.com>

array_index_nospec() should be applied after a bound check.

Fixes: 9bca45f3d6924f19f29c0d019e961af3f41bdc9e ("staging: wfx: allow to send 802.11 frames")
Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
---
 drivers/staging/wfx/wfx.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h
index 489836837b0a..4c0f2836015c 100644
--- a/drivers/staging/wfx/wfx.h
+++ b/drivers/staging/wfx/wfx.h
@@ -138,6 +138,7 @@ static inline struct wfx_vif *wdev_to_wvif(struct wfx_dev *wdev, int vif_id)
 		dev_dbg(wdev->dev, "requesting non-existent vif: %d\n", vif_id);
 		return NULL;
 	}
+	vif_id = array_index_nospec(vif_id, ARRAY_SIZE(wdev->vif));
 	if (!wdev->vif[vif_id]) {
 		dev_dbg(wdev->dev, "requesting non-allocated vif: %d\n", vif_id);
 		return NULL;
-- 
2.20.1
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] staging: wfx: fix potential vulnerability to spectre
  2019-10-11 10:15 ` Jerome Pouiller
@ 2019-10-11 12:10   ` Greg Kroah-Hartman
  -1 siblings, 0 replies; 10+ messages in thread
From: Greg Kroah-Hartman @ 2019-10-11 12:10 UTC (permalink / raw)
  To: Jerome Pouiller; +Cc: devel, linux-kernel, Dan Carpenter

On Fri, Oct 11, 2019 at 10:15:54AM +0000, Jerome Pouiller wrote:
> From: Jérôme Pouiller <jerome.pouiller@silabs.com>
> 
> array_index_nospec() should be applied after a bound check.
> 
> Fixes: 9bca45f3d6924f19f29c0d019e961af3f41bdc9e ("staging: wfx: allow to send 802.11 frames")

No need for the full sha1, this should be:
	Fixes: 9bca45f3d692 ("staging: wfx: allow to send 802.11 frames")

The command:
	git show -s --abbrev-commit --abbrev=12 --pretty=format:"%h (\"%s\")%n"
will provide it in the correct format.

Can you fix this up and resend?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] staging: wfx: fix potential vulnerability to spectre
@ 2019-10-11 12:10   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 10+ messages in thread
From: Greg Kroah-Hartman @ 2019-10-11 12:10 UTC (permalink / raw)
  To: Jerome Pouiller; +Cc: devel, linux-kernel, Dan Carpenter

On Fri, Oct 11, 2019 at 10:15:54AM +0000, Jerome Pouiller wrote:
> From: Jérôme Pouiller <jerome.pouiller@silabs.com>
> 
> array_index_nospec() should be applied after a bound check.
> 
> Fixes: 9bca45f3d6924f19f29c0d019e961af3f41bdc9e ("staging: wfx: allow to send 802.11 frames")

No need for the full sha1, this should be:
	Fixes: 9bca45f3d692 ("staging: wfx: allow to send 802.11 frames")

The command:
	git show -s --abbrev-commit --abbrev=12 --pretty=format:"%h (\"%s\")%n"
will provide it in the correct format.

Can you fix this up and resend?

thanks,

greg k-h
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] staging: wfx: fix potential vulnerability to spectre
  2019-10-11 12:10   ` Greg Kroah-Hartman
@ 2019-10-11 12:35     ` Jerome Pouiller
  -1 siblings, 0 replies; 10+ messages in thread
From: Jerome Pouiller @ 2019-10-11 12:35 UTC (permalink / raw)
  To: lkp; +Cc: Greg Kroah-Hartman, devel, linux-kernel, Dan Carpenter

On Friday 11 October 2019 14:10:35 CEST Greg Kroah-Hartman wrote:
> On Fri, Oct 11, 2019 at 10:15:54AM +0000, Jerome Pouiller wrote:
> > From: Jérôme Pouiller <jerome.pouiller@silabs.com>
> >
> > array_index_nospec() should be applied after a bound check.
> >
> > Fixes: 9bca45f3d6924f19f29c0d019e961af3f41bdc9e ("staging: wfx: allow to send 802.11 frames")
> 
> No need for the full sha1, this should be:
>         Fixes: 9bca45f3d692 ("staging: wfx: allow to send 802.11 frames")

I copy-pasted information from kbuild robot notification.

I suggest that commit-id in robot notification is also cut down to 12
characters. Or even better, to use this snippet:

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
Fixes: 9bca45f3d692 ("staging: wfx: allow to send 802.11 frames")

(I added lkp@lists.01.org in CC but, I am not sure it is the correct
ML. I am sorry if it is not the case)

-- 
Jérôme Pouiller


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] staging: wfx: fix potential vulnerability to spectre
@ 2019-10-11 12:35     ` Jerome Pouiller
  0 siblings, 0 replies; 10+ messages in thread
From: Jerome Pouiller @ 2019-10-11 12:35 UTC (permalink / raw)
  To: lkp; +Cc: devel, Greg Kroah-Hartman, linux-kernel, Dan Carpenter

On Friday 11 October 2019 14:10:35 CEST Greg Kroah-Hartman wrote:
> On Fri, Oct 11, 2019 at 10:15:54AM +0000, Jerome Pouiller wrote:
> > From: Jérôme Pouiller <jerome.pouiller@silabs.com>
> >
> > array_index_nospec() should be applied after a bound check.
> >
> > Fixes: 9bca45f3d6924f19f29c0d019e961af3f41bdc9e ("staging: wfx: allow to send 802.11 frames")
> 
> No need for the full sha1, this should be:
>         Fixes: 9bca45f3d692 ("staging: wfx: allow to send 802.11 frames")

I copy-pasted information from kbuild robot notification.

I suggest that commit-id in robot notification is also cut down to 12
characters. Or even better, to use this snippet:

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
Fixes: 9bca45f3d692 ("staging: wfx: allow to send 802.11 frames")

(I added lkp@lists.01.org in CC but, I am not sure it is the correct
ML. I am sorry if it is not the case)

-- 
Jérôme Pouiller

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] staging: wfx: fix potential vulnerability to spectre
  2019-10-11 12:35     ` Jerome Pouiller
  (?)
  (?)
@ 2019-10-11 12:54       ` Dan Carpenter
  -1 siblings, 0 replies; 10+ messages in thread
From: Dan Carpenter @ 2019-10-11 12:54 UTC (permalink / raw)
  To: Jerome Pouiller; +Cc: lkp, devel, Greg Kroah-Hartman, linux-kernel, kbuild

On Fri, Oct 11, 2019 at 12:35:36PM +0000, Jerome Pouiller wrote:
> On Friday 11 October 2019 14:10:35 CEST Greg Kroah-Hartman wrote:
> > On Fri, Oct 11, 2019 at 10:15:54AM +0000, Jerome Pouiller wrote:
> > > From: Jérôme Pouiller <jerome.pouiller@silabs.com>
> > >
> > > array_index_nospec() should be applied after a bound check.
> > >
> > > Fixes: 9bca45f3d6924f19f29c0d019e961af3f41bdc9e ("staging: wfx: allow to send 802.11 frames")
> > 
> > No need for the full sha1, this should be:
> >         Fixes: 9bca45f3d692 ("staging: wfx: allow to send 802.11 frames")
> 
> I copy-pasted information from kbuild robot notification.
> 
> I suggest that commit-id in robot notification is also cut down to 12
> characters. Or even better, to use this snippet:
> 
> If you fix the issue, kindly add following tag
> Reported-by: kbuild test robot <lkp@intel.com>
> Fixes: 9bca45f3d692 ("staging: wfx: allow to send 802.11 frames")
> 
> (I added lkp@lists.01.org in CC but, I am not sure it is the correct
> ML. I am sorry if it is not the case)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git staging-testing
head:   d49d1c76b96ebf39539e93d5ab7943a01ef70e4f
commit: 9bca45f3d6924f19f29c0d019e961af3f41bdc9e [55/111] staging: wfx: allow to send 802.11 frames

If you cut and paste then you the "[55/111] " text isn't right either.
Also kbuild works on rebase-able trees as well as non-rebase/published
trees so the hash could change as well.

I am a little bit surprised that checkpatch.pl doesn't complain about
this, though.  You could consider adding that?

regards,
dan carpenter



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] staging: wfx: fix potential vulnerability to spectre
@ 2019-10-11 12:54       ` Dan Carpenter
  0 siblings, 0 replies; 10+ messages in thread
From: Dan Carpenter @ 2019-10-11 12:54 UTC (permalink / raw)
  To: Jerome Pouiller; +Cc: devel, lkp, kbuild, linux-kernel, Greg Kroah-Hartman

On Fri, Oct 11, 2019 at 12:35:36PM +0000, Jerome Pouiller wrote:
> On Friday 11 October 2019 14:10:35 CEST Greg Kroah-Hartman wrote:
> > On Fri, Oct 11, 2019 at 10:15:54AM +0000, Jerome Pouiller wrote:
> > > From: Jérôme Pouiller <jerome.pouiller@silabs.com>
> > >
> > > array_index_nospec() should be applied after a bound check.
> > >
> > > Fixes: 9bca45f3d6924f19f29c0d019e961af3f41bdc9e ("staging: wfx: allow to send 802.11 frames")
> > 
> > No need for the full sha1, this should be:
> >         Fixes: 9bca45f3d692 ("staging: wfx: allow to send 802.11 frames")
> 
> I copy-pasted information from kbuild robot notification.
> 
> I suggest that commit-id in robot notification is also cut down to 12
> characters. Or even better, to use this snippet:
> 
> If you fix the issue, kindly add following tag
> Reported-by: kbuild test robot <lkp@intel.com>
> Fixes: 9bca45f3d692 ("staging: wfx: allow to send 802.11 frames")
> 
> (I added lkp@lists.01.org in CC but, I am not sure it is the correct
> ML. I am sorry if it is not the case)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git staging-testing
head:   d49d1c76b96ebf39539e93d5ab7943a01ef70e4f
commit: 9bca45f3d6924f19f29c0d019e961af3f41bdc9e [55/111] staging: wfx: allow to send 802.11 frames

If you cut and paste then you the "[55/111] " text isn't right either.
Also kbuild works on rebase-able trees as well as non-rebase/published
trees so the hash could change as well.

I am a little bit surprised that checkpatch.pl doesn't complain about
this, though.  You could consider adding that?

regards,
dan carpenter


_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] staging: wfx: fix potential vulnerability to spectre
@ 2019-10-11 12:54       ` Dan Carpenter
  0 siblings, 0 replies; 10+ messages in thread
From: Dan Carpenter @ 2019-10-11 12:54 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1648 bytes --]

On Fri, Oct 11, 2019 at 12:35:36PM +0000, Jerome Pouiller wrote:
> On Friday 11 October 2019 14:10:35 CEST Greg Kroah-Hartman wrote:
> > On Fri, Oct 11, 2019 at 10:15:54AM +0000, Jerome Pouiller wrote:
> > > From: Jérôme Pouiller <jerome.pouiller@silabs.com>
> > >
> > > array_index_nospec() should be applied after a bound check.
> > >
> > > Fixes: 9bca45f3d6924f19f29c0d019e961af3f41bdc9e ("staging: wfx: allow to send 802.11 frames")
> > 
> > No need for the full sha1, this should be:
> >         Fixes: 9bca45f3d692 ("staging: wfx: allow to send 802.11 frames")
> 
> I copy-pasted information from kbuild robot notification.
> 
> I suggest that commit-id in robot notification is also cut down to 12
> characters. Or even better, to use this snippet:
> 
> If you fix the issue, kindly add following tag
> Reported-by: kbuild test robot <lkp@intel.com>
> Fixes: 9bca45f3d692 ("staging: wfx: allow to send 802.11 frames")
> 
> (I added lkp(a)lists.01.org in CC but, I am not sure it is the correct
> ML. I am sorry if it is not the case)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git staging-testing
head:   d49d1c76b96ebf39539e93d5ab7943a01ef70e4f
commit: 9bca45f3d6924f19f29c0d019e961af3f41bdc9e [55/111] staging: wfx: allow to send 802.11 frames

If you cut and paste then you the "[55/111] " text isn't right either.
Also kbuild works on rebase-able trees as well as non-rebase/published
trees so the hash could change as well.

I am a little bit surprised that checkpatch.pl doesn't complain about
this, though.  You could consider adding that?

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] staging: wfx: fix potential vulnerability to spectre
@ 2019-10-11 12:54       ` Dan Carpenter
  0 siblings, 0 replies; 10+ messages in thread
From: Dan Carpenter @ 2019-10-11 12:54 UTC (permalink / raw)
  To: lkp

[-- Attachment #1: Type: text/plain, Size: 1648 bytes --]

On Fri, Oct 11, 2019 at 12:35:36PM +0000, Jerome Pouiller wrote:
> On Friday 11 October 2019 14:10:35 CEST Greg Kroah-Hartman wrote:
> > On Fri, Oct 11, 2019 at 10:15:54AM +0000, Jerome Pouiller wrote:
> > > From: Jérôme Pouiller <jerome.pouiller@silabs.com>
> > >
> > > array_index_nospec() should be applied after a bound check.
> > >
> > > Fixes: 9bca45f3d6924f19f29c0d019e961af3f41bdc9e ("staging: wfx: allow to send 802.11 frames")
> > 
> > No need for the full sha1, this should be:
> >         Fixes: 9bca45f3d692 ("staging: wfx: allow to send 802.11 frames")
> 
> I copy-pasted information from kbuild robot notification.
> 
> I suggest that commit-id in robot notification is also cut down to 12
> characters. Or even better, to use this snippet:
> 
> If you fix the issue, kindly add following tag
> Reported-by: kbuild test robot <lkp@intel.com>
> Fixes: 9bca45f3d692 ("staging: wfx: allow to send 802.11 frames")
> 
> (I added lkp(a)lists.01.org in CC but, I am not sure it is the correct
> ML. I am sorry if it is not the case)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git staging-testing
head:   d49d1c76b96ebf39539e93d5ab7943a01ef70e4f
commit: 9bca45f3d6924f19f29c0d019e961af3f41bdc9e [55/111] staging: wfx: allow to send 802.11 frames

If you cut and paste then you the "[55/111] " text isn't right either.
Also kbuild works on rebase-able trees as well as non-rebase/published
trees so the hash could change as well.

I am a little bit surprised that checkpatch.pl doesn't complain about
this, though.  You could consider adding that?

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-10-11 12:55 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-11 10:15 [PATCH] staging: wfx: fix potential vulnerability to spectre Jerome Pouiller
2019-10-11 10:15 ` Jerome Pouiller
2019-10-11 12:10 ` Greg Kroah-Hartman
2019-10-11 12:10   ` Greg Kroah-Hartman
2019-10-11 12:35   ` Jerome Pouiller
2019-10-11 12:35     ` Jerome Pouiller
2019-10-11 12:54     ` Dan Carpenter
2019-10-11 12:54       ` Dan Carpenter
2019-10-11 12:54       ` Dan Carpenter
2019-10-11 12:54       ` Dan Carpenter

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.