<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/char/ipmi, branch linux-6.0.y</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=linux-6.0.y</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=linux-6.0.y'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2023-01-07T10:15:56+00:00</updated>
<entry>
<title>ipmi: fix use after free in _ipmi_destroy_user()</title>
<updated>2023-01-07T10:15:56+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>error27@gmail.com</email>
</author>
<published>2022-11-15T13:17:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f7fde441198a9ecb130c3ccec91ee2131d6998ee'/>
<id>urn:sha1:f7fde441198a9ecb130c3ccec91ee2131d6998ee</id>
<content type='text'>
commit a92ce570c81dc0feaeb12a429b4bc65686d17967 upstream.

The intf_free() function frees the "intf" pointer so we cannot
dereference it again on the next line.

Fixes: cbb79863fc31 ("ipmi: Don't allow device module unload when in use")
Signed-off-by: Dan Carpenter &lt;error27@gmail.com&gt;
Message-Id: &lt;Y3M8xa1drZv4CToE@kili&gt;
Cc: &lt;stable@vger.kernel.org&gt; # 5.5+
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>ipmi: fix long wait in unload when IPMI disconnect</title>
<updated>2023-01-07T10:15:55+00:00</updated>
<author>
<name>Zhang Yuchen</name>
<email>zhangyuchen.lcr@bytedance.com</email>
</author>
<published>2022-10-07T09:26:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=eb2760dd7f3a1e377129d8676d4cd11a3919def9'/>
<id>urn:sha1:eb2760dd7f3a1e377129d8676d4cd11a3919def9</id>
<content type='text'>
commit f6f1234d98cce69578bfac79df147a1f6660596c upstream.

When fixing the problem mentioned in PATCH1, we also found
the following problem:

If the IPMI is disconnected and in the sending process, the
uninstallation driver will be stuck for a long time.

The main problem is that uninstalling the driver waits for curr_msg to
be sent or HOSED. After stopping tasklet, the only place to trigger the
timeout mechanism is the circular poll in shutdown_smi.

The poll function delays 10us and calls smi_event_handler(smi_info,10).
Smi_event_handler deducts 10us from kcs-&gt;ibf_timeout.

But the poll func is followed by schedule_timeout_uninterruptible(1).
The time consumed here is not counted in kcs-&gt;ibf_timeout.

So when 10us is deducted from kcs-&gt;ibf_timeout, at least 1 jiffies has
actually passed. The waiting time has increased by more than a
hundredfold.

Now instead of calling poll(). call smi_event_handler() directly and
calculate the elapsed time.

For verification, you can directly use ebpf to check the kcs-&gt;
ibf_timeout for each call to kcs_event() when IPMI is disconnected.
Decrement at normal rate before unloading. The decrement rate becomes
very slow after unloading.

  $ bpftrace -e 'kprobe:kcs_event {printf("kcs-&gt;ibftimeout : %d\n",
      *(arg0+584));}'

Signed-off-by: Zhang Yuchen &lt;zhangyuchen.lcr@bytedance.com&gt;
Message-Id: &lt;20221007092617.87597-3-zhangyuchen.lcr@bytedance.com&gt;
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>ipmi: fix memleak when unload ipmi driver</title>
<updated>2022-12-31T12:26:42+00:00</updated>
<author>
<name>Zhang Yuchen</name>
<email>zhangyuchen.lcr@bytedance.com</email>
</author>
<published>2022-10-07T09:26:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=bf41eacfd5acec6f25a1ebb3f7abf605668801f7'/>
<id>urn:sha1:bf41eacfd5acec6f25a1ebb3f7abf605668801f7</id>
<content type='text'>
[ Upstream commit 36992eb6b9b83f7f9cdc8e74fb5799d7b52e83e9 ]

After the IPMI disconnect problem, the memory kept rising and we tried
to unload the driver to free the memory. However, only part of the
free memory is recovered after the driver is uninstalled. Using
ebpf to hook free functions, we find that neither ipmi_user nor
ipmi_smi_msg is free, only ipmi_recv_msg is free.

We find that the deliver_smi_err_response call in clean_smi_msgs does
the destroy processing on each message from the xmit_msg queue without
checking the return value and free ipmi_smi_msg.

deliver_smi_err_response is called only at this location. Adding the
free handling has no effect.

To verify, try using ebpf to trace the free function.

  $ bpftrace -e 'kretprobe:ipmi_alloc_recv_msg {printf("alloc rcv
      %p\n",retval);} kprobe:free_recv_msg {printf("free recv %p\n",
      arg0)} kretprobe:ipmi_alloc_smi_msg {printf("alloc smi %p\n",
        retval);} kprobe:free_smi_msg {printf("free smi  %p\n",arg0)}'

Signed-off-by: Zhang Yuchen &lt;zhangyuchen.lcr@bytedance.com&gt;
Message-Id: &lt;20221007092617.87597-4-zhangyuchen.lcr@bytedance.com&gt;
[Fixed the comment above handle_one_recv_msg().]
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>ipmi: kcs: Poll OBF briefly to reduce OBE latency</title>
<updated>2022-12-31T12:25:50+00:00</updated>
<author>
<name>Andrew Jeffery</name>
<email>andrew@aj.id.au</email>
</author>
<published>2022-08-12T14:47:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=76d045f14db031a6c6208170c5c5f808b5cf4298'/>
<id>urn:sha1:76d045f14db031a6c6208170c5c5f808b5cf4298</id>
<content type='text'>
[ Upstream commit f90bc0f97f2b65af233a37b2e32fc81871a1e3cf ]

