* [PATCH RESEND v1] qed: Fix copy of uninitialized memory
@ 2017-03-07 16:46 Robert Foss
2017-03-09 21:18 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Robert Foss @ 2017-03-07 16:46 UTC (permalink / raw)
To: Yuval.Mintz, Ariel.Elior, everest-linux-l2, netdev, linux-kernel
Cc: Robert Foss
In qed_ll2_start_ooo() the ll2_info variable is uninitialized and then
passed to qed_ll2_acquire_connection() where it is copied into a new
memory space.
This shouldn't cause any issue as long as non of the copied memory is
every read.
But the potential for a bug being introduced by reading this memory
is real.
Detected by CoverityScan, CID#1399632 ("Uninitialized scalar variable")
Signed-off-by: Robert Foss <robert.foss@collabora.com>
---
drivers/net/ethernet/qlogic/qed/qed_ll2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/qlogic/qed/qed_ll2.c b/drivers/net/ethernet/qlogic/qed/qed_ll2.c
index 9a0b9af10a57..5fb34db377c8 100644
--- a/drivers/net/ethernet/qlogic/qed/qed_ll2.c
+++ b/drivers/net/ethernet/qlogic/qed/qed_ll2.c
@@ -968,7 +968,7 @@ static int qed_ll2_start_ooo(struct qed_dev *cdev,
{
struct qed_hwfn *hwfn = QED_LEADING_HWFN(cdev);
u8 *handle = &hwfn->pf_params.iscsi_pf_params.ll2_ooo_queue_id;
- struct qed_ll2_conn ll2_info;
+ struct qed_ll2_conn ll2_info = { 0 };
int rc;
ll2_info.conn_type = QED_LL2_TYPE_ISCSI_OOO;
--
2.11.0.453.g787f75f05
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH RESEND v1] qed: Fix copy of uninitialized memory
2017-03-07 16:46 [PATCH RESEND v1] qed: Fix copy of uninitialized memory Robert Foss
@ 2017-03-09 21:18 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-03-09 21:18 UTC (permalink / raw)
To: robert.foss
Cc: Yuval.Mintz, Ariel.Elior, everest-linux-l2, netdev, linux-kernel
From: Robert Foss <robert.foss@collabora.com>
Date: Tue, 7 Mar 2017 11:46:25 -0500
> In qed_ll2_start_ooo() the ll2_info variable is uninitialized and then
> passed to qed_ll2_acquire_connection() where it is copied into a new
> memory space.
>
> This shouldn't cause any issue as long as non of the copied memory is
> every read.
> But the potential for a bug being introduced by reading this memory
> is real.
>
> Detected by CoverityScan, CID#1399632 ("Uninitialized scalar variable")
>
> Signed-off-by: Robert Foss <robert.foss@collabora.com>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-03-09 21:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-07 16:46 [PATCH RESEND v1] qed: Fix copy of uninitialized memory Robert Foss
2017-03-09 21:18 ` David Miller
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.