Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp60782lqt; Wed, 5 Jun 2024 17:25:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUa1XMNbEbDGoUVJqtSi+Qb8JnDGQ0bIiy5hAW+Kp1qQgjOvzzL3mMlZ3iWc/YfbKd9046PMH6tEMFzkaRb6HPYBEZ7mj3OfHe/KHy+JA== X-Google-Smtp-Source: AGHT+IFdghaGKMChYUslyq4nyWqSOdFEMTph5rLLeKItNKCtpNDXgND1LZ2iUoR0eKu/zwOo7Mdi X-Received: by 2002:a17:906:f844:b0:a68:ce03:8655 with SMTP id a640c23a62f3a-a699fab8af5mr252752166b.4.1717633529712; Wed, 05 Jun 2024 17:25:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717633529; cv=pass; d=google.com; s=arc-20160816; b=BlHYZYg+0gZv8LqGUFjWghxMx59RlHxD/ZuO2Xdx3OqcZ/VX8c6/sHrblVsTdgB+N4 fnQ0/yLsv9wWluxcrUn+i+lnGtEhL629x+/daM0V/CLUdP+kRq03AwBF1b77YuPEtnMB 8c7dKfPDIEWbJgkWd/AOFmTNFWI0l+FmTc87QQ4TnbiEuLZjC+GjtXYX8s0cyRG2Nh5S xEOP/YvcJH4FDy6d2r4yTm7jieAhU27PI7LemnuZUSQIkpcERiN1zO57ORVd47lgNU1F 8IvkrVJVc2nojQV+4h7QGtGgEcKs8uAyAAiszOrukIxr73pkWtruVwIQNzU0YICGAsAT vgzQ== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=1Ww9Rdq98RgqCia4UdhAvlzFlQ7oc3WmT+CLtqus8As=; fh=qLVt0nE7/qeDfJlo+H0zaCeMONw4CSMFYfRBIdW3+yI=; b=eiJgGnNd4pkn03e3J7Vbuk6E4Ga8T1tOnbXN5hWG9Yh7Z1FQldmPgRnMxFd82eZfPj sJE0sdzCo2170V7SbVo1n9xTnz0Tb2ff9744mTUrZ0uccbxcjuytNf+tTgKjyqvDEhe2 GvydXhHjEHlh0xCUbarwu8J2qRGi8FXGdD2lsFIgGdr6qrS7Y9SFiaWsjrpLNjJfHU4F IQz+HagJ67l5m5gDG402PTVnSw6D21x+R91IY5yxXjxFH44taRUm8gBrniZxSq5jRETj PDyZUFZnnEHnT/gA2fOtrsa/J5eEV0395pT565mhS/GbOUwaeHAhSE7etnGX8FIlus4S s35w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=XXAxGoeQ; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel+bounces-203449-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203449-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=oracle.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6c807494acsi7347666b.1001.2024.06.05.17.25.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 17:25:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-203449-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=XXAxGoeQ; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel+bounces-203449-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-203449-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=oracle.com 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 2FBB91F23E49 for ; Thu, 6 Jun 2024 00:25:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0BFA08BE5; Thu, 6 Jun 2024 00:25:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="XXAxGoeQ" Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (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 4B2AF2563; Thu, 6 Jun 2024 00:25:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.165.32 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717633519; cv=none; b=SKnF/45GtFWDQfGOqLi5NPfOoZnuPmldHAgB0NVlxcB+NVzAm6q33zStcS+6ipedTUIBo1a81SeMP9hCSRzMTFXOQo436BnQ2fnrj+WTsvGN6asGhN9jRpkaHh8DE6bcConQlI+qyi1OWAwN7NFWhsoBf9xXHxYjs6qx8FE32Mg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717633519; c=relaxed/simple; bh=3wZVavp6tao9ffC1YphaeS9zPVgycL7M4c8WdP2SgWA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=dumPdWXo4Uxi0lHZV6UR74bdgmERBrPsPBMPpQC2HxmPDccMobzUf8CDv+XqBGk2MYh4IDQtlTCBqB0VppQMHCh/BA9QgEQO3AgExq845CzoidcZvZRteUtmdcK1x0YSn7ug0vfZy7ogTCV110C++DSVv6A7GM5QhH9IPFBzxJA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=XXAxGoeQ; arc=none smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 455JINiP015747; Thu, 6 Jun 2024 00:24:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc : content-transfer-encoding : content-type : date : from : in-reply-to : message-id : mime-version : references : subject : to; s=corp-2023-11-20; bh=1Ww9Rdq98RgqCia4UdhAvlzFlQ7oc3WmT+CLtqus8As=; b=XXAxGoeQxY1ylnW621TgDu2TX7CRHbPEikIp5gxSzri56vfRkviA+lFrcCmVYmJ5Fh1g ov1BQ7xKbLgZtktlOzKlAhqbx6hnVjt9Fe+PFHIZIoDO0qfJjBh2v9E53rzg2BpPBbH4 LUcxtvf2QdhtaAXTsMX9etjK4/fOfzld5hcjrkf9n9KXZQAisrl2FvClCaX+62OqqBTS VkUwpIYZhttx43q6+WByP3EzU8g3NzCaB2QMVZ5xjJGN9+ZbTlhXU+5xofK66MkDl+tV pMMBTr0rEQukzrNEt+Ywjla4O03Ct3+Qd5KyJcR+TRBTn4s/aOoRoY0zY8RvDXeQ0ttS 3Q== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3yjbsyaf9w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 06 Jun 2024 00:24:59 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 455Mat8Y015719; Thu, 6 Jun 2024 00:24:58 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3ygrjeg0qq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 06 Jun 2024 00:24:58 +0000 Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 4560OwH0004414; Thu, 6 Jun 2024 00:24:58 GMT Received: from ca-mkp2.ca.oracle.com.com (mpeterse-ol9.allregionaliads.osdevelopmeniad.oraclevcn.com [100.100.251.135]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 3ygrjeg0py-1; Thu, 06 Jun 2024 00:24:57 +0000 From: "Martin K. Petersen" To: Sathya Prakash , Sreekanth Reddy , Suganath Prabu Subramani , "James E.J. Bottomley" , Chaitra P B , Breno Leitao Cc: "Martin K . Petersen" , leit@meta.com, stable@vger.kernel.org, Keith Busch , MPT-FusionLinux.pdl@broadcom.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] mpt3sas: Avoid test/set_bit() operating in non-allocated memory Date: Wed, 5 Jun 2024 20:24:19 -0400 Message-ID: <171763343411.4164272.12258794227278624618.b4-ty@oracle.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240605085530.499432-1-leitao@debian.org> References: <20240605085530.499432-1-leitao@debian.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-05_02,2024-06-05_02,2024-05-17_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=586 phishscore=0 adultscore=0 bulkscore=0 spamscore=0 malwarescore=0 mlxscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2406060001 X-Proofpoint-GUID: HNWNmYom_xalhO768Wrbf1PkPwmQ6GyN X-Proofpoint-ORIG-GUID: HNWNmYom_xalhO768Wrbf1PkPwmQ6GyN On Wed, 05 Jun 2024 01:55:29 -0700, Breno Leitao wrote: > There is a potential out-of-bounds access when using test_bit() on a > single word. The test_bit() and set_bit() functions operate on long > values, and when testing or setting a single word, they can exceed the > word boundary. KASAN detects this issue and produces a dump: > > BUG: KASAN: slab-out-of-bounds in _scsih_add_device.constprop.0 (./arch/x86/include/asm/bitops.h:60 ./include/asm-generic/bitops/instrumented-atomic.h:29 drivers/scsi/mpt3sas/mpt3sas_scsih.c:7331) mpt3sas > > [...] Applied to 6.10/scsi-fixes, thanks! [1/1] mpt3sas: Avoid test/set_bit() operating in non-allocated memory https://git.kernel.org/mkp/scsi/c/4254dfeda82f -- Martin K. Petersen Oracle Linux Engineering