<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/char/ipmi, branch v6.1.87</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.1.87</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.1.87'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2023-09-13T07:43:00+00:00</updated>
<entry>
<title>ipmi_si: fix a memleak in try_smi_init()</title>
<updated>2023-09-13T07:43:00+00:00</updated>
<author>
<name>Yi Yang</name>
<email>yiyang13@huawei.com</email>
</author>
<published>2023-06-29T12:33:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=09cb2a71b2e982015fe0464f28da1ab42b8e6375'/>
<id>urn:sha1:09cb2a71b2e982015fe0464f28da1ab42b8e6375</id>
<content type='text'>
commit 6cf1a126de2992b4efe1c3c4d398f8de4aed6e3f upstream.

Kmemleak reported the following leak info in try_smi_init():

unreferenced object 0xffff00018ecf9400 (size 1024):
  comm "modprobe", pid 2707763, jiffies 4300851415 (age 773.308s)
  backtrace:
    [&lt;000000004ca5b312&gt;] __kmalloc+0x4b8/0x7b0
    [&lt;00000000953b1072&gt;] try_smi_init+0x148/0x5dc [ipmi_si]
    [&lt;000000006460d325&gt;] 0xffff800081b10148
    [&lt;0000000039206ea5&gt;] do_one_initcall+0x64/0x2a4
    [&lt;00000000601399ce&gt;] do_init_module+0x50/0x300
    [&lt;000000003c12ba3c&gt;] load_module+0x7a8/0x9e0
    [&lt;00000000c246fffe&gt;] __se_sys_init_module+0x104/0x180
    [&lt;00000000eea99093&gt;] __arm64_sys_init_module+0x24/0x30
    [&lt;0000000021b1ef87&gt;] el0_svc_common.constprop.0+0x94/0x250
    [&lt;0000000070f4f8b7&gt;] do_el0_svc+0x48/0xe0
    [&lt;000000005a05337f&gt;] el0_svc+0x24/0x3c
    [&lt;000000005eb248d6&gt;] el0_sync_handler+0x160/0x164
    [&lt;0000000030a59039&gt;] el0_sync+0x160/0x180

The problem was that when an error occurred before handlers registration
and after allocating `new_smi-&gt;si_sm`, the variable wouldn't be freed in
the error handling afterwards since `shutdown_smi()` hadn't been
registered yet. Fix it by adding a `kfree()` in the error handling path
in `try_smi_init()`.

Cc: stable@vger.kernel.org # 4.19+
Fixes: 7960f18a5647 ("ipmi_si: Convert over to a shutdown handler")
Signed-off-by: Yi Yang &lt;yiyang13@huawei.com&gt;
Co-developed-by: GONG, Ruiqi &lt;gongruiqi@huaweicloud.com&gt;
Signed-off-by: GONG, Ruiqi &lt;gongruiqi@huaweicloud.com&gt;
Message-Id: &lt;20230629123328.2402075-1-gongruiqi@huaweicloud.com&gt;
Signed-off-by: Corey Minyard &lt;minyard@acm.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>ipmi:ssif: Fix a memory leak when scanning for an adapter</title>
<updated>2023-09-13T07:42:44+00:00</updated>
<author>
<name>Corey Minyard</name>
<email>minyard@acm.org</email>
</author>
<published>2023-06-19T16:43:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=74a1194cce60a90723d0fe148863c18931a31153'/>
<id>urn:sha1:74a1194cce60a90723d0fe148863c18931a31153</id>
<content type='text'>
[ Upstream commit b8d72e32e1453d37ee5c8a219f24e7eeadc471ef ]

The adapter scan ssif_info_find() sets info-&gt;adapter_name if the adapter
info came from SMBIOS, as it's not set in that case.  However, this
function can be called more than once, and it will leak the adapter name
if it had already been set.  So check for NULL before setting it.

Fixes: c4436c9149c5 ("ipmi_ssif: avoid registering duplicate ssif interface")
Signed-off-by: Corey Minyard &lt;minyard@acm.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>ipmi:ssif: Add check for kstrdup</title>
<updated>2023-09-13T07:42:44+00:00</updated>
<author>
<name>Jiasheng Jiang</name>
<email>jiasheng@iscas.ac.cn</email>
</author>
<published>2023-06-19T09:28:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2e7d90a81b9cee4103d2c2bb9b6be60fae74806a'/>
<id>urn:sha1:2e7d90a81b9cee4103d2c2bb9b6be60fae74806a</id>
<content type='text'>
[ Upstream commit c5586d0f711e9744d0cade39b0c4a2d116a333ca ]

