From patchwork Mon Jul 17 09:26:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Minjie Du X-Patchwork-Id: 704001 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72743C0015E for ; Mon, 17 Jul 2023 09:27:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230308AbjGQJ1Q (ORCPT ); Mon, 17 Jul 2023 05:27:16 -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 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: 8G7M/CcFAo+OqYUWsmBMaftxmUh0NAAHdgTTePgeKettQQVRKlxSpvxiWYMXjhOzrag9evS4j+EflIM0U5zz2+3CkI+s5OC7aUpfMng34Tz+bVnYNvBrm3vsUdVnMYJvy5qMo546NoOs16/x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HRT5W7SuuIHBfoTc3hE+wtjRu0t8D2mFWKaUjPYlclQ+Zm480HHRU/ucDDNn+jZxv/LZJiSAtrpJ6JxzByz4NjblkjJhAMasSw3iLbuJ7pwiQbOmWg9ZlxQj1bx0CykV5kSRAeJ3KfABOp3ZXOUHIjf9Ljta+g0XzFMhc4J8znXjqE3KtKB7b6Rv9wgiwfHg6D6WQSWo1u0mXDYvGf6XqMqzlEIwJ8lh4LEko0j0PcjEpnErV+ksRohDYN0Q/CNOiRVnl5ZbYDiTuKhaWGU1sVsjPkHe+bg3DMDNE2smyCyr2EFzlkjcSj2aWyQsm+XPvbPCSeaChluYIa8/neqZDfKI6O1vKulsO4ewQ0LU5rjF1HRprexLq4DVFkiO7 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 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@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 Reviewed-by: Lee Duncan --- 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);