The ASPEED KCS devices don't provide a BMC-side interrupt for the host
reading the output data register (ODR). The act of the host reading ODR
clears the output buffer full (OBF) flag in the status register (STR),
informing the BMC it can transmit a subsequent byte.

On the BMC side the KCS client must enable the OBE event *and* perform a
subsequent read of STR anyway to avoid races - the polling provides a
window for the host to read ODR if data was freshly written while
minimising BMC-side latency.

Fixes: 28651e6c4237 ("ipmi: kcs_bmc: Allow clients to control KCS IRQ state")
Signed-off-by: Andrew Jeffery &lt;andrew@aj.id.au&gt;
Reviewed-by: Joel Stanley &lt;joel@jms.id.au&gt;
Message-Id: &lt;20220812144741.240315-1-andrew@aj.id.au&gt;
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>ipmi:ipmb: Fix refcount leak in ipmi_ipmb_probe</title>
<updated>2022-05-12T15:00:04+00:00</updated>
<author>
<name>Miaoqian Lin</name>
<email>linmq006@gmail.com</email>
</author>
<published>2022-05-12T04:44:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a508e33956b538e034ed5df619a73ec7c15bda72'/>
<id>urn:sha1:a508e33956b538e034ed5df619a73ec7c15bda72</id>
<content type='text'>
of_parse_phandle() returns a node pointer with refcount
incremented, we should use of_node_put() on it when done.
Add missing of_node_put() to avoid refcount leak.

Fixes: 00d93611f002 ("ipmi:ipmb: Add the ability to have a separate slave and master device")
Signed-off-by: Miaoqian Lin &lt;linmq006@gmail.com&gt;
Message-Id: &lt;20220512044445.3102-1-linmq006@gmail.com&gt;
Cc: stable@vger.kernel.org # v5.17+
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</content>
</entry>
<entry>
<title>ipmi: remove unnecessary type castings</title>
<updated>2022-05-12T15:00:04+00:00</updated>
<author>
<name>Yu Zhe</name>
<email>yuzhe@nfschina.com</email>
</author>
<published>2022-04-21T15:09:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5396ccbd79ab03bd588bcfaa59f58c9bbf9fdcde'/>
<id>urn:sha1:5396ccbd79ab03bd588bcfaa59f58c9bbf9fdcde</id>
<content type='text'>
remove unnecessary void* type castings.

Signed-off-by: Yu Zhe &lt;yuzhe@nfschina.com&gt;
Message-Id: &lt;20220421150941.7659-1-yuzhe@nfschina.com&gt;
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</content>
</entry>
<entry>
<title>ipmi: Make two logs unique</title>
<updated>2022-05-12T15:00:04+00:00</updated>
<author>
<name>Corey Minyard</name>
<email>cminyard@mvista.com</email>
</author>
<published>2022-04-14T16:07:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1016daf218371b4bb7300245d43060e511b60814'/>
<id>urn:sha1:1016daf218371b4bb7300245d43060e511b60814</id>
<content type='text'>
There were two identical logs in two different places, so you couldn't
tell which one was being logged.  Make them unique.

Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</content>
</entry>
<entry>
<title>ipmi:si: Convert pr_debug() to dev_dbg()</title>
<updated>2022-05-12T15:00:04+00:00</updated>
<author>
<name>Corey Minyard</name>
<email>cminyard@mvista.com</email>
</author>
<published>2022-04-13T22:47:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=be8503597c3e20b1d1dfc68b3a8cb99ea4d261ba'/>
<id>urn:sha1:be8503597c3e20b1d1dfc68b3a8cb99ea4d261ba</id>
<content type='text'>
A device is available, use it.

Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</content>
</entry>
<entry>
<title>ipmi: Convert pr_debug() to dev_dbg()</title>
<updated>2022-05-12T15:00:04+00:00</updated>
<author>
<name>Corey Minyard</name>
<email>cminyard@mvista.com</email>
</author>
<published>2022-04-13T22:40:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b2c6941a5cf4a644010c0c9ecb33750e1f7eaf31'/>
<id>urn:sha1:b2c6941a5cf4a644010c0c9ecb33750e1f7eaf31</id>
<content type='text'>
A device is available at all debug points, use the right interface.

Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</content>
</entry>
<entry>
<title>ipmi: Fix pr_fmt to avoid compilation issues</title>
<updated>2022-05-12T15:00:04+00:00</updated>
<author>
<name>Corey Minyard</name>
<email>cminyard@mvista.com</email>
</author>
<published>2022-04-15T12:23:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2ebaf18a0b7fb764bba6c806af99fe868cee93de'/>
<id>urn:sha1:2ebaf18a0b7fb764bba6c806af99fe868cee93de</id>
<content type='text'>
The was it was wouldn't work in some situations, simplify it.  What was
there was unnecessary complexity.

Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
</content>
</entry>
</feed>