Add check for the return value of kstrdup() and return the error
if it fails in order to avoid NULL pointer dereference.

Fixes: c4436c9149c5 ("ipmi_ssif: avoid registering duplicate ssif interface")
Signed-off-by: Jiasheng Jiang &lt;jiasheng@iscas.ac.cn&gt;
Message-Id: &lt;20230619092802.35384-1-jiasheng@iscas.ac.cn&gt;
Signed-off-by: Corey Minyard &lt;minyard@acm.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>ipmi: ASPEED_BT_IPMI_BMC: select REGMAP_MMIO instead of depending on it</title>
<updated>2023-05-11T14:03:26+00:00</updated>
<author>
<name>Randy Dunlap</name>
<email>rdunlap@infradead.org</email>
</author>
<published>2023-02-26T05:39:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5eb0e23ab05ec5217e49a2918910e1537fc96975'/>
<id>urn:sha1:5eb0e23ab05ec5217e49a2918910e1537fc96975</id>
<content type='text'>
[ Upstream commit 2a587b9ad052e7e92e508aea90c1e2ae433c1908 ]

REGMAP is a hidden (not user visible) symbol. Users cannot set it
directly thru "make *config", so drivers should select it instead of
depending on it if they need it.

Consistently using "select" or "depends on" can also help reduce
Kconfig circular dependency issues.

Therefore, change the use of "depends on REGMAP_MMIO" to
"select REGMAP_MMIO", which will also set REGMAP.

Fixes: eb994594bc22 ("ipmi: bt-bmc: Use a regmap for register access")
Signed-off-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Cc: Andrew Jeffery &lt;andrew@aj.id.au&gt;
Cc: Corey Minyard &lt;minyard@acm.org&gt;
Cc: openipmi-developer@lists.sourceforge.net
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Message-Id: &lt;20230226053953.4681-2-rdunlap@infradead.org&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: fix SSIF not responding under certain cond.</title>
<updated>2023-05-11T14:03:01+00:00</updated>
<author>
<name>Zhang Yuchen</name>
<email>zhangyuchen.lcr@bytedance.com</email>
</author>
<published>2023-04-12T07:49:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=44847a506e714ba19ffdf50f88c25c77ed76f8b5'/>
<id>urn:sha1:44847a506e714ba19ffdf50f88c25c77ed76f8b5</id>
<content type='text'>
commit 6d2555cde2918409b0331560e66f84a0ad4849c6 upstream.

The ipmi communication is not restored after a specific version of BMC is
upgraded on our server.
The ipmi driver does not respond after printing the following log:

    ipmi_ssif: Invalid response getting flags: 1c 1

I found that after entering this branch, ssif_info-&gt;ssif_state always
holds SSIF_GETTING_FLAGS and never return to IDLE.

As a result, the driver cannot be loaded, because the driver status is
checked during the unload process and must be IDLE in shutdown_ssif():

        while (ssif_info-&gt;ssif_state != SSIF_IDLE)
                schedule_timeout(1);

The process trigger this problem is:

1. One msg timeout and next msg start send, and call
ssif_set_need_watch().

2. ssif_set_need_watch()-&gt;watch_timeout()-&gt;start_flag_fetch() change
ssif_state to SSIF_GETTING_FLAGS.

3. In msg_done_handler() ssif_state == SSIF_GETTING_FLAGS, if an error
message is received, the second branch does not modify the ssif_state.

4. All retry action need IS_SSIF_IDLE() == True. Include retry action in
watch_timeout(), msg_done_handler(). Sending msg does not work either.
SSIF_IDLE is also checked in start_next_msg().

5. The only thing that can be triggered in the SSIF driver is
watch_timeout(), after destory_user(), this timer will stop too.

So, if enter this branch, the ssif_state will remain SSIF_GETTING_FLAGS
and can't send msg, no timer started, can't unload.

We did a comparative test before and after adding this patch, and the
result is effective.

