Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp2418847rdb; Mon, 25 Dec 2023 09:56:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IF9RWfkp7BUplji34NEZ/gIqjQQE8I0U1oKHFfKTg+M8L1UUiw0uqncLLYuGTprXEzesHz1 X-Received: by 2002:a05:622a:14d0:b0:425:4043:41c9 with SMTP id u16-20020a05622a14d000b00425404341c9mr8797545qtx.117.1703527014713; Mon, 25 Dec 2023 09:56:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703527014; cv=none; d=google.com; s=arc-20160816; b=Hc+Zk3InI+RwFECwux1NdhGEpJ+QO3sPB8q+ZeaN3a5PcBMS++W4Ga43v+gcWYVbbL y/Z87uPJU60znWRkItm5UxHSGeHHyqF746FE8EK3/JUjrKbkk5ck2cF1PeWBrOHWMT41 D8w4v2UrYj4mSn/a5gSWJ3vfu3y5qrvqYXszjQ98ybBfpf3nsfKXKJ3bWiDaa4QwoyNs bUUHZP6EBtBIii1pKOc6nqb4asApmtTET8lZBoeN+W/QSX6zeeAeYyiEEyKAvj808y7H XsoiuwXPutIvW5kPjUjrAPmEVi4ZR1QbgLkxX0ZHyI22SikjOsThQVmWpCEpjadOX1uC Gxog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=yMSXEAS0PVE7SqxStO7axwAVaitWHOZxW2zrFnFa5+8=; fh=7V+aLf/O1nqsDO9zRLMxYKbayhRD9HXWJ3cGT5lqENQ=; b=dhL6wc/D5TkcdrVGie6T7tam+G89wiuR6jgr/5zaiY7S+3zvZ8eLTQOo6i2IQ53YnI FNRM9PX5C9C9WdW3kcRJcd8uZ9vmCPVu0Kd805oDOoNDgNUJIjO07fiKcjmI/O7t/l7s nJNu/tT91SD75Auj6aWn2muGB7DaHvoWPoBzqufmyF9QMnwPwRxFt4kh5TODNjv+2Xg5 xwbIjngF2EhvJ4RrS9zzqhXgDaWborrXojCKzGz/NQgkBGt+3sfjMwYl6ur2f7deVWZq cVHh+wt0huRpAEG5034+Acq5FzURJR3ZWnnTQEY2Lt/r4urTb8GHGYSa3wPlMajpD2fW bYMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=imjIsMJH; spf=pass (google.com: domain of linux-nfs+bounces-806-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-806-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id h5-20020ac87d45000000b00423b6a1208asi10871186qtb.8.2023.12.25.09.56.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Dec 2023 09:56:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-806-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=imjIsMJH; spf=pass (google.com: domain of linux-nfs+bounces-806-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-806-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 5E9E81C20473 for ; Mon, 25 Dec 2023 17:56:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7D5E152F97; Mon, 25 Dec 2023 17:56:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="imjIsMJH" X-Original-To: linux-nfs@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) (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 857F952F89; Mon, 25 Dec 2023 17:56:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1703527010; x=1735063010; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=c5WnwSj/pGFg6EsfD20VqFkZJ5FQAgS830qZCY8nWrU=; b=imjIsMJHj2LCpbqlwZZxZVKJLzTBuXNGsPs5w6pDuwVj5VET/5meLEw1 PSpIT0+xa4Exxh2jv8YlLkxo/uapHus7zAYIB24otDrAjF8keTg0RPZEk adofO3WuLx4R4TrGgPW+h0Z5tadQgexuHqhQxvLP9foIE5gCHG3UZpff+ aow68B08abAaVKnoLHtXBZ7cAQeTRCn1DAA4/yuRMOzEQ1f+oC5toNiUN J2v57s6rBjfU0pA1o1xDCZ5iLqpQ7an4CY3Ou3j8beo8hcOR0K7xAHS0i Arg48wv5kH0i9Cj1q22ZCqtRaD04mA9RnU0h63ILZ4La+HhriYDimLqC1 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10934"; a="393458090" X-IronPort-AV: E=Sophos;i="6.04,303,1695711600"; d="scan'208";a="393458090" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Dec 2023 09:56:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10934"; a="781283964" X-IronPort-AV: E=Sophos;i="6.04,303,1695711600"; d="scan'208";a="781283964" Received: from lkp-server02.sh.intel.com (HELO b07ab15da5fe) ([10.239.97.151]) by fmsmga007.fm.intel.com with ESMTP; 25 Dec 2023 09:56:45 -0800 Received: from kbuild by b07ab15da5fe with local (Exim 4.96) (envelope-from ) id 1rHpB0-000DWp-2B; Mon, 25 Dec 2023 17:56:17 +0000 Date: Tue, 26 Dec 2023 01:53:13 +0800 From: kernel test robot To: Zhipeng Lu Cc: oe-kbuild-all@lists.linux.dev, Chuck Lever , Jeff Layton , Neil Brown , Olga Kornievskaia , Dai Ngo , Tom Talpey , Trond Myklebust , Anna Schumaker , Eric Dumazet , Jakub Kicinski , Paolo Abeni , "J. Bruce Fields" , Simo Sorce , linux-nfs@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] SUNRPC: fix some memleaks in gssx_dec_option_array Message-ID: <202312260138.JJkoofSt-lkp@intel.com> References: <20231224082424.3539726-1-alexious@zju.edu.cn> Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231224082424.3539726-1-alexious@zju.edu.cn> Hi Zhipeng, kernel test robot noticed the following build errors: [auto build test ERROR on linus/master] [also build test ERROR on v6.7-rc7 next-20231222] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Zhipeng-Lu/SUNRPC-fix-some-memleaks-in-gssx_dec_option_array/20231225-152918 base: linus/master patch link: https://lore.kernel.org/r/20231224082424.3539726-1-alexious%40zju.edu.cn patch subject: [PATCH] SUNRPC: fix some memleaks in gssx_dec_option_array config: nios2-randconfig-r081-20231225 (https://download.01.org/0day-ci/archive/20231226/202312260138.JJkoofSt-lkp@intel.com/config) compiler: nios2-linux-gcc (GCC) 13.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231226/202312260138.JJkoofSt-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Closes: https://lore.kernel.org/oe-kbuild-all/202312260138.JJkoofSt-lkp@intel.com/ All error/warnings (new ones prefixed by >>): net/sunrpc/auth_gss/gss_rpc_xdr.c: In function 'gssx_dec_option_array': >> net/sunrpc/auth_gss/gss_rpc_xdr.c:270:25: error: expected ';' before 'goto' 270 | goto free_creds; | ^~~~ net/sunrpc/auth_gss/gss_rpc_xdr.c:277:25: error: expected ';' before 'goto' 277 | goto free_creds; | ^~~~ >> net/sunrpc/auth_gss/gss_rpc_xdr.c:301:1: warning: label 'err' defined but not used [-Wunused-label] 301 | err: | ^~~ vim +270 net/sunrpc/auth_gss/gss_rpc_xdr.c 228 229 static int gssx_dec_option_array(struct xdr_stream *xdr, 230 struct gssx_option_array *oa) 231 { 232 struct svc_cred *creds; 233 u32 count, i; 234 __be32 *p; 235 int err; 236 237 p = xdr_inline_decode(xdr, 4); 238 if (unlikely(p == NULL)) 239 return -ENOSPC; 240 count = be32_to_cpup(p++); 241 if (!count) 242 return 0; 243 244 /* we recognize only 1 currently: CREDS_VALUE */ 245 oa->count = 1; 246 247 oa->data = kmalloc(sizeof(struct gssx_option), GFP_KERNEL); 248 if (!oa->data) 249 return -ENOMEM; 250 251 creds = kzalloc(sizeof(struct svc_cred), GFP_KERNEL); 252 if (!creds) { 253 err = -ENOMEM; 254 goto free_oa; 255 } 256 257 oa->data[0].option.data = CREDS_VALUE; 258 oa->data[0].option.len = sizeof(CREDS_VALUE); 259 oa->data[0].value.data = (void *)creds; 260 oa->data[0].value.len = 0; 261 262 for (i = 0; i < count; i++) { 263 gssx_buffer dummy = { 0, NULL }; 264 u32 length; 265 266 /* option buffer */ 267 p = xdr_inline_decode(xdr, 4); 268 if (unlikely(p == NULL)) { 269 err = -ENOSPC > 270 goto free_creds; 271 } 272 273 length = be32_to_cpup(p); 274 p = xdr_inline_decode(xdr, length); 275 if (unlikely(p == NULL)) { 276 err = -ENOSPC 277 goto free_creds; 278 } 279 280 if (length == sizeof(CREDS_VALUE) && 281 memcmp(p, CREDS_VALUE, sizeof(CREDS_VALUE)) == 0) { 282 /* We have creds here. parse them */ 283 err = gssx_dec_linux_creds(xdr, creds); 284 if (err) 285 goto free_creds; 286 oa->data[0].value.len = 1; /* presence */ 287 } else { 288 /* consume uninteresting buffer */ 289 err = gssx_dec_buffer(xdr, &dummy); 290 if (err) 291 goto free_creds; 292 } 293 } 294 return 0; 295 296 free_creds: 297 kfree(creds); 298 free_oa: 299 kfree(oa->data); 300 oa->data = NULL; > 301 err: 302 return err; 303 } 304 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki