<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/char, branch v6.6.127</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.127</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.127'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2026-01-11T14:22:32+00:00</updated>
<entry>
<title>virtio_console: fix order of fields cols and rows</title>
<updated>2026-01-11T14:22:32+00:00</updated>
<author>
<name>Maximilian Immanuel Brandtner</name>
<email>maxbr@linux.ibm.com</email>
</author>
<published>2025-03-24T14:42:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f6dcbd2bbea5e43f33e31d09667fd7e59c40aab9'/>
<id>urn:sha1:f6dcbd2bbea5e43f33e31d09667fd7e59c40aab9</id>
<content type='text'>
commit 5326ab737a47278dbd16ed3ee7380b26c7056ddd upstream.

According to section 5.3.6.2 (Multiport Device Operation) of the virtio
spec(version 1.2) a control buffer with the event VIRTIO_CONSOLE_RESIZE
is followed by a virtio_console_resize struct containing cols then rows.
The kernel implements this the wrong way around (rows then cols) resulting
in the two values being swapped.

Signed-off-by: Maximilian Immanuel Brandtner &lt;maxbr@linux.ibm.com&gt;
Message-Id: &lt;20250324144300.905535-1-maxbr@linux.ibm.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Cc: Filip Hejsek &lt;filip.hejsek@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tpm: Cap the number of PCR banks</title>
<updated>2026-01-11T14:22:20+00:00</updated>
<author>
<name>Jarkko Sakkinen</name>
<email>jarkko.sakkinen@opinsys.com</email>
</author>
<published>2025-09-30T12:58:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d88481653d74d622d1d0d2c9bad845fc2cc6fd23'/>
<id>urn:sha1:d88481653d74d622d1d0d2c9bad845fc2cc6fd23</id>
<content type='text'>
commit faf07e611dfa464b201223a7253e9dc5ee0f3c9e upstream.

tpm2_get_pcr_allocation() does not cap any upper limit for the number of
banks. Cap the limit to eight banks so that out of bounds values coming
from external I/O cause on only limited harm.

Cc: stable@vger.kernel.org # v5.10+
Fixes: bcfff8384f6c ("tpm: dynamically allocate the allocated_banks array")
Tested-by: Lai Yi &lt;yi1.lai@linux.intel.com&gt;
Reviewed-by: Jonathan McDowell &lt;noodles@meta.com&gt;
Reviewed-by: Roberto Sassu &lt;roberto.sassu@huawei.com&gt;
Signed-off-by: Jarkko Sakkinen &lt;jarkko.sakkinen@opinsys.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>char: applicom: fix NULL pointer dereference in ac_ioctl</title>
<updated>2026-01-11T14:21:58+00:00</updated>
<author>
<name>Tianchu Chen</name>
<email>flynnnchen@tencent.com</email>
</author>
<published>2025-11-28T07:53:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d285517429a75423789e6408653e57b6fdfc8e54'/>
<id>urn:sha1:d285517429a75423789e6408653e57b6fdfc8e54</id>
<content type='text'>
commit 82d12088c297fa1cef670e1718b3d24f414c23f7 upstream.

Discovered by Atuin - Automated Vulnerability Discovery Engine.

In ac_ioctl, the validation of IndexCard and the check for a valid
RamIO pointer are skipped when cmd is 6. However, the function
unconditionally executes readb(apbs[IndexCard].RamIO + VERS) at the
end.

If cmd is 6, IndexCard may reference a board that does not exist
(where RamIO is NULL), leading to a NULL pointer dereference.

Fix this by skipping the readb access when cmd is 6, as this
command is a global information query and does not target a specific
board context.

Signed-off-by: Tianchu Chen &lt;flynnnchen@tencent.com&gt;
Acked-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: stable &lt;stable@kernel.org&gt;
Link: https://patch.msgid.link/20251128155323.a786fde92ebb926cbe96fcb1@linux.dev
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>ipmi: Fix __scan_channels() failing to rescan channels</title>
<updated>2026-01-11T14:21:51+00:00</updated>
<author>
<name>Jinhui Guo</name>
<email>guojinhui.liam@bytedance.com</email>
</author>
<published>2025-09-30T07:42:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=aafed85dbff7d35c3d70d451fad02e4699eae2ee'/>
<id>urn:sha1:aafed85dbff7d35c3d70d451fad02e4699eae2ee</id>
<content type='text'>
[ Upstream commit 6bd30d8fc523fb880b4be548e8501bc0fe8f42d4 ]