Fixes: 259307074bfc ("ipmi: Add SMBus interface driver (SSIF)")

Cc: stable@vger.kernel.org
Signed-off-by: Zhang Yuchen &lt;zhangyuchen.lcr@bytedance.com&gt;
Message-Id: &lt;20230412074907.80046-1-zhangyuchen.lcr@bytedance.com&gt;
Signed-off-by: Corey Minyard &lt;minyard@acm.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>ipmi:ssif: Add send_retries increment</title>
<updated>2023-05-11T14:03:01+00:00</updated>
<author>
<name>Corey Minyard</name>
<email>minyard@acm.org</email>
</author>
<published>2023-04-04T12:09:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=aeff5808f172293792241a00b130347a4fb608b6'/>
<id>urn:sha1:aeff5808f172293792241a00b130347a4fb608b6</id>
<content type='text'>
commit 6ce7995a43febe693d4894033c6e29314970646a upstream.

A recent change removed an increment of send_retries, re-add it.

Fixes: 95767ed78a18 ipmi:ssif: resend_msg() cannot fail
Reported-by: Pavel Machek &lt;pavel@denx.de&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Corey Minyard &lt;minyard@acm.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>ipmi:ssif: Add a timer between request retries</title>
<updated>2023-03-17T07:50:20+00:00</updated>
<author>
<name>Corey Minyard</name>
<email>cminyard@mvista.com</email>
</author>
<published>2023-01-25T16:34:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9858e0fb32b691b0c472d334a7b39081be09ccad'/>
<id>urn:sha1:9858e0fb32b691b0c472d334a7b39081be09ccad</id>
<content type='text'>
[ Upstream commit 00bb7e763ec9f384cb382455cb6ba5588b5375cf ]

The IPMI spec has a time (T6) specified between request retries.  Add
the handling for that.

Reported by: Tony Camuso &lt;tcamuso@redhat.com&gt;
Cc: stable@vger.kernel.org
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:ssif: Increase the message retry time</title>
<updated>2023-03-17T07:50:20+00:00</updated>
<author>
<name>Corey Minyard</name>
<email>cminyard@mvista.com</email>
</author>
<published>2022-11-03T20:03:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8a676b6eb2d5b29aa8b860153054135fa82aae84'/>
<id>urn:sha1:8a676b6eb2d5b29aa8b860153054135fa82aae84</id>
<content type='text'>
[ Upstream commit 39721d62bbc16ebc9bb2bdc2c163658f33da3b0b ]

The spec states that the minimum message retry time is 60ms, but it was
set to 20ms.  Correct it.

Reported by: Tony Camuso &lt;tcamuso@redhat.com&gt;
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
Stable-dep-of: 00bb7e763ec9 ("ipmi:ssif: Add a timer between request retries")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>ipmi:ssif: Remove rtc_us_timer</title>
<updated>2023-03-17T07:50:19+00:00</updated>
<author>
<name>Corey Minyard</name>
<email>cminyard@mvista.com</email>
</author>
<published>2023-01-25T16:41:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f12869ff7643faf7842b2841423e8596fdfe03e2'/>
<id>urn:sha1:f12869ff7643faf7842b2841423e8596fdfe03e2</id>
<content type='text'>
[ Upstream commit 9e8b89926fb87e5625bdde6fd5de2c31fb1d83bf ]

It was cruft left over from older handling of run to completion.

Cc: stable@vger.kernel.org
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_ssif: Rename idle state and check</title>
<updated>2023-03-10T08:34:03+00:00</updated>
<author>
<name>Corey Minyard</name>
<email>cminyard@mvista.com</email>
</author>
<published>2023-01-25T16:13:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=fe0d40baa4ed548cbfc2c510cffd3c34417fec35'/>
<id>urn:sha1:fe0d40baa4ed548cbfc2c510cffd3c34417fec35</id>
<content type='text'>
commit 8230831c43a328c2be6d28c65d3f77e14c59986b upstream.

Rename the SSIF_IDLE() to IS_SSIF_IDLE(), since that is more clear, and
rename SSIF_NORMAL to SSIF_IDLE, since that's more accurate.

Cc: stable@vger.kernel.org
Signed-off-by: Corey Minyard &lt;cminyard@mvista.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
