Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp5374239rwp; Mon, 17 Jul 2023 03:03:12 -0700 (PDT) X-Google-Smtp-Source: APBJJlGfRaPIj518NoX7YZV769F8+jnpSdi3aszR+cTkeIeoCb2itgVtIh8fguXWgecMh+WCCXFg X-Received: by 2002:a05:6a20:734d:b0:134:2e3c:9845 with SMTP id v13-20020a056a20734d00b001342e3c9845mr6803428pzc.22.1689588191801; Mon, 17 Jul 2023 03:03:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1689588191; cv=pass; d=google.com; s=arc-20160816; b=MHJjqfwMtHsYvUixedutpEYz5iu983PzFsoKe6hgD+ozGnhrSGw+hjFbBFN0C/erB7 EaN8nHZmZv1qqKskqixyvwz39haZSlGhd/bYK85ytYwfRyJuR/bMAmX6cv/zi1YS1jfy hx2JcUgPrtrAjhkVJUWPxEN8tXgismdlJsfXN8/z8B9m6dQohQUGAi6wsgZqLKn5JPWa 55/hIfCre9axyRoTVehRMMVBLWe5wVWdL7LbTNalo/3WSRxcoKqAzPpSjBx+I92VE7TO v6ehN2qW8gpnnPmNa2c5Wte760J0E1AUVDYBebG6C+6oJASIe8+re81VULO9DyBOnpyr cGmA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=aT+EmTIM5+5KB0FEDiM153IWWv3fGKE5EhSv3s7zMOo=; fh=ds0Z6ayL4xapsneAhKDRH5WTMZ16akCu9tpGtq8I/nY=; b=zowGP1HFeS6vDqgKkrwarokL0uzuO/MCo2439RLz/Eq3DjoNbfPEl6ShdAhCGlcmNA QH9cQRfId8mWjBK/QKeplBASiuSV9aBmgG/NBVwDVl0Tzc0udX7LgWC22PRcGtXPz2lO SsKf6yoef4KVK5FVlh2UBpO/qJ8mBknkm5yNth55UuiFN8HJ03DrwETZAdxgB3qn93+n R+RjMfvVHuRdd1xDhnPwbNORk6PgctAepf7QNDjkYe51edxr2bzsBM/s8mMlGtiEtQaF 2XLLQHaVzTZ+MmZPe1w3Pd2S40jBiE3c5N4rm9GTzCcukssdZQJaq4xmHtN/sOXEmNN+ N3Aw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=BhiRjYd1; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x2-20020a056a00270200b0068219eb27aesi11018989pfv.182.2023.07.17.03.02.59; Mon, 17 Jul 2023 03:03:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=BhiRjYd1; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230313AbjGQJ1R (ORCPT + 99 others); Mon, 17 Jul 2023 05:27:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229696AbjGQJ1L (ORCPT ); Mon, 17 Jul 2023 05:27:11 -0400 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2092.outbound.protection.outlook.com [40.107.255.92]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7242A123; Mon, 17 Jul 2023 02:27:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q3cuiwpnJd+vt/widWhUzA/8nSK6zW2+nkxYHoPOSIGW6Pnrck9fXeM/94GQn9EGm/ftayeqOLVX/+T2sugdM3Uf5O7DYalDefzR7IZTJQNGaAJuKpQAQY/gK4cka3mrSjCjZqRLZMSUpyUMQ6jSCY/cnxEoUN07rZRmxb27LJKAag8i4TsFUZILlPSbsZyznz1aD1BGlXXhQE3kWjbZAqb5Qj91gfO2+eVrtP7AIA3SdL5au3VWfLeiZsosH2bkW724D8BU1+iakr7rMg9Tom3ykziz+kE4YB5L9E/xY8AMmv3mTkfSxXHqI4GiYZmruTC7gHsPjTDHQX4P5kwVEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=aT+EmTIM5+5KB0FEDiM153IWWv3fGKE5EhSv3s7zMOo=; b=ORTIEasmnkwkzTCoJP1OBCfLMtHfKG4fh1imJuxrLJeAzZDleth7+sN4snkEXTsQH1hxyh9hGdk2lIxQtqwDt/LEOYaNAMjxDBZABFBfduima4jvlGU3TQJsYa5StbkdR2UFYLGrXVEGdHiTok4SHjej//oCF4RICPc2/WqxPja9IMjie3orb6r/y5YjeDnH9HSARlnzNT8vxun5hcYIauic4RXlLS0NXkY5+EcXNRdlnKByF7RQBVG6QpxT+krwDejGLt4RAOYkXD0yIyB3WyBesaAfxvEcs2ljMdKu9zBxC50UpVlg8DCEHB/RRq+5W2izA7vAei8K1fnRIBCc3g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aT+EmTIM5+5KB0FEDiM153IWWv3fGKE5EhSv3s7zMOo=; b=BhiRjYd1j/piTIkPiA3MB4gYmPL57CBVu3+Os89NhROMk8AanGFy/YbgIK8fSb8GIx8t7JnOFm1VBWlXtcGhYVAkcWqHNZtaALNB6eu5Z/uHsxdIvTQkI7i2nE0oe+xEOo+gIPwmyGZSWuv2cYFaHLaqem8ulk/HFX+Ukd9WlvEV2chHweSXhk2RJoCbJpkmRdloq4bTX5tG9QlrTMgPgMNs8yQ2KVNXW3Ko4W3V2v0VCl7g6Y7YaQ54Nf7jmWc2AWusS68aXhoOZrSgG9btaACiVbQoGcXICKj1+k7rU4vORjB7wPbZyxofJNdzO0BwUbUHCPxEof3m6ndVfROVqA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SG2PR06MB5288.apcprd06.prod.outlook.com (2603:1096:4:1dc::9) by KL1PR06MB6273.apcprd06.prod.outlook.com (2603:1096:820:ec::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Mon, 17 Jul 2023 09:27:05 +0000 Received: from SG2PR06MB5288.apcprd06.prod.outlook.com ([fe80::f9b8:80b5:844e:f49a]) by SG2PR06MB5288.apcprd06.prod.outlook.com ([fe80::f9b8:80b5:844e:f49a%6]) with mapi id 15.20.6565.037; Mon, 17 Jul 2023 09:27:05 +0000 From: Minjie Du To: Lee Duncan , Chris Leech , Mike Christie , "James E.J. Bottomley" , "Martin K. Petersen" , open-iscsi@googlegroups.com (open list:ISCSI), linux-scsi@vger.kernel.org (open list:ISCSI), linux-kernel@vger.kernel.org (open list) Cc: opensource.kernel@vivo.com, Minjie Du Subject: [PATCH v1] scsi: iscsi: use kfree_sensitive() in iscsi_session_free() Date: Mon, 17 Jul 2023 17:26:57 +0800 Message-Id: <20230717092657.9776-1-duminjie@vivo.com> X-Mailer: git-send-email 2.39.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR04CA0157.apcprd04.prod.outlook.com (2603:1096:4::19) To SG2PR06MB5288.apcprd06.prod.outlook.com (2603:1096:4:1dc::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SG2PR06MB5288:EE_|KL1PR06MB6273:EE_ X-MS-Office365-Filtering-Correlation-Id: fb03584b-2a78-4ee0-6032-08db86a7fc19 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GgHQy3vRPACvtrKFUsa52fhRz5iNIbRNErHoha47gRIs+wZRGE84F0Zzy51FV7Y2oAGNKGSt4DfFv7MPEAIbN2iYETvuyuglb8dm4iub4D953FkhWhMgOCR0D9Dro2D9SIFHweAwZj281VPxJgdFeW0AERELR4Xx1xbdD0PHzGm5UBKs3oDhY/0fbSsQOLdjyAwUIePiPMRIhp2/jgNGqytGxcEvHvtbT5A4/OYvIG1RePeZVHGaf0IC0jPd6fthFcAyem4pzYjiV8FUaqi/S6rTJYqvu6xVT/jmljcu6nc2LkfoiJfxfzq29abN/YOoVIl1OxNEbFsGGPL3Q4FPjmqsY4cDvtKikGsB/MCpbXqBX988A+L3UiH/0rSMBYtvGP9ABwj0CjdUQpmMd6VcAnX+ULs7rC05tJk2HR6BH/lb5BMEdaTRgxf/Z6si9r839IZrZ/YeKE/hTCQde3+ECabywOEx6VPAceDn1ROsB/R0A1VTSW2dfKUOpRoZA+tazfcHqRAqyebpgryT3tetKdoUY1nlIa1MVtxVmHFjMvSkPtlft9C0goYrDB0Lzl0L4i7UdNUEQGyXON0YUxgfLbQPkLSVetwmEzkVSNpeK4qWtZFu/rWS/UB3GwUt10xo X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SG2PR06MB5288.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(376002)(366004)(396003)(136003)(346002)(451199021)(83380400001)(52116002)(478600001)(4744005)(186003)(2616005)(86362001)(6486002)(26005)(1076003)(6506007)(6512007)(107886003)(66556008)(66946007)(38350700002)(38100700002)(110136005)(41300700001)(2906002)(36756003)(6666004)(4326008)(8676002)(316002)(5660300002)(8936002)(66476007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?8G7M/CcFAo+OqYUWsmBMaftxmUh0NAAHdgTTePgeKettQQVRKlxSpvxiWYMX?= =?us-ascii?Q?jhOzrag9evS4j+EflIM0U5zz2+3CkI+s5OC7aUpfMng34Tz+bVnYNvBrm3vs?= =?us-ascii?Q?UdVnMYJvy5qMo546NoOs16/xdDwiVr3H3IDo1pYqZrxGRYfjPxkcFXL6schn?= =?us-ascii?Q?1x2mbw0qhgJddn/WDbFKZfT8llaM73ozMku9zeiuLoM5sWhauwaCu7moWOmt?= =?us-ascii?Q?jY/yK9Rjk+1aTvxiDNsEhTHO891Fx0kWmsavbcoEkbDwCOSHdwNB1Nx0sQve?= =?us-ascii?Q?5BaJNS+YLOdQ6IGFNP1TSnNc7f3zry8yAtelC5m/sgnyK/EtkEuDte5XhL38?= =?us-ascii?Q?pGvdufgdelFVUR5zcQOzSr43oWKI59Kc2yK6+oreAYwcwPGhpUxdXpA97O96?= =?us-ascii?Q?kkRwBrf3kQjY63pgVOhfxbRF0aqWOJ2YpbQ4mfFJHTL6/uCFAoF2ZfGubsiq?= =?us-ascii?Q?E6hkc1R/sf0SD6CmZp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ljta+g0Xz?= =?us-ascii?Q?FMhc4J8znXjqE3KtKB7b6Rv9wgiwfHg6D6WQSWo1u0mXDYvGf6XqMqzlEIwJ?= =?us-ascii?Q?8lh4LEko0j0PcjEpnErV+ksRohDYN0Q/CNOiRVnl5ZbYDiTuKhaWGU1sVsjP?= =?us-ascii?Q?kHe+bg3DMDNE2smyCyr2EFzlkjcSj2aWyQsm+XPvbPCSeaChluYIa8/neqZD?= =?us-ascii?Q?fKI6O1vKulsO4ewQ0LU5rjF1HRprexLq4DVFkiO7?= X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: fb03584b-2a78-4ee0-6032-08db86a7fc19 X-MS-Exchange-CrossTenant-AuthSource: SG2PR06MB5288.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2023 09:27:05.1592 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: mqE/vQJCy/ezDQTEwfPlGAq9H0zKl+BMWmf7hADfo0vqeJ7SOqo9l2zzxNih0ABcM9Bp9fcBZPdAe72O9kGBdQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR06MB6273 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org session might contain private part of the password, so better use kfree_sensitive() to free it. In iscsi_session_free() use kfree_sensitive() to free session->password. Signed-off-by: Minjie Du --- drivers/scsi/libiscsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c index 0fda8905e..2f273229c 100644 --- a/drivers/scsi/libiscsi.c +++ b/drivers/scsi/libiscsi.c @@ -3132,7 +3132,7 @@ void iscsi_session_free(struct iscsi_cls_session *cls_session) struct module *owner = cls_session->transport->owner; iscsi_pool_free(&session->cmdpool); - kfree(session->password); + kfree_sensitive(session->password); kfree(session->password_in); kfree(session->username); kfree(session->username_in); -- 2.39.0