From patchwork Fri Sep 7 18:01:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Dickson X-Patchwork-Id: 10592439 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 B142F921 for ; Fri, 7 Sep 2018 18:01:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A88772B8D6 for ; Fri, 7 Sep 2018 18:01:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9CF2B2B8DD; Fri, 7 Sep 2018 18:01:55 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 5D5132B8D6 for ; Fri, 7 Sep 2018 18:01:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726614AbeIGWn6 (ORCPT ); Fri, 7 Sep 2018 18:43:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46818 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726151AbeIGWn6 (ORCPT ); Fri, 7 Sep 2018 18:43:58 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4EE9EC049D57; Fri, 7 Sep 2018 18:01:54 +0000 (UTC) Received: from steved.boston.devel.redhat.com (ovpn-116-194.phx2.redhat.com [10.3.116.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id E301360157; Fri, 7 Sep 2018 18:01:53 +0000 (UTC) From: Steve Dickson To: Libtirpc-devel Mailing List Cc: Linux NFS Mailing list Subject: [PATCH 01/13] auth_gss.c: resource_leak Date: Fri, 7 Sep 2018 14:01:39 -0400 Message-Id: <20180907180151.178872-2-steved@redhat.com> In-Reply-To: <20180907180151.178872-1-steved@redhat.com> References: <20180907180151.178872-1-steved@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 07 Sep 2018 18:01:54 +0000 (UTC) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Variable "gd" going out of scope leaks the storage it points to. Signed-off-by: Steve Dickson --- src/auth_gss.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/auth_gss.c b/src/auth_gss.c index 5959893..289bd5b 100644 --- a/src/auth_gss.c +++ b/src/auth_gss.c @@ -207,6 +207,7 @@ authgss_create(CLIENT *clnt, gss_name_t name, struct rpc_gss_sec *sec) rpc_createerr.cf_stat = RPC_SYSTEMERROR; rpc_createerr.cf_error.re_errno = ENOMEM; free(auth); + free(gd); return (NULL); } } From patchwork Fri Sep 7 18:01:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Dickson X-Patchwork-Id: 10592441 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 EC14318FD for ; Fri, 7 Sep 2018 18:01:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E40AA2B8D6 for ; Fri, 7 Sep 2018 18:01:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D896A2B8DC; Fri, 7 Sep 2018 18:01:55 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 9602A2B8DB for ; Fri, 7 Sep 2018 18:01:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726695AbeIGWn7 (ORCPT ); Fri, 7 Sep 2018 18:43:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58268 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726151AbeIGWn6 (ORCPT ); Fri, 7 Sep 2018 18:43:58 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CF2F130832CF; Fri, 7 Sep 2018 18:01:54 +0000 (UTC) Received: from steved.boston.devel.redhat.com (ovpn-116-194.phx2.redhat.com [10.3.116.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6E47460157; Fri, 7 Sep 2018 18:01:54 +0000 (UTC) From: Steve Dickson To: Libtirpc-devel Mailing List Cc: Linux NFS Mailing list Subject: [PATCH 02/13] auth_gss.c: buffer_size_warning Date: Fri, 7 Sep 2018 14:01:40 -0400 Message-Id: <20180907180151.178872-3-steved@redhat.com> In-Reply-To: <20180907180151.178872-1-steved@redhat.com> References: <20180907180151.178872-1-steved@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Fri, 07 Sep 2018 18:01:54 +0000 (UTC) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Calling strncpy with a maximum size argument of 128 bytes on destination array "options_ret->actual_mechanism" of size 128 bytes might leave the destination string unterminated Signed-off-by: Steve Dickson --- src/auth_gss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/auth_gss.c b/src/auth_gss.c index 289bd5b..7d08262 100644 --- a/src/auth_gss.c +++ b/src/auth_gss.c @@ -593,7 +593,7 @@ _rpc_gss_refresh(AUTH *auth, rpc_gss_options_ret_t *options_ret) if (rpc_gss_oid_to_mech(actual_mech_type, &mechanism)) { strncpy(options_ret->actual_mechanism, mechanism, - sizeof(options_ret->actual_mechanism)); + (sizeof(options_ret->actual_mechanism)-1)); } gd->established = TRUE; From patchwork Fri Sep 7 18:01:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Dickson X-Patchwork-Id: 10592443 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 A7935921 for ; Fri, 7 Sep 2018 18:01:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9EF0C2B8D6 for ; Fri, 7 Sep 2018 18:01:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 938082B8DC; Fri, 7 Sep 2018 18:01:56 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 404B92B8D6 for ; Fri, 7 Sep 2018 18:01:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726708AbeIGWn7 (ORCPT ); Fri, 7 Sep 2018 18:43:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49432 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726151AbeIGWn7 (ORCPT ); Fri, 7 Sep 2018 18:43:59 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 574D1307D861; Fri, 7 Sep 2018 18:01:55 +0000 (UTC) Received: from steved.boston.devel.redhat.com (ovpn-116-194.phx2.redhat.com [10.3.116.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id EA4066136F; Fri, 7 Sep 2018 18:01:54 +0000 (UTC) From: Steve Dickson To: Libtirpc-devel Mailing List Cc: Linux NFS Mailing list Subject: [PATCH 03/13] clnt_bcast.c: resource_leak Date: Fri, 7 Sep 2018 14:01:41 -0400 Message-Id: <20180907180151.178872-4-steved@redhat.com> In-Reply-To: <20180907180151.178872-1-steved@redhat.com> References: <20180907180151.178872-1-steved@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Fri, 07 Sep 2018 18:01:55 +0000 (UTC) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Variable "sys_auth" going out of scope leaks the storage it points to. Signed-off-by: Steve Dickson --- src/clnt_bcast.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/clnt_bcast.c b/src/clnt_bcast.c index 98cf061..2ad6c89 100644 --- a/src/clnt_bcast.c +++ b/src/clnt_bcast.c @@ -330,6 +330,7 @@ rpc_broadcast_exp(prog, vers, proc, xargs, argsp, xresults, resultsp, if (nettype == NULL) nettype = "datagram_n"; if ((handle = __rpc_setconf(nettype)) == NULL) { + AUTH_DESTROY(sys_auth); return (RPC_UNKNOWNPROTO); } while ((nconf = __rpc_getconf(handle)) != NULL) { From patchwork Fri Sep 7 18:01:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Dickson X-Patchwork-Id: 10592445 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 E99DE921 for ; Fri, 7 Sep 2018 18:01:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E15B32B8D6 for ; Fri, 7 Sep 2018 18:01:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D539F2B8DC; Fri, 7 Sep 2018 18:01:57 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 93A192B8D6 for ; Fri, 7 Sep 2018 18:01:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726763AbeIGWoB (ORCPT ); Fri, 7 Sep 2018 18:44:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58278 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726151AbeIGWoA (ORCPT ); Fri, 7 Sep 2018 18:44:00 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DB2D130832D7; Fri, 7 Sep 2018 18:01:56 +0000 (UTC) Received: from steved.boston.devel.redhat.com (ovpn-116-194.phx2.redhat.com [10.3.116.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id 70BBC6136F; Fri, 7 Sep 2018 18:01:55 +0000 (UTC) From: Steve Dickson To: Libtirpc-devel Mailing List Cc: Linux NFS Mailing list Subject: [PATCH 04/13] clnt_vc.c: resource_leak Date: Fri, 7 Sep 2018 14:01:42 -0400 Message-Id: <20180907180151.178872-5-steved@redhat.com> In-Reply-To: <20180907180151.178872-1-steved@redhat.com> References: <20180907180151.178872-1-steved@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Fri, 07 Sep 2018 18:01:56 +0000 (UTC) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Variable "ct" going out of scope leaks the storage it points to. Signed-off-by: Steve Dickson --- src/clnt_vc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/clnt_vc.c b/src/clnt_vc.c index 3d775c7..10ee91a 100644 --- a/src/clnt_vc.c +++ b/src/clnt_vc.c @@ -325,6 +325,8 @@ clnt_vc_create(fd, raddr, prog, vers, sendsz, recvsz) recvsz = __rpc_get_t_size(si.si_af, si.si_proto, (int)recvsz); xdrrec_create(&(ct->ct_xdrs), sendsz, recvsz, cl->cl_private, read_vc, write_vc); + mem_free(ct->ct_addr.buf, ct->ct_addr.len); + mem_free(ct, sizeof (struct ct_data)); return (cl); err: From patchwork Fri Sep 7 18:01:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Dickson X-Patchwork-Id: 10592447 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 BE121920 for ; Fri, 7 Sep 2018 18:01:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B66A02B8DB for ; Fri, 7 Sep 2018 18:01:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A7BC72B8D6; Fri, 7 Sep 2018 18:01:58 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 62A8E2B8D6 for ; Fri, 7 Sep 2018 18:01:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726945AbeIGWoB (ORCPT ); Fri, 7 Sep 2018 18:44:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36788 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726151AbeIGWoB (ORCPT ); Fri, 7 Sep 2018 18:44:01 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 633193082E63; Fri, 7 Sep 2018 18:01:57 +0000 (UTC) Received: from steved.boston.devel.redhat.com (ovpn-116-194.phx2.redhat.com [10.3.116.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id 066F4422C; Fri, 7 Sep 2018 18:01:56 +0000 (UTC) From: Steve Dickson To: Libtirpc-devel Mailing List Cc: Linux NFS Mailing list Subject: [PATCH 05/13] getnetconfig.c: cppcheck_warning Date: Fri, 7 Sep 2018 14:01:43 -0400 Message-Id: <20180907180151.178872-6-steved@redhat.com> In-Reply-To: <20180907180151.178872-1-steved@redhat.com> References: <20180907180151.178872-1-steved@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Fri, 07 Sep 2018 18:01:57 +0000 (UTC) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Memory leak: p Memory leak: tmp Signed-off-by: Steve Dickson --- src/getnetconfig.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/getnetconfig.c b/src/getnetconfig.c index 92e7c43..d67d97d 100644 --- a/src/getnetconfig.c +++ b/src/getnetconfig.c @@ -709,6 +709,8 @@ struct netconfig *ncp; p->nc_lookups = (char **)malloc((size_t)(p->nc_nlookups+1) * sizeof(char *)); if (p->nc_lookups == NULL) { free(p->nc_netid); + free(p); + free(tmp); return(NULL); } for (i=0; i < p->nc_nlookups; i++) { From patchwork Fri Sep 7 18:01:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Dickson X-Patchwork-Id: 10592449 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 EE47A112B for ; Fri, 7 Sep 2018 18:01:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E5BB12B8D6 for ; Fri, 7 Sep 2018 18:01:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DA54D2B8DB; Fri, 7 Sep 2018 18:01:58 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 952CB2B8DC for ; Fri, 7 Sep 2018 18:01:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727068AbeIGWoC (ORCPT ); Fri, 7 Sep 2018 18:44:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54478 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726151AbeIGWoB (ORCPT ); Fri, 7 Sep 2018 18:44:01 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DFC503DE42; Fri, 7 Sep 2018 18:01:57 +0000 (UTC) Received: from steved.boston.devel.redhat.com (ovpn-116-194.phx2.redhat.com [10.3.116.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id 837A5422C; Fri, 7 Sep 2018 18:01:57 +0000 (UTC) From: Steve Dickson To: Libtirpc-devel Mailing List Cc: Linux NFS Mailing list Subject: [PATCH 06/13] getnetpath.c: resource_leak Date: Fri, 7 Sep 2018 14:01:44 -0400 Message-Id: <20180907180151.178872-7-steved@redhat.com> In-Reply-To: <20180907180151.178872-1-steved@redhat.com> References: <20180907180151.178872-1-steved@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 07 Sep 2018 18:01:57 +0000 (UTC) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Variable "np_sessionp" going out of scope leaks the storage it points to. Signed-off-by: Steve Dickson --- src/getnetpath.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/getnetpath.c b/src/getnetpath.c index 7c19932..ea1a18c 100644 --- a/src/getnetpath.c +++ b/src/getnetpath.c @@ -88,6 +88,7 @@ setnetpath() } if ((np_sessionp->nc_handlep = setnetconfig()) == NULL) { syslog (LOG_ERR, "rpc: failed to open " NETCONFIG); + free(np_sessionp); return (NULL); } np_sessionp->valid = NP_VALID; From patchwork Fri Sep 7 18:01:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Dickson X-Patchwork-Id: 10592451 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 A9C1A921 for ; Fri, 7 Sep 2018 18:01:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A13212B8DB for ; Fri, 7 Sep 2018 18:01:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 95B1D2B8DC; Fri, 7 Sep 2018 18:01:59 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 54F0C2B8D6 for ; Fri, 7 Sep 2018 18:01:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727175AbeIGWoC (ORCPT ); Fri, 7 Sep 2018 18:44:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49452 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726151AbeIGWoC (ORCPT ); Fri, 7 Sep 2018 18:44:02 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 642F6307D866; Fri, 7 Sep 2018 18:01:58 +0000 (UTC) Received: from steved.boston.devel.redhat.com (ovpn-116-194.phx2.redhat.com [10.3.116.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0A410422C; Fri, 7 Sep 2018 18:01:57 +0000 (UTC) From: Steve Dickson To: Libtirpc-devel Mailing List Cc: Linux NFS Mailing list Subject: [PATCH 07/13] rpc_generic.c: resource_leak Date: Fri, 7 Sep 2018 14:01:45 -0400 Message-Id: <20180907180151.178872-8-steved@redhat.com> In-Reply-To: <20180907180151.178872-1-steved@redhat.com> References: <20180907180151.178872-1-steved@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Fri, 07 Sep 2018 18:01:58 +0000 (UTC) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Variable "handle" going out of scope leaks the storage it points to. Signed-off-by: Steve Dickson --- src/rpc_generic.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/rpc_generic.c b/src/rpc_generic.c index 589cbd5..51f36ac 100644 --- a/src/rpc_generic.c +++ b/src/rpc_generic.c @@ -319,6 +319,7 @@ __rpc_setconf(nettype) handle->nflag = FALSE; break; default: + free(handle); return (NULL); } From patchwork Fri Sep 7 18:01:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Dickson X-Patchwork-Id: 10592453 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 2D5C8112B for ; Fri, 7 Sep 2018 18:02:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 246362B8D6 for ; Fri, 7 Sep 2018 18:02:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 18FBB2B8DD; Fri, 7 Sep 2018 18:02:00 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 C762F2B8D6 for ; Fri, 7 Sep 2018 18:01:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727181AbeIGWoD (ORCPT ); Fri, 7 Sep 2018 18:44:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48168 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726151AbeIGWoC (ORCPT ); Fri, 7 Sep 2018 18:44:02 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DFBDC81DE3; Fri, 7 Sep 2018 18:01:58 +0000 (UTC) Received: from steved.boston.devel.redhat.com (ovpn-116-194.phx2.redhat.com [10.3.116.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id 85B97422C; Fri, 7 Sep 2018 18:01:58 +0000 (UTC) From: Steve Dickson To: Libtirpc-devel Mailing List Cc: Linux NFS Mailing list Subject: [PATCH 08/13] rpc_soc.c: resource_leak Date: Fri, 7 Sep 2018 14:01:46 -0400 Message-Id: <20180907180151.178872-9-steved@redhat.com> In-Reply-To: <20180907180151.178872-1-steved@redhat.com> References: <20180907180151.178872-1-steved@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 07 Sep 2018 18:01:58 +0000 (UTC) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Variable "localhandle" going out of scope leaks the storage it points to. Returning without closing handle "sock" leaks it. Signed-off-by: Steve Dickson --- src/rpc_soc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/rpc_soc.c b/src/rpc_soc.c index 5a6eeb7..59e0882 100644 --- a/src/rpc_soc.c +++ b/src/rpc_soc.c @@ -663,8 +663,10 @@ svcunix_create(sock, sendsize, recvsize, path) strcmp(nconf->nc_protofmly, NC_LOOPBACK) == 0) break; } - if (nconf == NULL) + if (nconf == NULL) { + endnetconfig(localhandle); return(xprt); + } if ((sock = __rpc_nconf2fd(nconf)) < 0) goto done; @@ -692,6 +694,8 @@ svcunix_create(sock, sendsize, recvsize, path) } xprt = (SVCXPRT *)svc_tli_create(sock, nconf, &taddr, sendsize, recvsize); + if (xprt == NULL) + close(sock); done: endnetconfig(localhandle); From patchwork Fri Sep 7 18:01:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Dickson X-Patchwork-Id: 10592455 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 94348920 for ; Fri, 7 Sep 2018 18:02:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8C9D72B8D6 for ; Fri, 7 Sep 2018 18:02:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 811BF2B8DD; Fri, 7 Sep 2018 18:02:00 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 3F1D52B8D6 for ; Fri, 7 Sep 2018 18:02:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727217AbeIGWoD (ORCPT ); Fri, 7 Sep 2018 18:44:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51722 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726151AbeIGWoD (ORCPT ); Fri, 7 Sep 2018 18:44:03 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 68509811A4; Fri, 7 Sep 2018 18:01:59 +0000 (UTC) Received: from steved.boston.devel.redhat.com (ovpn-116-194.phx2.redhat.com [10.3.116.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0DA52422C; Fri, 7 Sep 2018 18:01:58 +0000 (UTC) From: Steve Dickson To: Libtirpc-devel Mailing List Cc: Linux NFS Mailing list Subject: [PATCH 09/13] rpc_soc.c: buffer_size_warning Date: Fri, 7 Sep 2018 14:01:47 -0400 Message-Id: <20180907180151.178872-10-steved@redhat.com> In-Reply-To: <20180907180151.178872-1-steved@redhat.com> References: <20180907180151.178872-1-steved@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 07 Sep 2018 18:01:59 +0000 (UTC) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Calling strncpy with a maximum size argument of 108 bytes on destination array "sun.sun_path" of size 108 bytes might leave the destination string unterminated. Signed-off-by: Steve Dickson --- src/rpc_soc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rpc_soc.c b/src/rpc_soc.c index 59e0882..a85cb17 100644 --- a/src/rpc_soc.c +++ b/src/rpc_soc.c @@ -673,7 +673,7 @@ svcunix_create(sock, sendsize, recvsize, path) memset(&sun, 0, sizeof sun); sun.sun_family = AF_LOCAL; - strncpy(sun.sun_path, path, sizeof(sun.sun_path)); + strncpy(sun.sun_path, path, (sizeof(sun.sun_path)-1)); addrlen = sizeof(struct sockaddr_un); sa = (struct sockaddr *)&sun; From patchwork Fri Sep 7 18:01:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Dickson X-Patchwork-Id: 10592457 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 25E09112B for ; Fri, 7 Sep 2018 18:02:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D52A2B8D6 for ; Fri, 7 Sep 2018 18:02:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 120462B8DD; Fri, 7 Sep 2018 18:02:01 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 C34102B8D6 for ; Fri, 7 Sep 2018 18:02:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727223AbeIGWoE (ORCPT ); Fri, 7 Sep 2018 18:44:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38044 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726151AbeIGWoE (ORCPT ); Fri, 7 Sep 2018 18:44:04 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E2C31300192D; Fri, 7 Sep 2018 18:01:59 +0000 (UTC) Received: from steved.boston.devel.redhat.com (ovpn-116-194.phx2.redhat.com [10.3.116.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id 88BD7422C; Fri, 7 Sep 2018 18:01:59 +0000 (UTC) From: Steve Dickson To: Libtirpc-devel Mailing List Cc: Linux NFS Mailing list Subject: [PATCH 10/13] rpcb_clnt.c: resource_leak Date: Fri, 7 Sep 2018 14:01:48 -0400 Message-Id: <20180907180151.178872-11-steved@redhat.com> In-Reply-To: <20180907180151.178872-1-steved@redhat.com> References: <20180907180151.178872-1-steved@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Fri, 07 Sep 2018 18:01:59 +0000 (UTC) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Variable "nc_handle" going out of scope leaks the storage it points to. Signed-off-by: Steve Dickson --- src/rpcb_clnt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/rpcb_clnt.c b/src/rpcb_clnt.c index e45736a..0c34cb7 100644 --- a/src/rpcb_clnt.c +++ b/src/rpcb_clnt.c @@ -547,6 +547,7 @@ try_nconf: if (tmpnconf == NULL) { rpc_createerr.cf_stat = RPC_UNKNOWNPROTO; mutex_unlock(&loopnconf_lock); + endnetconfig(nc_handle); return (NULL); } loopnconf = getnetconfigent(tmpnconf->nc_netid); From patchwork Fri Sep 7 18:01:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Dickson X-Patchwork-Id: 10592459 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 E0193920 for ; Fri, 7 Sep 2018 18:02:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D89202B8D6 for ; Fri, 7 Sep 2018 18:02:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CD4E02B8DD; Fri, 7 Sep 2018 18:02:01 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 8D35B2B8D6 for ; Fri, 7 Sep 2018 18:02:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727349AbeIGWoE (ORCPT ); Fri, 7 Sep 2018 18:44:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:2516 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727315AbeIGWoE (ORCPT ); Fri, 7 Sep 2018 18:44:04 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6C2BF3002C69; Fri, 7 Sep 2018 18:02:00 +0000 (UTC) Received: from steved.boston.devel.redhat.com (ovpn-116-194.phx2.redhat.com [10.3.116.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0EF78422C; Fri, 7 Sep 2018 18:01:59 +0000 (UTC) From: Steve Dickson To: Libtirpc-devel Mailing List Cc: Linux NFS Mailing list Subject: [PATCH 11/13] rtime.c: resource_leak Date: Fri, 7 Sep 2018 14:01:49 -0400 Message-Id: <20180907180151.178872-12-steved@redhat.com> In-Reply-To: <20180907180151.178872-1-steved@redhat.com> References: <20180907180151.178872-1-steved@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Fri, 07 Sep 2018 18:02:00 +0000 (UTC) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Handle variable "s" going out of scope leaks the handle. Signed-off-by: Steve Dickson --- src/rtime.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/rtime.c b/src/rtime.c index b642840..29fbf0a 100644 --- a/src/rtime.c +++ b/src/rtime.c @@ -90,6 +90,7 @@ rtime(addrp, timep, timeout) /* TCP and UDP port are the same in this case */ if ((serv = getservbyname("time", "tcp")) == NULL) { + do_close(s); return(-1); } From patchwork Fri Sep 7 18:01:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Dickson X-Patchwork-Id: 10592461 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 48C1F112B for ; Fri, 7 Sep 2018 18:02:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 407682B8D6 for ; Fri, 7 Sep 2018 18:02:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 353052B8DD; Fri, 7 Sep 2018 18:02:02 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 E69242B8DC for ; Fri, 7 Sep 2018 18:02:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727413AbeIGWoF (ORCPT ); Fri, 7 Sep 2018 18:44:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58302 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727315AbeIGWoF (ORCPT ); Fri, 7 Sep 2018 18:44:05 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E77C530832E2; Fri, 7 Sep 2018 18:02:00 +0000 (UTC) Received: from steved.boston.devel.redhat.com (ovpn-116-194.phx2.redhat.com [10.3.116.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8C0EB422C; Fri, 7 Sep 2018 18:02:00 +0000 (UTC) From: Steve Dickson To: Libtirpc-devel Mailing List Cc: Linux NFS Mailing list Subject: [PATCH 12/13] svc_generic.c: resource_leak Date: Fri, 7 Sep 2018 14:01:50 -0400 Message-Id: <20180907180151.178872-13-steved@redhat.com> In-Reply-To: <20180907180151.178872-1-steved@redhat.com> References: <20180907180151.178872-1-steved@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Fri, 07 Sep 2018 18:02:00 +0000 (UTC) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Variable "handle" going out of scope leaks the storage it points to. Signed-off-by: Steve Dickson --- src/svc_generic.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/svc_generic.c b/src/svc_generic.c index 52a56c2..20abaa2 100644 --- a/src/svc_generic.c +++ b/src/svc_generic.c @@ -113,6 +113,7 @@ svc_create(dispatch, prognum, versnum, nettype) if (l == NULL) { warnx("svc_create: no memory"); mutex_unlock(&xprtlist_lock); + __rpc_endconf(handle); return (0); } l->xprt = xprt; From patchwork Fri Sep 7 18:01:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Dickson X-Patchwork-Id: 10592463 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 BA135921 for ; Fri, 7 Sep 2018 18:02:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B05DF2B8D6 for ; Fri, 7 Sep 2018 18:02:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A358B2B8DD; Fri, 7 Sep 2018 18:02:04 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 52CC92B8D6 for ; Fri, 7 Sep 2018 18:02:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727654AbeIGWoG (ORCPT ); Fri, 7 Sep 2018 18:44:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48190 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727652AbeIGWoF (ORCPT ); Fri, 7 Sep 2018 18:44:05 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ADF1681DE1; Fri, 7 Sep 2018 18:02:01 +0000 (UTC) Received: from steved.boston.devel.redhat.com (ovpn-116-194.phx2.redhat.com [10.3.116.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id 132254272; Fri, 7 Sep 2018 18:02:00 +0000 (UTC) From: Steve Dickson To: Libtirpc-devel Mailing List Cc: Linux NFS Mailing list Subject: [PATCH 13/13] svc_simple.c: resource_leak Date: Fri, 7 Sep 2018 14:01:51 -0400 Message-Id: <20180907180151.178872-14-steved@redhat.com> In-Reply-To: <20180907180151.178872-1-steved@redhat.com> References: <20180907180151.178872-1-steved@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Fri, 07 Sep 2018 18:02:01 +0000 (UTC) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Variable "xdrbuf" going out of scope leaks the storage it points to. Signed-off-by: Steve Dickson --- src/svc_simple.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/svc_simple.c b/src/svc_simple.c index cb58002..c32fe0a 100644 --- a/src/svc_simple.c +++ b/src/svc_simple.c @@ -157,6 +157,7 @@ rpc_reg(prognum, versnum, procnum, progname, inproc, outproc, nettype) ((netid = strdup(nconf->nc_netid)) == NULL)) { warnx(rpc_reg_err, rpc_reg_msg, __no_mem_str); SVC_DESTROY(svcxprt); + free(xdrbuf); break; } madenow = TRUE;