linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fnic: fixup patch to resolve stack frame issues
@ 2021-01-27  1:21 Lee Duncan
  2021-01-27  3:17 ` Lee Duncan
  2021-01-27  7:46 ` Greg KH
  0 siblings, 2 replies; 4+ messages in thread
From: Lee Duncan @ 2021-01-27  1:21 UTC (permalink / raw)
  To: linux-scsi, linux-kernel; +Cc: Hannes Reinecke, stable, Lee Duncan

From: Hannes Reinecke <hare@suse.de>

Commit 42ec15ceaea7 fixed a gcc issue with unused variables, but
introduced errors since it allocated an array of two u64-s but
then used more than that. Set the arrays to the proper size.

Fixes: 42ec15ceaea74b5f7a621fc6686cbf69ca66c4cf
Cc: stable@vger.kernel.org
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Lee Duncan <lduncan@suse.com>
---
 drivers/scsi/fnic/vnic_dev.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/fnic/vnic_dev.c b/drivers/scsi/fnic/vnic_dev.c
index 5988c300cc82..d29999064b89 100644
--- a/drivers/scsi/fnic/vnic_dev.c
+++ b/drivers/scsi/fnic/vnic_dev.c
@@ -697,7 +697,7 @@ int vnic_dev_hang_notify(struct vnic_dev *vdev)
 
 int vnic_dev_mac_addr(struct vnic_dev *vdev, u8 *mac_addr)
 {
-	u64 a[2] = {};
+	u64 a[ETH_ALEN] = {};
 	int wait = 1000;
 	int err, i;
 
@@ -734,7 +734,7 @@ void vnic_dev_packet_filter(struct vnic_dev *vdev, int directed, int multicast,
 
 void vnic_dev_add_addr(struct vnic_dev *vdev, u8 *addr)
 {
-	u64 a[2] = {};
+	u64 a[ETH_ALEN] = {};
 	int wait = 1000;
 	int err;
 	int i;
@@ -749,7 +749,7 @@ void vnic_dev_add_addr(struct vnic_dev *vdev, u8 *addr)
 
 void vnic_dev_del_addr(struct vnic_dev *vdev, u8 *addr)
 {
-	u64 a[2] = {};
+	u64 a[ETH_ALEN] = {};
 	int wait = 1000;
 	int err;
 	int i;
-- 
2.26.2


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

* Re: [PATCH] fnic: fixup patch to resolve stack frame issues
  2021-01-27  1:21 [PATCH] fnic: fixup patch to resolve stack frame issues Lee Duncan
@ 2021-01-27  3:17 ` Lee Duncan
  2021-01-27  7:46 ` Greg KH
  1 sibling, 0 replies; 4+ messages in thread
From: Lee Duncan @ 2021-01-27  3:17 UTC (permalink / raw)
  To: Lee Duncan, linux-scsi, linux-kernel; +Cc: Hannes Reinecke, stable

On 1/26/21 5:21 PM, Lee Duncan wrote:
> From: Hannes Reinecke <hare@suse.de>
> 
> Commit 42ec15ceaea7 fixed a gcc issue with unused variables, but
> introduced errors since it allocated an array of two u64-s but
> then used more than that. Set the arrays to the proper size.
> 
> Fixes: 42ec15ceaea74b5f7a621fc6686cbf69ca66c4cf
> Cc: stable@vger.kernel.org
> Signed-off-by: Hannes Reinecke <hare@suse.de>
> Signed-off-by: Lee Duncan <lduncan@suse.com>
> ---
>  drivers/scsi/fnic/vnic_dev.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/scsi/fnic/vnic_dev.c b/drivers/scsi/fnic/vnic_dev.c
> index 5988c300cc82..d29999064b89 100644
> --- a/drivers/scsi/fnic/vnic_dev.c
> +++ b/drivers/scsi/fnic/vnic_dev.c
> @@ -697,7 +697,7 @@ int vnic_dev_hang_notify(struct vnic_dev *vdev)
>  
>  int vnic_dev_mac_addr(struct vnic_dev *vdev, u8 *mac_addr)
>  {
> -	u64 a[2] = {};
> +	u64 a[ETH_ALEN] = {};
>  	int wait = 1000;
>  	int err, i;
>  
> @@ -734,7 +734,7 @@ void vnic_dev_packet_filter(struct vnic_dev *vdev, int directed, int multicast,
>  
>  void vnic_dev_add_addr(struct vnic_dev *vdev, u8 *addr)
>  {
> -	u64 a[2] = {};
> +	u64 a[ETH_ALEN] = {};
>  	int wait = 1000;
>  	int err;
>  	int i;
> @@ -749,7 +749,7 @@ void vnic_dev_add_addr(struct vnic_dev *vdev, u8 *addr)
>  
>  void vnic_dev_del_addr(struct vnic_dev *vdev, u8 *addr)
>  {
> -	u64 a[2] = {};
> +	u64 a[ETH_ALEN] = {};
>  	int wait = 1000;
>  	int err;
>  	int i;
> 

This may not be correct. Please do not review this yet. I will re-submit
once I clear up my confusion.

-- 
Lee Duncan


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

* Re: [PATCH] fnic: fixup patch to resolve stack frame issues
  2021-01-27  1:21 [PATCH] fnic: fixup patch to resolve stack frame issues Lee Duncan
  2021-01-27  3:17 ` Lee Duncan
@ 2021-01-27  7:46 ` Greg KH
  2021-01-27 14:53   ` Lee Duncan
  1 sibling, 1 reply; 4+ messages in thread
From: Greg KH @ 2021-01-27  7:46 UTC (permalink / raw)
  To: Lee Duncan; +Cc: linux-scsi, linux-kernel, Hannes Reinecke, stable, Lee Duncan

On Tue, Jan 26, 2021 at 05:21:24PM -0800, Lee Duncan wrote:
> From: Hannes Reinecke <hare@suse.de>
> 
> Commit 42ec15ceaea7 fixed a gcc issue with unused variables, but
> introduced errors since it allocated an array of two u64-s but
> then used more than that. Set the arrays to the proper size.
> 
> Fixes: 42ec15ceaea74b5f7a621fc6686cbf69ca66c4cf

Please use the documented way to show sha1 commit ids to make it easier
to understand:

	42ec15ceaea7 ("scsi: fnic: fix invalid stack access")

thanks,

greg k-h

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

* Re: [PATCH] fnic: fixup patch to resolve stack frame issues
  2021-01-27  7:46 ` Greg KH
@ 2021-01-27 14:53   ` Lee Duncan
  0 siblings, 0 replies; 4+ messages in thread
From: Lee Duncan @ 2021-01-27 14:53 UTC (permalink / raw)
  To: Greg KH, Lee Duncan; +Cc: linux-scsi, linux-kernel, Hannes Reinecke, stable

On 1/26/21 11:46 PM, Greg KH wrote:
> On Tue, Jan 26, 2021 at 05:21:24PM -0800, Lee Duncan wrote:
>> From: Hannes Reinecke <hare@suse.de>
>>
>> Commit 42ec15ceaea7 fixed a gcc issue with unused variables, but
>> introduced errors since it allocated an array of two u64-s but
>> then used more than that. Set the arrays to the proper size.
>>
>> Fixes: 42ec15ceaea74b5f7a621fc6686cbf69ca66c4cf
> 
> Please use the documented way to show sha1 commit ids to make it easier
> to understand:
> 
> 	42ec15ceaea7 ("scsi: fnic: fix invalid stack access")
> 
> thanks,
> 
> greg k-h
> 

I will Greg. Thank you.

Please delete this patch, though. It is not correct.

My apologies for the churn.
-- 
Lee Duncan


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

end of thread, other threads:[~2021-01-27 14:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-27  1:21 [PATCH] fnic: fixup patch to resolve stack frame issues Lee Duncan
2021-01-27  3:17 ` Lee Duncan
2021-01-27  7:46 ` Greg KH
2021-01-27 14:53   ` Lee Duncan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).