Potential uninitialized variables in cfg80211

2 messages, 2 authors, 2019-10-09 · open the first message on its own page

Potential uninitialized variables in cfg80211

From: Yizhuo Zhai <hidden>
Date: 2019-10-08 21:18:47

Hi All:
net/wireless/chan.c:
Inside function cfg80211_chandef_compatible(), variable "c1_pri40",
" c2_pri40", "c1_pri80" and "c2_pri80" could be uninitialized if
chandef_primary_freqs() fails. However, they are used later in the if
statement to decide the control flow, which is potentially unsafe.

The patch is hard since we do not know the correct value to initialize them.
-- 
Kind Regards,

Yizhuo Zhai

Computer Science, Graduate Student
University of California, Riverside

Re: Potential uninitialized variables in cfg80211

From: Johannes Berg <johannes@sipsolutions.net>
Date: 2019-10-09 06:45:40

On Tue, 2019-10-08 at 14:19 -0700, Yizhuo Zhai wrote:
Hi All:
net/wireless/chan.c:
Inside function cfg80211_chandef_compatible(), variable "c1_pri40",
" c2_pri40", "c1_pri80" and "c2_pri80" could be uninitialized if
chandef_primary_freqs() fails. However, they are used later in the if
statement to decide the control flow, which is potentially unsafe.
I guess theoretically this is right, but the function should only be
called with valid chandefs, and if chandef_primary_freqs() hit the
warning then the chandef certainly wasn't valid.

johannes
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help