From patchwork Thu Dec 20 11:32:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 10738763 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EA7A314E2 for ; Thu, 20 Dec 2018 11:33:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CC7C120952 for ; Thu, 20 Dec 2018 11:33:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BE25F2845C; Thu, 20 Dec 2018 11:33:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 522B120952 for ; Thu, 20 Dec 2018 11:33:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728425AbeLTLdi (ORCPT ); Thu, 20 Dec 2018 06:33:38 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:52658 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727990AbeLTLdi (ORCPT ); Thu, 20 Dec 2018 06:33:38 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wBKBStw6044864; Thu, 20 Dec 2018 11:33:14 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2018-07-02; bh=A4zISiyO2km16fk3f/nYA2lbbBJTHuJN8U06aqr0P9o=; b=Ozb1WNiPBYxpIcKakJfeacL+eZibpPMo6LJ3PJLQuSTgeG/YQey7iNpQe1tcIRdNhRFi 0Ds1f+H8pawbY8gkwQXiTGEOMXTJsIdsdqT5zVNLEnvIEi5wsGn2gPDcHx790+R/VHO6 bfDGGxhsCNc8Hr9MviKuZHVlf5GocYnLVvu5X+ZN1i96JE9Zonp7UK49ibn+JRxIlwHm 2hb350w7alGAJ1qcAnnYkoMSGWhDLxSYuo7/LcAjq6K5xGOSm+6a0qNqXiTEy5qrcuUQ Zp5g1666PWrT/RkLebV9cvhD1FV4XXpjD34egPmXgjcFgLzxO85iOD7xwgP/lZPIlN/A HQ== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2130.oracle.com with ESMTP id 2pf8gfgdtm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 20 Dec 2018 11:33:14 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id wBKBXDBo017808 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 20 Dec 2018 11:33:14 GMT Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id wBKBXD5A020706; Thu, 20 Dec 2018 11:33:13 GMT Received: from kadam (/10.175.63.51) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 20 Dec 2018 03:33:12 -0800 Date: Thu, 20 Dec 2018 14:32:43 +0300 From: Dan Carpenter To: Steve French , Paulo Alcantara Cc: linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, kernel-janitors@vger.kernel.org Subject: [PATCH] cifs: Use kzfree() to free password Message-ID: <20181220113243.GA20171@kadam> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9112 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=2 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1812200096 Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We should zero out the password before we free it. Fixes: 3d6cacbb5310 ("cifs: Add DFS cache routines") Signed-off-by: Dan Carpenter Reviewed-by: Paulo Alcantara --- fs/cifs/dfs_cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/cifs/dfs_cache.c b/fs/cifs/dfs_cache.c index f74567788396..006333146a6d 100644 --- a/fs/cifs/dfs_cache.c +++ b/fs/cifs/dfs_cache.c @@ -1130,7 +1130,7 @@ static int dup_vol(struct smb_vol *vol, struct smb_vol *new) err_free_unc: kfree(new->UNC); err_free_password: - kfree(new->password); + kzfree(new->password); err_free_username: kfree(new->username); kfree(new);