From: Sam Agazaryan <samagazaryan@google.com>
To: Alexandre Belloni <alexandre.belloni@bootlin.com>,
linux-i3c@lists.infradead.org
Cc: Frank Li <Frank.Li@nxp.com>,
Adrian Hunter <adrian.hunter@intel.com>,
Miquel Raynal <miquel.raynal@bootlin.com>,
Jeremy Kerr <jk@codeconstruct.com.au>,
Joel Stanley <joel@jms.id.au>,
Zbigniew Lukwinski <zbigniew.lukwinski@linux.intel.com>,
Ravindra Yashvant Shinde <ravindra.yashvant.shinde@nxp.com>,
Bart Van Assche <bvanassche@acm.org>,
linux-kernel@vger.kernel.org,
Sam Agazaryan <samagazaryan@google.com>
Subject: [PATCH v2 1/4] i3c: dw: Fix IBI slot leak on oversized payload
Date: Sat, 5 Dec 2026 06:55:49 +0000 [thread overview]
Message-ID: <20261205065552.2594113-2-samagazaryan@google.com> (raw)
In-Reply-To: <20261205065552.2594113-1-samagazaryan@google.com>
dw_i3c_master_handle_ibi_sir() takes a slot from the generic IBI pool
before it checks the payload length. When the payload is longer than
the device driver asked for, it drains the IBI and returns without
giving the slot back. Each such IBI leaks a slot. Once the pool is
empty, every later IBI from that device is dropped, and freeing the
IBI makes i3c_generic_ibi_free_pool() warn about the missing slots.
Return the slot to the pool before draining.
Fixes: e389b1d72a62 ("i3c: dw: Add support for in-band interrupts")
Signed-off-by: Sam Agazaryan <samagazaryan@google.com>
---
Notes:
New in v2. Patch 3 frees a pool only once all its slots are back, so
without this fix the leaked slot would keep the pool allocated.
drivers/i3c/master/dw-i3c-master.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c
index 76875301b5ce..9434d1383033 100644
--- a/drivers/i3c/master/dw-i3c-master.c
+++ b/drivers/i3c/master/dw-i3c-master.c
@@ -1486,6 +1486,7 @@ static void dw_i3c_master_handle_ibi_sir(struct dw_i3c_master *master,
dev_dbg_ratelimited(&master->base.dev,
"IBI payload len %d greater than max %d\n",
len, dev->ibi->max_payload_len);
+ i3c_generic_ibi_recycle_slot(data->ibi_pool, slot);
goto err_drain;
}
--
2.56.1.915.g69d5ec7298-goog
next prev parent reply other threads:[~2026-12-05 6:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-05 6:55 [PATCH v2 0/4] i3c: master: Fix IBI teardown when DAA re-adds a device Sam Agazaryan
2026-12-05 6:55 ` Sam Agazaryan [this message]
2026-12-05 6:55 ` [PATCH v2 2/4] i3c: master: Move generic IBI pool definitions Sam Agazaryan
2026-12-05 6:55 ` [PATCH v2 3/4] i3c: master: Drain IBI slot pool before freeing Sam Agazaryan
2026-12-05 6:55 ` [PATCH v2 4/4] i3c: master: Preserve IBI workqueue across DAA Sam Agazaryan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261205065552.2594113-2-samagazaryan@google.com \
--to=samagazaryan@google.com \
--cc=Frank.Li@nxp.com \
--cc=adrian.hunter@intel.com \
--cc=alexandre.belloni@bootlin.com \
--cc=bvanassche@acm.org \
--cc=jk@codeconstruct.com.au \
--cc=joel@jms.id.au \
--cc=linux-i3c@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miquel.raynal@bootlin.com \
--cc=ravindra.yashvant.shinde@nxp.com \
--cc=zbigniew.lukwinski@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®