<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/misc/bcm-vk, branch v6.12.80</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2026-03-04T12:21:24+00:00</updated>
<entry>
<title>misc: bcm_vk: Fix possible null-pointer dereferences in bcm_vk_read()</title>
<updated>2026-03-04T12:21:24+00:00</updated>
<author>
<name>Tuo Li</name>
<email>islituo@gmail.com</email>
</author>
<published>2025-12-11T06:36:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=aa97ccc3dc1eba9f4537f0410e9dbb0b05ccf2fb'/>
<id>urn:sha1:aa97ccc3dc1eba9f4537f0410e9dbb0b05ccf2fb</id>
<content type='text'>
[ Upstream commit ba75ecb97d3f4e95d59002c13afb6519205be6cb ]

In the function bcm_vk_read(), the pointer entry is checked, indicating
that it can be NULL. If entry is NULL and rc is set to -EMSGSIZE, the
following code may cause null-pointer dereferences:

  struct vk_msg_blk tmp_msg = entry-&gt;to_h_msg[0];
  set_msg_id(&amp;tmp_msg, entry-&gt;usr_msg_id);
  tmp_msg.size = entry-&gt;to_h_blks - 1;

To prevent these possible null-pointer dereferences, copy to_h_msg,
usr_msg_id, and to_h_blks from iter into temporary variables, and return
these temporary variables to the application instead of accessing them
through a potentially NULL entry.

Signed-off-by: Tuo Li &lt;islituo@gmail.com&gt;
Reviewed-by: Scott Branden &lt;scott.branden@broadcom.com&gt;
Link: https://patch.msgid.link/20251211063637.3987937-1-islituo@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>move asm/unaligned.h to linux/unaligned.h</title>
<updated>2024-10-02T21:23:23+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2024-10-01T19:35:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5f60d5f6bbc12e782fac78110b0ee62698f3b576'/>
<id>urn:sha1:5f60d5f6bbc12e782fac78110b0ee62698f3b576</id>
<content type='text'>
asm/unaligned.h is always an include of asm-generic/unaligned.h;
might as well move that thing to linux/unaligned.h and include
that - there's nothing arch-specific in that header.

auto-generated by the following:

for i in `git grep -l -w asm/unaligned.h`; do
	sed -i -e "s/asm\/unaligned.h/linux\/unaligned.h/" $i
done
for i in `git grep -l -w asm-generic/unaligned.h`; do
	sed -i -e "s/asm-generic\/unaligned.h/linux\/unaligned.h/" $i
done
git mv include/asm-generic/unaligned.h include/linux/unaligned.h
git mv tools/include/asm-generic/unaligned.h tools/include/linux/unaligned.h
sed -i -e "/unaligned.h/d" include/asm-generic/Kbuild
sed -i -e "s/__ASM_GENERIC/__LINUX/" include/linux/unaligned.h tools/include/linux/unaligned.h
</content>
</entry>
<entry>
<title>tty: bcm: convert to u8 and size_t</title>
<updated>2023-12-08T11:02:37+00:00</updated>
<author>
<name>Jiri Slaby (SUSE)</name>
<email>jirislaby@kernel.org</email>
</author>
<published>2023-12-06T07:36:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=03e5af525750d83228f7177dbe9c9ae6ccd961e6'/>
<id>urn:sha1:03e5af525750d83228f7177dbe9c9ae6ccd961e6</id>
<content type='text'>
Switch character types to u8 and sizes to size_t. To conform to
characters/sizes in the rest of the tty layer.

Signed-off-by: "Jiri Slaby (SUSE)" &lt;jirislaby@kernel.org&gt;
Cc: Scott Branden &lt;scott.branden@broadcom.com&gt;
Cc: Broadcom internal kernel review list &lt;bcm-kernel-feedback-list@broadcom.com&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Link: https://lore.kernel.org/r/20231206073712.17776-8-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>misc: bcm-vk: Annotate struct bcm_vk_wkent with __counted_by</title>
<updated>2023-10-05T11:34:03+00:00</updated>
<author>
<name>Kees Cook</name>
<email>keescook@chromium.org</email>
</author>
<published>2023-09-22T17:50:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3c69d52e3e12f0330c554c9c6e5498c436c86f4b'/>
<id>urn:sha1:3c69d52e3e12f0330c554c9c6e5498c436c86f4b</id>
<content type='text'>
Prepare for the coming implementation by GCC and Clang of the __counted_by
attribute. Flexible array members annotated with __counted_by can have
their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS
(for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family
functions).