channel_handler() sets intf-&gt;channels_ready to true but never
clears it, so __scan_channels() skips any rescan. When the BMC
firmware changes a rescan is required. Allow it by clearing
the flag before starting a new scan.

Signed-off-by: Jinhui Guo &lt;guojinhui.liam@bytedance.com&gt;
Message-ID: &lt;20250930074239.2353-3-guojinhui.liam@bytedance.com&gt;
Signed-off-by: Corey Minyard &lt;corey@minyard.net&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>ipmi: Fix the race between __scan_channels() and deliver_response()</title>
<updated>2026-01-11T14:21:51+00:00</updated>
<author>
<name>Jinhui Guo</name>
<email>guojinhui.liam@bytedance.com</email>
</author>
<published>2025-09-30T07:42:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=42985fb28312dc6595daf9558ba1b43448b557ff'/>
<id>urn:sha1:42985fb28312dc6595daf9558ba1b43448b557ff</id>
<content type='text'>
[ Upstream commit 936750fdba4c45e13bbd17f261bb140dd55f5e93 ]

The race window between __scan_channels() and deliver_response() causes
the parameters of some channels to be set to 0.

1.[CPUA] __scan_channels() issues an IPMI request and waits with
         wait_event() until all channels have been scanned.
         wait_event() internally calls might_sleep(), which might
         yield the CPU. (Moreover, an interrupt can preempt
         wait_event() and force the task to yield the CPU.)
2.[CPUB] deliver_response() is invoked when the CPU receives the
         IPMI response. After processing a IPMI response,
         deliver_response() directly assigns intf-&gt;wchannels to
         intf-&gt;channel_list and sets intf-&gt;channels_ready to true.
         However, not all channels are actually ready for use.
3.[CPUA] Since intf-&gt;channels_ready is already true, wait_event()
         never enters __wait_event(). __scan_channels() immediately
         clears intf-&gt;null_user_handler and exits.
4.[CPUB] Once intf-&gt;null_user_handler is set to NULL, deliver_response()
         ignores further IPMI responses, leaving the remaining
	 channels zero-initialized and unusable.

CPUA                             CPUB
-------------------------------  -----------------------------
__scan_channels()
 intf-&gt;null_user_handler
       = channel_handler;
 send_channel_info_cmd(intf,
       0);
 wait_event(intf-&gt;waitq,
       intf-&gt;channels_ready);
  do {
   might_sleep();
                                 deliver_response()
                                  channel_handler()
                                   intf-&gt;channel_list =
				         intf-&gt;wchannels + set;
                                   intf-&gt;channels_ready = true;
                                   send_channel_info_cmd(intf,
                                         intf-&gt;curr_channel);
   if (condition)
    break;
   __wait_event(wq_head,
          condition);
  } while(0)
 intf-&gt;null_user_handler
       = NULL;
                                 deliver_response()
                                  if (!msg-&gt;user)
                                   if (intf-&gt;null_user_handler)
                                    rv = -EINVAL;
                                  return rv;
-------------------------------  -----------------------------

Fix the race between __scan_channels() and deliver_response() by
deferring both the assignment intf-&gt;channel_list = intf-&gt;wchannels
and the flag intf-&gt;channels_ready = true until all channels have
been successfully scanned or until the IPMI request has failed.

Signed-off-by: Jinhui Guo &lt;guojinhui.liam@bytedance.com&gt;
Message-ID: &lt;20250930074239.2353-2-guojinhui.liam@bytedance.com&gt;
Signed-off-by: Corey Minyard &lt;corey@minyard.net&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>char: misc: restrict the dynamic range to exclude reserved minors</title>
<updated>2025-11-24T09:29:46+00:00</updated>
<author>
<name>Thadeu Lima de Souza Cascardo</name>
<email>cascardo@igalia.com</email>
</author>
<published>2025-04-23T08:45:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f1d84a3d6521d977c405d2cbd1551bff1606c33d'/>
<id>urn:sha1:f1d84a3d6521d977c405d2cbd1551bff1606c33d</id>
<content type='text'>
[ Upstream commit 31b636d2c41613e3bd36256a4bd53e9dacfa2677 ]

