From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1DCA7280CFB; Mon, 13 Apr 2026 16:42:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776098541; cv=none; b=Wqna5JdETP/K731fDchABWuwoURksIsEEOtVMc2oFnMvddG8RoMr4eGdgUh8/GARFCKn06Nl3fviu6IOkexjn2oQJD4TsIpOSu9kZ4CFNirMrWquAKvu7uR5STNkMh9ap6ErUnaA/i41WZQR3MYY5zYEf20Fy5ZON77GICK61FA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776098541; c=relaxed/simple; bh=8/wnXcGSxHV3qHvV/Vjt6h5+xlOvHef+k/PQscWPWWU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Zt3jCVRZYMY6f3uR5BC9iMd6BX4nhkUmR4JkMZOeDJLzbeS1Zr6KFDontOf0V0Ys+PkQMYgMlSvOCc5b6EVdwVt10dHhVyY0YGiPZqQLb8MeN8tcJ8JqyAI+FlwBp0KjNJqH/m1/7Pr16jpd73uJOTBrkP3ChQnYJjxdquNjRTc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=e4SX2QCP; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="e4SX2QCP" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63191C2BCAF; Mon, 13 Apr 2026 16:42:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1776098540; bh=8/wnXcGSxHV3qHvV/Vjt6h5+xlOvHef+k/PQscWPWWU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e4SX2QCPhWAfi80RaT+dC3HiDKVUpSqN//WT0Qc+hl+BGijpP8z5ZQhqyVJsmkLIG tz92U8TwYPI0Do1/4J+wHd8wSECfJkDonD1OyKS+BHcODZLwO0Srb7XNaelF/PJ+rx eINhU50CXRhfmyxvNZ7xpM8kJLy2fR3GJWtbLDvI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, =?UTF-8?q?Bence=20Cs=C3=B3k=C3=A1s?= , Johan Hovold , Andi Shyti , Sasha Levin Subject: [PATCH 5.15 564/570] i2c: cp2615: fix serial string NULL-deref at probe Date: Mon, 13 Apr 2026 18:01:35 +0200 Message-ID: <20260413155851.603022991@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260413155830.386096114@linuxfoundation.org> References: <20260413155830.386096114@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Johan Hovold [ Upstream commit aa79f996eb41e95aed85a1bd7f56bcd6a3842008 ] The cp2615 driver uses the USB device serial string as the i2c adapter name but does not make sure that the string exists. Verify that the device has a serial number before accessing it to avoid triggering a NULL-pointer dereference (e.g. with malicious devices). Fixes: 4a7695429ead ("i2c: cp2615: add i2c driver for Silicon Labs' CP2615 Digital Audio Bridge") Cc: stable@vger.kernel.org # 5.13 Cc: Bence Csókás Signed-off-by: Johan Hovold Reviewed-by: Bence Csókás Signed-off-by: Andi Shyti Link: https://lore.kernel.org/r/20260309075016.25612-1-johan@kernel.org Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/i2c/busses/i2c-cp2615.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/i2c/busses/i2c-cp2615.c +++ b/drivers/i2c/busses/i2c-cp2615.c @@ -298,6 +298,9 @@ cp2615_i2c_probe(struct usb_interface *u if (!adap) return -ENOMEM; + if (!usbdev->serial) + return -EINVAL; + strscpy(adap->name, usbdev->serial, sizeof(adap->name)); adap->owner = THIS_MODULE; adap->dev.parent = &usbif->dev;