Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp1581739lqp; Fri, 22 Mar 2024 23:39:26 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW/1JTVvx/UaMCY8XGmmHazw3GFLN7nFlUj33KK84GPNAl0Cri3/opGq/KlXJA1I+4qHFm8wugCQN2LOd9aeCQRnfCA6Hki2I4kLEvB1w== X-Google-Smtp-Source: AGHT+IHiVTwY+fvNRfMftBaaNGho1Eu6eNZ/YUZ9vab+ar25g0VZqT3Fh7oHKEgB2XbyvSL+DoHG X-Received: by 2002:a05:6512:3119:b0:513:cebb:cf19 with SMTP id n25-20020a056512311900b00513cebbcf19mr974374lfb.53.1711175966545; Fri, 22 Mar 2024 23:39:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711175966; cv=pass; d=google.com; s=arc-20160816; b=lB2LQ3kD+Psh3Wc2l862Awm4Oo/9TyWLYiiZhXxZBFR8wScpygcIf99AaynbM2YJIC id9XdZp4ldTsAgibBTtJXwDpMwXeYrkxD574y3w0de9d+ET9WWMBjuBxl6wUQF5NsyJo G1A37Qauvbl/+0SLeXrtLrAy/VOScIAFtr/arnobfE7nx7BOBiB/A04ukbwhER3OHLm2 Zp3iT2ZnWCdJEPaDzTnZScB29OAbOVn3rk7bal4pEQ7xILht02jSsq1Ijvv57E+VzbJ5 7OW3nvo5wNvPSzuPQ1w7PwoRyOeG4tBRYSoIa2X0MdvumE33m6/SZBDS4jDkAPv8HlYI 7mkA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=5LR+olzTYHKfq9BfttUj+zVd0qL6Duzi/F6K0yHzoT4=; fh=qonjpPKpJnZxHwWPW54NfZBAX8IfRfN5HcxKaXiH39U=; b=laxneWB1uAOvox5FiSCrcrqLgNLCFrqlJDq/EmppzCGBfx5MZnVu7Lf0V2w+NEsPZ9 covy4bq3j/6FKtCk98vetX1WNUNa6xfS+nP/3agayF1q63vey4cgUQNvIIUu298GgQMZ fourPHTZVwxkBDxTEkpsyt8uRgiEBxtNu0ghbRfyyWBf8b2ksFRpkhOdaXO0K6BDL0Y/ o9PLfckPPAEVqCpHng0zhVghhYWbVn6O7rI1xRbP2NJ7dxWrETCbit3tcud++NFqrPU7 flmN7/pvHJn8lL+GUVjIGr0uGWBtHEHG300/IRGfQREdUnfCfQNS8NwCl1cY+5DmGOh0 7WOQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nppct.ru header.s=dkim header.b=XgigSNG0; arc=pass (i=1 spf=pass spfdomain=nppct.ru dkim=pass dkdomain=nppct.ru); spf=pass (google.com: domain of linux-kernel+bounces-112235-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112235-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id bl1-20020a056402210100b00568b5d11acesi554047edb.82.2024.03.22.23.39.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 23:39:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-112235-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@nppct.ru header.s=dkim header.b=XgigSNG0; arc=pass (i=1 spf=pass spfdomain=nppct.ru dkim=pass dkdomain=nppct.ru); spf=pass (google.com: domain of linux-kernel+bounces-112235-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112235-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 445031F23AF7 for ; Sat, 23 Mar 2024 06:39:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A0F948F7A; Sat, 23 Mar 2024 06:39:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nppct.ru header.i=@nppct.ru header.b="XgigSNG0" Received: from mail.nppct.ru (mail.nppct.ru [195.133.245.4]) (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 C41C42107 for ; Sat, 23 Mar 2024 06:39:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.133.245.4 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711175955; cv=none; b=bToIbLFcU1cKS/JdGPJdnU1b9C7uuioRZCQMVTwdRdOi9iaecxZMSmW8SIJQ/QiazI5Di0Ajue9vCBgP2x6HrbCgvgrADaZu4ONnKggZCqekCrFSkeatmoGbxgPQ58PGpgeldV9taSmt/BAihrToPcuxun5ENKxRHRIDQlW0N3U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711175955; c=relaxed/simple; bh=x6jysyZ5oZimszC/+KWYqfqt9dmO+sPqmSEiLu28WpI=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=r6azpCXl9qhIAU8RAjM70ztIZsq1O/hosfZztszXhEB8YQeTMuBz/NH/cPQOTXKAVBbIoVPYsXHDxDfqQMBBwOH2Xp0ci1Bxtfy42PNLgVCzcrUIGzae7K5VohJl8cAMLLxgAykBRApNccHjHP93Pa812Dn6QaC+e2sd141YQEE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nppct.ru; spf=pass smtp.mailfrom=nppct.ru; dkim=pass (1024-bit key) header.d=nppct.ru header.i=@nppct.ru header.b=XgigSNG0; arc=none smtp.client-ip=195.133.245.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nppct.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nppct.ru Received: from mail.nppct.ru (localhost [127.0.0.1]) by mail.nppct.ru (Postfix) with ESMTP id 737621C1444 for ; Sat, 23 Mar 2024 09:39:05 +0300 (MSK) Authentication-Results: mail.nppct.ru (amavisd-new); dkim=pass (1024-bit key) reason="pass (just generated, assumed good)" header.d=nppct.ru DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nppct.ru; h= content-transfer-encoding:mime-version:x-mailer:message-id:date :date:subject:subject:to:from:from; s=dkim; t=1711175944; x= 1712039945; bh=x6jysyZ5oZimszC/+KWYqfqt9dmO+sPqmSEiLu28WpI=; b=X gigSNG0ZKBCrO4NHweiU5rvEX3Uiyfp568itIKXAprXgYWNXex3TL+shzZ3VwF85 +gKXa2adX2h+30jxhcbYLhqEhmUhAelnMHDChnRYsZqaKS3nNfxbqsCZXDX7K0MS 8pNhWuucOXhAjTxPSYwYLkNGnalDf1TzqyjAa3Kpwk= X-Virus-Scanned: Debian amavisd-new at mail.nppct.ru Received: from mail.nppct.ru ([127.0.0.1]) by mail.nppct.ru (mail.nppct.ru [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id jyTZGd427jSd for ; Sat, 23 Mar 2024 09:39:04 +0300 (MSK) Received: from localhost.localdomain (mail.dev-ai-melanoma.ru [185.130.227.204]) by mail.nppct.ru (Postfix) with ESMTPSA id 18C7C1C1401; Sat, 23 Mar 2024 09:39:03 +0300 (MSK) From: Andrey Shumilin To: 3chas3@gmail.com Cc: Andrey Shumilin , linux-atm-general@lists.sourceforge.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org, khoroshilov@ispras.ru, ykarpov@ispras.ru, vmerzlyakov@ispras.ru, vefanov@ispras.ru Subject: [PATCH] iphase: Adding a null pointer check Date: Sat, 23 Mar 2024 09:38:52 +0300 Message-Id: <20240323063852.665639-1-shum.sdl@nppct.ru> X-Mailer: git-send-email 2.30.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The pointer desc_tbl[i].iavcc> is dereferenced on line 195. Further in the code, it is checked for null on line 204. It is proposed to add a check before dereferencing the pointer. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Andrey Shumilin --- drivers/atm/iphase.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c index 324148686953..596422fbfacc 100644 --- a/drivers/atm/iphase.c +++ b/drivers/atm/iphase.c @@ -192,6 +192,11 @@ static u16 get_desc (IADEV *dev, struct ia_vcc *iavcc) { i++; continue; } + if (!(iavcc_r = dev->desc_tbl[i].iavcc)) { + printk("Fatal err, desc table vcc or skb is NULL\n"); + i++; + continue; + } ltimeout = dev->desc_tbl[i].iavcc->ltimeout; delta = jiffies - dev->desc_tbl[i].timestamp; if (delta >= ltimeout) { -- 2.30.2