When this was first reported [1], the possibility of having sufficient
number of dynamic misc devices was theoretical, in the case of dlm driver.
In practice, its userspace never created more than one device.

What we know from commit ab760791c0cf ("char: misc: Increase the maximum
number of dynamic misc devices to 1048448"), is that the miscdevice
interface has been used for allocating more than the single-shot devices it
was designed for. And it is not only coresight_tmc, but many other drivers
are able to create multiple devices.

On systems like the ones described in the above commit, it is certain that
the dynamic allocation will allocate certain reserved minor numbers,
leading to failures when a later driver tries to claim its reserved number.

Instead of excluding the historically statically allocated range from
dynamic allocation, restrict the latter to minors above 255. That also
removes the need for DYNAMIC_MINORS and the convolution in allocating minor
numbers, simplifying the code.

Since commit ab760791c0cf ("char: misc: Increase the maximum number of
dynamic misc devices to 1048448") has been applied, such range is already
possible. And given such devices already need to be dynamically created,
there should be no systems where this might become a problem.

[1] https://lore.kernel.org/all/1257813017-28598-3-git-send-email-cascardo@holoscopio.com/

Signed-off-by: Thadeu Lima de Souza Cascardo &lt;cascardo@igalia.com&gt;
Link: https://lore.kernel.org/r/20250423-misc-dynrange-v4-1-133b5ae4ca18@igalia.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>char: Use list_del_init() in misc_deregister() to reinitialize list pointer</title>
<updated>2025-11-24T09:29:35+00:00</updated>
<author>
<name>Xion Wang</name>
<email>xion.wang@mediatek.com</email>
</author>
<published>2025-09-04T06:37:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=81015dd217a4fd3e56e910ee450300f332ef9ea7'/>
<id>urn:sha1:81015dd217a4fd3e56e910ee450300f332ef9ea7</id>
<content type='text'>
[ Upstream commit e28022873c0d051e980c4145f1965cab5504b498 ]

Currently, misc_deregister() uses list_del() to remove the device
from the list. After list_del(), the list pointers are set to
LIST_POISON1 and LIST_POISON2, which may help catch use-after-free bugs,
but does not reset the list head.
If misc_deregister() is called more than once on the same device,
list_empty() will not return true, and list_del() may be called again,
leading to undefined behavior.

Replace list_del() with list_del_init() to reinitialize the list head
after deletion. This makes the code more robust against double
deregistration and allows safe usage of list_empty() on the miscdevice
after deregistration.

[ Note, this seems to keep broken out-of-tree drivers from doing foolish
  things.  While this does not matter for any in-kernel drivers,
  external drivers could use a bit of help to show them they shouldn't
  be doing stuff like re-registering misc devices - gregkh ]

Signed-off-by: Xion Wang &lt;xion.wang@mediatek.com&gt;
Link: https://lore.kernel.org/r/20250904063714.28925-2-xion.wang@mediatek.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>char: misc: Does not request module for miscdevice with dynamic minor</title>
<updated>2025-11-24T09:29:29+00:00</updated>
<author>
<name>Zijun Hu</name>
<email>zijun.hu@oss.qualcomm.com</email>
</author>
<published>2025-07-14T15:34:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7d4ad49ba0c1922b5793afaa71223784c423bc7a'/>
<id>urn:sha1:7d4ad49ba0c1922b5793afaa71223784c423bc7a</id>
<content type='text'>
[ Upstream commit 1ba0fb42aa6a5f072b1b8c0b0520b32ad4ef4b45 ]

misc_open() may request module for miscdevice with dynamic minor, which
is meaningless since:

- The dynamic minor allocated is unknown in advance without registering
  miscdevice firstly.
- Macro MODULE_ALIAS_MISCDEV() is not applicable for dynamic minor.

Fix by only requesting module for miscdevice with fixed minor.

Acked-by: Thadeu Lima de Souza Cascardo &lt;cascardo@igalia.com&gt;
Signed-off-by: Zijun Hu &lt;zijun.hu@oss.qualcomm.com&gt;
Link: https://lore.kernel.org/r/20250714-rfc_miscdev-v6-6-2ed949665bde@oss.qualcomm.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>char: misc: Make misc_register() reentry for miscdevice who wants dynamic minor</title>
<updated>2025-11-24T09:29:29+00:00</updated>
<author>
<name>Zijun Hu</name>
<email>zijun.hu@oss.qualcomm.com</email>
</author>
<published>2025-07-14T15:34:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4a61f3eb8913c9c31cba4f5d8e8edca24aaaa943'/>
<id>urn:sha1:4a61f3eb8913c9c31cba4f5d8e8edca24aaaa943</id>
<content type='text'>
[ Upstream commit 52e2bb5ff089d65e2c7d982fe2826dc88e473d50 ]

For miscdevice who wants dynamic minor, it may fail to be registered again
without reinitialization after being de-registered, which is illustrated
by kunit test case miscdev_test_dynamic_reentry() newly added.

There is a real case found by cascardo when a part of minor range were
contained by range [0, 255):

1) wmi/dell-smbios registered minor 122, and acpi_thermal_rel registered
   minor 123
2) unbind "int3400 thermal" driver from its device, this will de-register
   acpi_thermal_rel
