From patchwork Wed Jan 26 17:34:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jitendra Lanka X-Patchwork-Id: 1584817 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Jkrwh5Wg0z9tk5 for ; Thu, 27 Jan 2022 17:56:36 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1nCyho-0002gV-Ao; Thu, 27 Jan 2022 06:56:28 +0000 Received: from mail-il-dmz.mellanox.com ([193.47.165.129] helo=mellanox.co.il) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1nCmCi-0000oL-0U for kernel-team@lists.ubuntu.com; Wed, 26 Jan 2022 17:35:32 +0000 Received: from Internal Mail-Server by MTLPINE1 (envelope-from jlanka@mellanox.com) with SMTP; 26 Jan 2022 19:35:29 +0200 Received: from farm-1.mtbu.labs.mlnx (farm-1.mtbu.labs.mlnx [10.15.2.31]) by mtbu-labmailer.labs.mlnx (8.14.4/8.14.4) with ESMTP id 20QHZPD5003100; Wed, 26 Jan 2022 12:35:26 -0500 Received: (from jlanka@localhost) by farm-1.mtbu.labs.mlnx (8.14.7/8.13.8/Submit) id 20QHZP1w029372; Wed, 26 Jan 2022 12:35:25 -0500 From: Jitendra Lanka To: kernel-team@lists.ubuntu.com Subject: [SRU][F:linux-bluefield][PATCH v1 0/1] UBUNTU: SAUCE: Fix references to sprintf that may cause buffer overflow Date: Wed, 26 Jan 2022 12:34:39 -0500 Message-Id: X-Mailer: git-send-email 2.30.1 MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 27 Jan 2022 06:56:27 +0000 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jitendra Lanka Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1959119 SRU Justification: [Impact] Fix references to sprintf that have a possibility for buffer overflow [Fix] Replace sprintf with snprintf containing a defined boundary of PAGE_SIZE for sysfs store/show functions and max array size defined otherwise. [Test Case] Existing testcases should work as is as no functional change has been introduced by this patch. [Regression Potential] Regression potential can be considered minimal since the patch does not change any function of the driver other than limiting the upper bound of sprintf where the usual lengths parsed are < PAGE_SIZE and requests > PAGE_SIZE are limited. Jitendra Lanka (1): Fix references to sprintf that may cause buffer overflow drivers/platform/mellanox/mlxbf-pmc.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)