As found with Coccinelle[1], add __counted_by for struct bcm_vk_wkent.
Additionally, since the element count member must be set before accessing
the annotated flexible array member, move its initialization earlier.

[1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci

Cc: Scott Branden &lt;scott.branden@broadcom.com&gt;
Cc: Broadcom internal kernel review list &lt;bcm-kernel-feedback-list@broadcom.com&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Reviewed-by: "Gustavo A. R. Silva" &lt;gustavoars@kernel.org&gt;
Link: https://lore.kernel.org/r/20230922175057.work.558-kees@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'char-misc-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc</title>
<updated>2023-09-01T16:53:54+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2023-09-01T16:53:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1c9f8dff62d85ce00b0e99f774a84bd783af7cac'/>
<id>urn:sha1:1c9f8dff62d85ce00b0e99f774a84bd783af7cac</id>
<content type='text'>
Pull char/misc driver updates from Greg KH:
 "Here is the big set of char/misc and other small driver subsystem
  changes for 6.6-rc1.

  Stuff all over the place here, lots of driver updates and changes and
  new additions. Short summary is:

   - new IIO drivers and updates

   - Interconnect driver updates

   - fpga driver updates and additions

   - fsi driver updates

   - mei driver updates

   - coresight driver updates

   - nvmem driver updates

   - counter driver updates

   - lots of smaller misc and char driver updates and additions

  All of these have been in linux-next for a long time with no reported
  problems"

* tag 'char-misc-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (267 commits)
  nvmem: core: Notify when a new layout is registered
  nvmem: core: Do not open-code existing functions
  nvmem: core: Return NULL when no nvmem layout is found
  nvmem: core: Create all cells before adding the nvmem device
  nvmem: u-boot-env:: Replace zero-length array with DECLARE_FLEX_ARRAY() helper
  nvmem: sec-qfprom: Add Qualcomm secure QFPROM support
  dt-bindings: nvmem: sec-qfprom: Add bindings for secure qfprom
  dt-bindings: nvmem: Add compatible for QCM2290
  nvmem: Kconfig: Fix typo "drive" -&gt; "driver"
  nvmem: Explicitly include correct DT includes
  nvmem: add new NXP QorIQ eFuse driver
  dt-bindings: nvmem: Add t1023-sfp efuse support
  dt-bindings: nvmem: qfprom: Add compatible for MSM8226
  nvmem: uniphier: Use devm_platform_get_and_ioremap_resource()
  nvmem: qfprom: do some cleanup
  nvmem: stm32-romem: Use devm_platform_get_and_ioremap_resource()
  nvmem: rockchip-efuse: Use devm_platform_get_and_ioremap_resource()
  nvmem: meson-mx-efuse: Convert to devm_platform_ioremap_resource()
  nvmem: lpc18xx_otp: Convert to devm_platform_ioremap_resource()
  nvmem: brcm_nvram: Use devm_platform_get_and_ioremap_resource()
  ...
</content>
</entry>
<entry>
<title>tty: make tty_operations::write()'s count size_t</title>
<updated>2023-08-11T19:12:46+00:00</updated>
<author>
<name>Jiri Slaby (SUSE)</name>
<email>jirislaby@kernel.org</email>
</author>
<published>2023-08-10T09:15:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=95713967ba52389f7cea75704d0cf048080ec218'/>
<id>urn:sha1:95713967ba52389f7cea75704d0cf048080ec218</id>
<content type='text'>
Unify with the rest of the code. Use size_t for counts and ssize_t for
retval.

Signed-off-by: "Jiri Slaby (SUSE)" &lt;jirislaby@kernel.org&gt;
Link: https://lore.kernel.org/r/20230810091510.13006-30-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: propagate u8 data to tty_operations::write()</title>
<updated>2023-08-11T19:12:46+00:00</updated>
<author>
<name>Jiri Slaby (SUSE)</name>
<email>jirislaby@kernel.org</email>
</author>
<published>2023-08-10T09:15:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=69851e4ab8feeb369119a44ddca430c0ee15f0d8'/>
<id>urn:sha1:69851e4ab8feeb369119a44ddca430c0ee15f0d8</id>
<content type='text'>
Data are now typed as u8. Propagate this change to
tty_operations::write().

Signed-off-by: "Jiri Slaby (SUSE)" &lt;jirislaby@kernel.org&gt;
Cc: Richard Henderson &lt;richard.henderson@linaro.org&gt;
Cc: Ivan Kokshaysky &lt;ink@jurassic.park.msu.ru&gt;
Cc: Matt Turner &lt;mattst88@gmail.com&gt;
Cc: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Cc: Richard Weinberger &lt;richard@nod.at&gt;
Cc: Anton Ivanov &lt;anton.ivanov@cambridgegreys.com&gt;
Cc: Johannes Berg &lt;johannes@sipsolutions.net&gt;
Cc: Chris Zankel &lt;chris@zankel.net&gt;
Cc: Max Filippov &lt;jcmvbkbc@gmail.com&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: Vaibhav Gupta &lt;vaibhavgupta40@gmail.com&gt;
Cc: Jens Taprogge &lt;jens.taprogge@taprogge.org&gt;
Cc: Karsten Keil &lt;isdn@linux-pingi.de&gt;
Cc: Scott Branden &lt;scott.branden@broadcom.com&gt;
Cc: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Cc: Eric Dumazet &lt;edumazet@google.com&gt;
Cc: Jakub Kicinski &lt;kuba@kernel.org&gt;
Cc: Paolo Abeni &lt;pabeni@redhat.com&gt;
Cc: Heiko Carstens &lt;hca@linux.ibm.com&gt;
Cc: Vasily Gorbik &lt;gor@linux.ibm.com&gt;
Cc: Alexander Gordeev &lt;agordeev@linux.ibm.com&gt;
Cc: Christian Borntraeger &lt;borntraeger@linux.ibm.com&gt;
Cc: Sven Schnelle &lt;svens@linux.ibm.com&gt;
Cc: David Lin &lt;dtwlin@gmail.com&gt;
Cc: Johan Hovold &lt;johan@kernel.org&gt;
Cc: Alex Elder &lt;elder@kernel.org&gt;
Cc: Laurentiu Tudor &lt;laurentiu.tudor@nxp.com&gt;
Cc: Jiri Kosina &lt;jikos@kernel.org&gt;
Cc: David Sterba &lt;dsterba@suse.com&gt;
Cc: Shawn Guo &lt;shawnguo@kernel.org&gt;
Cc: Sascha Hauer &lt;s.hauer@pengutronix.de&gt;
Cc: Pengutronix Kernel Team &lt;kernel@pengutronix.de&gt;
Cc: Fabio Estevam &lt;festevam@gmail.com&gt;
Cc: NXP Linux Team &lt;linux-imx@nxp.com&gt;
Cc: Arnaud Pouliquen &lt;arnaud.pouliquen@foss.st.com&gt;
Cc: Oliver Neukum &lt;oneukum@suse.com&gt;
Cc: Mathias Nyman &lt;mathias.nyman@intel.com&gt;
Cc: Marcel Holtmann &lt;marcel@holtmann.org&gt;
Cc: Johan Hedberg &lt;johan.hedberg@gmail.com&gt;
Cc: Luiz Augusto von Dentz &lt;luiz.dentz@gmail.com&gt;
Link: https://lore.kernel.org/r/20230810091510.13006-28-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>misc: bcm_vk: Fix potential deadlock on &amp;vk-&gt;ctx_lock</title>
<updated>2023-08-04T13:45:19+00:00</updated>
<author>
<name>Chengfeng Ye</name>
<email>dg573847474@gmail.com</email>
</author>
<published>2023-06-29T18:29:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1bae5c0e2c8d48c1c1306912dfae41d165508f58'/>
<id>urn:sha1:1bae5c0e2c8d48c1c1306912dfae41d165508f58</id>
<content type='text'>
As &amp;vk-&gt;ctx_lock is acquired by timer bcm_vk_hb_poll() under softirq
context, other process context code should disable irq or bottom-half
before acquire the same lock, otherwise deadlock could happen if the
timer preempt the execution while the lock is held in process context
on the same CPU.

Possible deadlock scenario
bcm_vk_open()
    -&gt; bcm_vk_get_ctx()
    -&gt; spin_lock(&amp;vk-&gt;ctx_lock)
	&lt;timer iterrupt&gt;
	-&gt; bcm_vk_hb_poll()
	-&gt; bcm_vk_blk_drv_access()
	-&gt; spin_lock_irqsave(&amp;vk-&gt;ctx_lock, flags) (deadlock here)

This flaw was found using an experimental static analysis tool we are
developing for irq-related deadlock, which reported the following
warning when analyzing the linux kernel 6.4-rc7 release.

[Deadlock]: &amp;vk-&gt;ctx_lock
  [Interrupt]: bcm_vk_hb_poll
    --&gt;/root/linux/drivers/misc/bcm-vk/bcm_vk_msg.c:176
    --&gt;/root/linux/drivers/misc/bcm-vk/bcm_vk_dev.c:512
  [Locking Unit]: bcm_vk_ioctl
    --&gt;/root/linux/drivers/misc/bcm-vk/bcm_vk_dev.c:1181
    --&gt;/root/linux/drivers/misc/bcm-vk/bcm_vk_dev.c:512

[Deadlock]: &amp;vk-&gt;ctx_lock
  [Interrupt]: bcm_vk_hb_poll
    --&gt;/root/linux/drivers/misc/bcm-vk/bcm_vk_msg.c:176
    --&gt;/root/linux/drivers/misc/bcm-vk/bcm_vk_dev.c:512
  [Locking Unit]: bcm_vk_ioctl
    --&gt;/root/linux/drivers/misc/bcm-vk/bcm_vk_dev.c:1169

[Deadlock]: &amp;vk-&gt;ctx_lock
  [Interrupt]: bcm_vk_hb_poll
    --&gt;/root/linux/drivers/misc/bcm-vk/bcm_vk_msg.c:176
    --&gt;/root/linux/drivers/misc/bcm-vk/bcm_vk_dev.c:512
  [Locking Unit]: bcm_vk_open
    --&gt;/root/linux/drivers/misc/bcm-vk/bcm_vk_msg.c:216

[Deadlock]: &amp;vk-&gt;ctx_lock
  [Interrupt]: bcm_vk_hb_poll
    --&gt;/root/linux/drivers/misc/bcm-vk/bcm_vk_msg.c:176
    --&gt;/root/linux/drivers/misc/bcm-vk/bcm_vk_dev.c:512
  [Locking Unit]: bcm_vk_release
    --&gt;/root/linux/drivers/misc/bcm-vk/bcm_vk_msg.c:306

As suggested by Arnd, the tentative patch fix the potential deadlocks
by replacing the timer with delay workqueue. x86_64 allyesconfig using
GCC shows no new warning. Note that no runtime testing was performed
due to no device on hand.

Signed-off-by: Chengfeng Ye &lt;dg573847474@gmail.com&gt;
Acked-by: Scott Branden &lt;scott.branden@broadcom.com&gt;
Tested-by: Desmond Yan &lt;desmond.branden@broadcom.com&gt;
Tested-by: Desmond Yan &lt;desmond.yan@broadcom.com&gt;
Link: https://lore.kernel.org/r/20230629182941.13045-1-dg573847474@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>misc: bcm_vk: Remove usage of deprecated functions</title>
<updated>2022-09-01T14:29:32+00:00</updated>
<author>
<name>Breno Leitao</name>
<email>leitao@debian.org</email>
</author>
<published>2022-08-12T09:47:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5cb14f15d79a8edfb9197deb97c7061d55b819ab'/>
<id>urn:sha1:5cb14f15d79a8edfb9197deb97c7061d55b819ab</id>
<content type='text'>
ida_simple_get() and ida_simple_remove() functions are deprecated now.
These functions were replaced by ida_alloc() and ida_free()
respectively. This patch modernize bcm_vk to use the replacement
functions.

Acked-by: Scott Branden &lt;scott.branden@broadcom.com&gt;
Signed-off-by: Breno Leitao &lt;leitao@debian.org&gt;
Link: https://lore.kernel.org/r/20220812094717.4097179-1-leitao@debian.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>misc: bcm-vk: Specify the minimum number of IRQ vecs</title>
<updated>2022-09-01T14:29:29+00:00</updated>
<author>
<name>Breno Leitao</name>
<email>leitao@debian.org</email>
</author>
<published>2022-08-12T09:40:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=fccf202e01e0e5c9d5f1fdd00009614c04c82818'/>
<id>urn:sha1:fccf202e01e0e5c9d5f1fdd00009614c04c82818</id>
<content type='text'>
During bcm_vk_probe(), pci_alloc_irq_vectors() is called passing the
number of IRQ vectors as 1, but, later, check how many IRQ vectors it
got, and fails if it is smaller than VK_MSIX_IRQ_MIN_REQ.

The most appropriated way to do it is setting the 'min_vecs' param as
VK_MSIX_IRQ_MIN_REQ, instead of one. pci_alloc_irq_vectors() should
know the requirements when called.

The test was done by just loading this module on a machine with a
Valkyrie offload engine hardware.

Acked-by: Scott Branden &lt;scott.branden@broadcom.com&gt;
Signed-off-by: Breno Leitao &lt;leitao@debian.org&gt;
Link: https://lore.kernel.org/r/20220812094011.4064729-1-leitao@debian.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