3) rmmod then insmod dell_smbios again, now wmi/dell-smbios is using minor
   123
4) bind the device to "int3400 thermal" driver again, acpi_thermal_rel
   fails to register.

Some drivers may reuse the miscdevice structure after they are deregistered
If the intention is to allocate a dynamic minor, if the minor number is not
reset to MISC_DYNAMIC_MINOR before calling misc_register(), it will try to
register a previously dynamically allocated minor number, which may have
been registered by a different driver.

One such case is the acpi_thermal_rel misc device, registered by the
int3400 thermal driver. If the device is unbound from the driver and later
bound, if there was another dynamic misc device registered in between, it
would fail to register the acpi_thermal_rel misc device. Other drivers
behave similarly.

Actually, this kind of issue is prone to happen if APIs
misc_register()/misc_deregister() are invoked by driver's
probe()/remove() separately.

Instead of fixing all the drivers, just reset the minor member to
MISC_DYNAMIC_MINOR in misc_deregister() in case it was a dynamically
allocated minor number, as error handling of misc_register() does.

Cc: Thadeu Lima de Souza Cascardo &lt;cascardo@igalia.com&gt;
Signed-off-by: Zijun Hu &lt;zijun.hu@oss.qualcomm.com&gt;
Link: https://lore.kernel.org/r/20250714-rfc_miscdev-v6-5-2ed949665bde@oss.qualcomm.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>ipmi: Fix handling of messages with provided receive message pointer</title>
<updated>2025-10-19T14:30:59+00:00</updated>
<author>
<name>Guenter Roeck</name>
<email>linux@roeck-us.net</email>
</author>
<published>2025-10-16T18:50:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ca603d157694a49b2e3aa6579f15faef75e44c93'/>
<id>urn:sha1:ca603d157694a49b2e3aa6579f15faef75e44c93</id>
<content type='text'>
commit e2c69490dda5d4c9f1bfbb2898989c8f3530e354 upstream

Prior to commit b52da4054ee0 ("ipmi: Rework user message limit handling"),
i_ipmi_request() used to increase the user reference counter if the receive
message is provided by the caller of IPMI API functions. This is no longer
the case. However, ipmi_free_recv_msg() is still called and decreases the
reference counter. This results in the reference counter reaching zero,
the user data pointer is released, and all kinds of interesting crashes are
seen.

Fix the problem by increasing user reference counter if the receive message
has been provided by the caller.

Fixes: b52da4054ee0 ("ipmi: Rework user message limit handling")
Reported-by: Eric Dumazet &lt;edumazet@google.com&gt;
Cc: Eric Dumazet &lt;edumazet@google.com&gt;
Cc: Greg Thelen &lt;gthelen@google.com&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Message-ID: &lt;20251006201857.3433837-1-linux@roeck-us.net&gt;
Signed-off-by: Corey Minyard &lt;corey@minyard.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
