<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/net/wireless/ti/wlcore/debugfs.h, branch v7.1</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v7.1</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v7.1'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2021-04-22T14:39:29+00:00</updated>
<entry>
<title>wlcore: Fix buffer overrun by snprintf due to incorrect buffer size</title>
<updated>2021-04-22T14:39:29+00:00</updated>
<author>
<name>Colin Ian King</name>
<email>colin.king@canonical.com</email>
</author>
<published>2021-04-19T14:14:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a9a4c080deb33f44e08afe35f4ca4bb9ece89f4e'/>
<id>urn:sha1:a9a4c080deb33f44e08afe35f4ca4bb9ece89f4e</id>
<content type='text'>
The size of the buffer than can be written to is currently incorrect, it is
always the size of the entire buffer even though the snprintf is writing
as position pos into the buffer. Fix this by setting the buffer size to be
the number of bytes left in the buffer, namely sizeof(buf) - pos.

Addresses-Coverity: ("Out-of-bounds access")
Fixes: 7b0e2c4f6be3 ("wlcore: fix overlapping snprintf arguments in debugfs")
Signed-off-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Reviewed-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
Link: https://lore.kernel.org/r/20210419141405.180582-1-colin.king@canonical.com
</content>
</entry>
<entry>
<title>wlcore: fix overlapping snprintf arguments in debugfs</title>
<updated>2021-04-17T18:01:56+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2021-03-23T12:57:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7b0e2c4f6be3ec68bf807c84e985e81c21404cd1'/>
<id>urn:sha1:7b0e2c4f6be3ec68bf807c84e985e81c21404cd1</id>
<content type='text'>
gcc complains about undefined behavior in calling snprintf()
with the same buffer as input and output:

drivers/net/wireless/ti/wl18xx/debugfs.c: In function 'diversity_num_of_packets_per_ant_read':
drivers/net/wireless/ti/wl18xx/../wlcore/debugfs.h:86:3: error: 'snprintf' argument 4 overlaps destination object 'buf' [-Werror=restrict]
   86 |   snprintf(buf, sizeof(buf), "%s[%d] = %d\n",  \
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   87 |     buf, i, stats-&gt;sub.name[i]);   \
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/ti/wl18xx/debugfs.c:24:2: note: in expansion of macro 'DEBUGFS_FWSTATS_FILE_ARRAY'
   24 |  DEBUGFS_FWSTATS_FILE_ARRAY(a, b, c, wl18xx_acx_statistics)
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/ti/wl18xx/debugfs.c:159:1: note: in expansion of macro 'WL18XX_DEBUGFS_FWSTATS_FILE_ARRAY'
  159 | WL18XX_DEBUGFS_FWSTATS_FILE_ARRAY(diversity, num_of_packets_per_ant,

There are probably other ways of handling the debugfs file, without
using on-stack buffers, but a simple workaround here is to remember the
current position in the buffer and just keep printing in there.

Fixes: bcca1bbdd412 ("wlcore: add debugfs macro to help print fw statistics arrays")
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
Link: https://lore.kernel.org/r/20210323125723.1961432-1-arnd@kernel.org
</content>
</entry>
<entry>
<title>wlcore: debugfs: Remove unused variable 'res'</title>
<updated>2020-09-01T13:14:44+00:00</updated>
<author>
<name>Lee Jones</name>
<email>lee.jones@linaro.org</email>
</author>
<published>2020-08-26T09:33:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b95451e02e1cacf51d0c6ac9f7c21def0b24d039'/>
<id>urn:sha1:b95451e02e1cacf51d0c6ac9f7c21def0b24d039</id>
<content type='text'>
Fixes the following W=1 kernel build warning(s):

Cc: Kalle Valo &lt;kvalo@codeaurora.org&gt;
Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Cc: Jakub Kicinski &lt;kuba@kernel.org&gt;
Cc: Luciano Coelho &lt;luciano.coelho@nokia.com&gt;
Cc: linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
Link: https://lore.kernel.org/r/20200826093401.1458456-16-lee.jones@linaro.org
</content>
</entry>
<entry>
<title>treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 336</title>
<updated>2019-06-05T15:37:07+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2019-05-29T23:57:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2b27bdcc20958d644d04f9f12d683e52b37a5427'/>
<id>urn:sha1:2b27bdcc20958d644d04f9f12d683e52b37a5427</id>
<content type='text'>
Based on 1 normalized pattern(s):

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license version 2 as
  published by the free software foundation this program is
  distributed in the hope that it will be useful but without any
  warranty without even the implied warranty of merchantability or
  fitness for a particular purpose see the gnu general public license
  for more details you should have received a copy of the gnu general
  public license along with this program if not write to the free
  software foundation inc 51 franklin st fifth floor boston ma 02110
  1301 usa

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-only

has been chosen to replace the boilerplate/reference in 246 file(s).

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Alexios Zavras &lt;alexios.zavras@intel.com&gt;
Reviewed-by: Allison Randal &lt;allison@lohutok.net&gt;
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190530000436.674189849@linutronix.de
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>wlcore: no need to check return value of debugfs_create functions</title>
<updated>2019-02-01T12:29:50+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2019-01-22T15:21:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ad2106ca00dfce85ccae7dea28168c3d9e6cc800'/>
<id>urn:sha1:ad2106ca00dfce85ccae7dea28168c3d9e6cc800</id>
<content type='text'>
When calling debugfs functions, there is no need to ever check the
return value.  The function can work or not, but the code logic should
never do something different based on this.

Cc: Kalle Valo &lt;kvalo@codeaurora.org&gt;
Cc: Tony Lindgren &lt;tony@atomide.com&gt;
Cc: linux-wireless@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Acked-by: Tony Lindgren &lt;tony@atomide.com&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
</content>
</entry>
<entry>
<title>wl18xx: show rx_frames_per_rates as an array as it really is</title>
<updated>2015-03-16T16:07:03+00:00</updated>
<author>
<name>Nicolas Iooss</name>
<email>nicolas.iooss_linux@m4x.org</email>
</author>
<published>2015-03-13T07:17:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a3fa71c40f1853d0c27e8f5bc01a722a705d9682'/>
<id>urn:sha1:a3fa71c40f1853d0c27e8f5bc01a722a705d9682</id>
<content type='text'>
In struct wl18xx_acx_rx_rate_stat, rx_frames_per_rates field is an
array, not a number.  This means WL18XX_DEBUGFS_FWSTATS_FILE can't be
used to display this field in debugfs (it would display a pointer, not
the actual data).  Use WL18XX_DEBUGFS_FWSTATS_FILE_ARRAY instead.

This bug has been found by adding a __printf attribute to
wl1271_format_buffer.  gcc complained about "format '%u' expects
argument of type 'unsigned int', but argument 5 has type 'u32 *'".

Fixes: c5d94169e818 ("wl18xx: use new fw stats structures")
Signed-off-by: Nicolas Iooss &lt;nicolas.iooss_linux@m4x.org&gt;
Signed-off-by: Kalle Valo &lt;kvalo@codeaurora.org&gt;
</content>
</entry>
<entry>
<title>wlcore: Remove trailing semicolon from do {...} while (0) macro</title>
<updated>2014-05-16T18:26:53+00:00</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2014-05-14T19:15:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f8b8a47e06a0d07219629c83de2a3b7ff1d5aa65'/>
<id>urn:sha1:f8b8a47e06a0d07219629c83de2a3b7ff1d5aa65</id>
<content type='text'>
These should not have trailing semicolons so remove them.

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Signed-off-by: John W. Linville &lt;linville@tuxdriver.com&gt;
</content>
</entry>
<entry>
<title>wlcore: add debugfs macro to help print fw statistics arrays</title>
<updated>2012-06-05T12:58:08+00:00</updated>
<author>
<name>Luciano Coelho</name>
<email>coelho@ti.com</email>
</author>
<published>2012-05-10T09:14:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=bcca1bbdd412fb6be32d04fc2407c81239de5f8c'/>
<id>urn:sha1:bcca1bbdd412fb6be32d04fc2407c81239de5f8c</id>
<content type='text'>
Add a macro to make it easy to print arrays from the FW statistics
array in debugfs.  At the same time, increase the buffer size so
arrays fit more easily.

Signed-off-by: Luciano Coelho &lt;coelho@ti.com&gt;
Signed-off-by: Arik Nemtsov &lt;arik@wizery.com&gt;
</content>
</entry>
<entry>
<title>wlcore: abstract debugfs fw_stats to be handled by the lower drivers</title>
<updated>2012-06-05T12:58:02+00:00</updated>
<author>
<name>Luciano Coelho</name>
<email>coelho@ti.com</email>
</author>
<published>2012-05-10T09:14:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4987257c304bf5d12e7a5cedde1100ba7f14a8a3'/>
<id>urn:sha1:4987257c304bf5d12e7a5cedde1100ba7f14a8a3</id>
<content type='text'>
The FW statistics differ from hardware to hardware.  This commit
prepares for hardware-specific implementation of the FW statistics
debugfs entries.

Signed-off-by: Luciano Coelho &lt;coelho@ti.com&gt;
Signed-off-by: Arik Nemtsov &lt;arik@wizery.com&gt;
</content>
</entry>
<entry>
<title>wl12xx/wlcore: move wl1271 struct to wlcore and add ops</title>
<updated>2012-04-12T05:43:56+00:00</updated>
<author>
<name>Luciano Coelho</name>
<email>coelho@ti.com</email>
</author>
<published>2011-11-21T17:25:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c31be25a7144ebc9b7a22128909bac7654d4c46b'/>
<id>urn:sha1:c31be25a7144ebc9b7a22128909bac7654d4c46b</id>
<content type='text'>
In order to add chip-specific operations and prepare for future
elements that need to be set by the lower driver, move the wl1271
structure to the wlcore.h file and add an empty placeholder for the
operations structure.

Signed-off-by: Luciano Coelho &lt;coelho@ti.com&gt;
</content>
</entry>
</feed>
