From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EAAC7168B9 for ; Sun, 24 Mar 2024 10:43:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711277000; cv=none; b=J6UJ1IUSHGDvtaPEDvy2RFW2jOoBBWThTwuXUMBr1701vvM6lK4HcZ/gangUVJ0D5vk71wnbufnJeCbX1rHrK4gLOxdoDn/niEtuZE/vwtJRQbVaRAaG7W57kpU6A7KETc2A4i6/yr3c4XYmaNelSd5LMZt7/U/Gx0kzWy2j/1I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711277000; c=relaxed/simple; bh=9MObCN77I7tUZOnnNXSJUXOLNM1PpU+2YR/y22SVpzg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=NFCybdAAOa1id8KBeifdYIf+I9lpXBUHJdimf1P7WqBJtO8xTacYrSq7NZ/QbRvVhZ0Hzr/nekKXo6BLFJKTjWPYydnpe6KVLsAsZKV3nyyz/bZGkNtZ1ax/brjRvKEYbYuIu0xZ+udleiddrbqbmIXshxkOFTu0qXawvRXw+NA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=t+sp3ErF; arc=none smtp.client-ip=209.85.167.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="t+sp3ErF" Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-515a86daf09so510229e87.3 for ; Sun, 24 Mar 2024 03:43:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711276997; x=1711881797; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=Ribv/O+whBGnqTci5nPx7uHIdlxoMvUZURqWTthedJw=; b=t+sp3ErFqzNFszzBMy6tw6WIgal1gAoHxTi8DSEIS89alD/K1V8uSxLiuHsPubEeH9 XCB/kWFkmqFsX0PpZpMwWpkSbHW8Glptt0tvlM29pHmaO8niMED1fDuwugxlACvqhdpc egPjhfQnuohak0iE9JCZv57zaLcCFGV32ehBUAtQw2d6ZVeGyw5FzT7zqcwGw4DtwT8j 4GIAsFpu4isbHJiqmT1J/aZOlp+g5x8mgI/5iT782IS8eVQqiljC1RwPAHXz7e0BwC0Y 6v3fhShEnn2QHb0FhXcXPtXsLIgfE6xlWDp6qsak+xjdBrDX6uh1YCq9NgonLIXgtjcg 1HnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711276997; x=1711881797; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Ribv/O+whBGnqTci5nPx7uHIdlxoMvUZURqWTthedJw=; b=jjgdd9Vzvv6IlIGHNndWOMjC74zDTJnNMJelYQL9XzMQg/yoHPCdel3ZrRyE8Q0rya RzYED4r4jAxdBlNkV+KjoY/gpqSJgB0RwDe+M88uGHCpW4eC2/5nWB3F9y36KsUbU8L2 zYM1wGeIMEvQ5A/tY1gO1xGU5nUL49KhibQZO1IVfyyvxDosEOZyN5NaLXox8hgaxtZp EKBpVkF+PohXifCL80Avbkzl/lTJoDBEyaGwDcbpnl+8gOgbcjZYiiIYGOoMerNnu85x gqugKl0GORL7jbBfzTO5pKxbxaq59zNpMdpbom/iIGNVVZxUNzycm/zxRenQ11w0qN6O NT6Q== X-Forwarded-Encrypted: i=1; AJvYcCWAxyC4MU48aYcyl28WGKij7Re7iJNMK5ZjOehte2P42W/okrSZHQv0bsC4GTCzn+PG5c1DQ/5pGg1TvjFIpL7hjqJf+Sxo5QVDLBoa X-Gm-Message-State: AOJu0Yyv6Khpio0O3V6PG/ockbeewQxNZG/kHfYwzAVoRzIT2TH5QNIk FEHgnyVzd2keiRGezAUkg+2cPXK8vZiGHhwgcgQ8fRLlVLh7OGjNFtlUyGTQCN0= X-Google-Smtp-Source: AGHT+IG4o6Yn5vUl781OaAZhuvbmnwlLG9/TmJ93NsAHIltWR7Tebhzu896a3DsWYdgcU18bziiJ7g== X-Received: by 2002:ac2:5b9a:0:b0:512:dfa1:6a1c with SMTP id o26-20020ac25b9a000000b00512dfa16a1cmr3000023lfn.10.1711276996932; Sun, 24 Mar 2024 03:43:16 -0700 (PDT) Received: from localhost ([102.222.70.76]) by smtp.gmail.com with ESMTPSA id f13-20020a056402004d00b005689bfe2688sm1816184edu.39.2024.03.24.03.43.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 03:43:16 -0700 (PDT) Date: Sun, 24 Mar 2024 13:43:12 +0300 From: Dan Carpenter To: Markus Elfring Cc: kernel-janitors@vger.kernel.org, netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org, smatch@vger.kernel.org, LKML , Alexander Lobakin , Andy Shevchenko , David Laight , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Jesse Brandeburg , Jiri Pirko , Jonathan Cameron , Julia Lawall , Kees Cook , Lukasz Czapnik , Paolo Abeni , Pucha Himasekhar Reddy , Dan Williams , Maciej Fijalkowski , Przemek Kitszel , Tony Nguyen Subject: Re: [PATCH v2 net] ice: Fix freeing uninitialized pointers Message-ID: References: <0efe132b-b343-4438-bb00-5a4b82722ed3@moroto.mountain> <08c9f970-3007-461a-b9f9-9ab414024f68@web.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <08c9f970-3007-461a-b9f9-9ab414024f68@web.de> On Sat, Mar 23, 2024 at 05:56:29PM +0100, Markus Elfring wrote: > > Automatically cleaned up pointers need to be initialized before exiting > > their scope. In this case, they need to be initialized to NULL before > > any return statement. > > * May we expect that compilers should report that affected variables > were only declared here instead of appropriately defined > (despite of attempts for scope-based resource management)? > We disabled GCC's check for uninitialized variables a long time ago because it had too many false positives. > * Did you extend detection support in the source code analysis tool “Smatch” > for a questionable implementation detail? Yes. Smatch detects this as an uninitialized variable. regards, dan carpenter From mboxrd@z Thu Jan 1 00:00:00 1970 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 smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 52AD2CD11BF for ; Sun, 24 Mar 2024 10:43:24 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id DB8A681E0E; Sun, 24 Mar 2024 10:43:23 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id f4JyTBEHP5c8; Sun, 24 Mar 2024 10:43:23 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 539D881E10 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1711277003; bh=Ribv/O+whBGnqTci5nPx7uHIdlxoMvUZURqWTthedJw=; h=Date:From:To:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=8jFn3bpPcmxpfWT6OYuRzhL2wO1l7cB6pal/s+UB1+TwOetkBfp0knIHFNDEeyL/g IW/Y9m88Oy9hKeLLzJy6lVZS83e7HcTRi6ZzC6Toobb7w7Y7W6Jp47QS/SPi/6zZRp HiVuEOVPQIso6zVpC6k2HstcjPYQrCJBrjvrTVFmv675mmFw2910Pjn1GMmiS8dSRO lCO0FzsSYxnh+BkWIl8SrnhJNorPdNIQtyHHnK6zSRqFKzebHGsWLgFgvoWD02a+uY ekAzeGoOiywmGcpwN/WqP236VCn6SA5q3/3liR7sfNzlR3P+6qWApKJ+OcT5ryieoh yPptd6H71zvRw== Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id 539D881E10; Sun, 24 Mar 2024 10:43:23 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id B1A5F1BF31A for ; Sun, 24 Mar 2024 10:43:21 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id A8F2C81E10 for ; Sun, 24 Mar 2024 10:43:21 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id xHeEtl9TmCYD for ; Sun, 24 Mar 2024 10:43:20 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a00:1450:4864:20::136; helo=mail-lf1-x136.google.com; envelope-from=dan.carpenter@linaro.org; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org E54B381E0E DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org E54B381E0E Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by smtp1.osuosl.org (Postfix) with ESMTPS id E54B381E0E for ; Sun, 24 Mar 2024 10:43:19 +0000 (UTC) Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-513d599dbabso4512347e87.1 for ; Sun, 24 Mar 2024 03:43:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711276997; x=1711881797; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Ribv/O+whBGnqTci5nPx7uHIdlxoMvUZURqWTthedJw=; b=OIVo4MN1gW60uTivwFMLuyWjPZVO9BZlw4NbaBhXyUsSirlBXNUPJ7zmqBPToEu2Id RRNbk8i7/TGhxHOQ1izLY5iFeStEYrUuzX76Qa435tMFsombkQgQcVSx5k0GFYRt11rf Q6MmnC7WntFfvwgnNCI6NLuP/kcU6rYHMzB9WJ9ACUR4X6SlHF+aQtVRKuXcLFUjR7bm Apiq+hwqnxfPOoqYc9tYm7lgklOVNCw1MC8FZC0upwYJZU8BeDpPFjIMtefbe9EKoHyd 2ivaMCqIGxjn9J/0qfCyD6sCjlxAbiQgeanVxbNEmGPgua4PISg7BCDIKyDUHMy3PLWs NuXw== X-Forwarded-Encrypted: i=1; AJvYcCXaGNz33jB9TFkGkN+2fJpcdr1v9YYq3cS4DXAFGO30viVXUQjtELpgVmqYNpzJc+XTfbfx69Xv3V224u2yPDjP8LwIBnkp3dcToduYUddbNA== X-Gm-Message-State: AOJu0YzOYJ7bdXCjnLPjterIoW+q3VjB4PdmzvtJ8/UtVqZEmxfEUVV0 uMx9IFiN/Xio+Pbx4UH4n00HhK9wQljJZpMnBzJdBTw1Gw8mrnJGPF3pTaDO5UQ= X-Google-Smtp-Source: AGHT+IG4o6Yn5vUl781OaAZhuvbmnwlLG9/TmJ93NsAHIltWR7Tebhzu896a3DsWYdgcU18bziiJ7g== X-Received: by 2002:ac2:5b9a:0:b0:512:dfa1:6a1c with SMTP id o26-20020ac25b9a000000b00512dfa16a1cmr3000023lfn.10.1711276996932; Sun, 24 Mar 2024 03:43:16 -0700 (PDT) Received: from localhost ([102.222.70.76]) by smtp.gmail.com with ESMTPSA id f13-20020a056402004d00b005689bfe2688sm1816184edu.39.2024.03.24.03.43.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 03:43:16 -0700 (PDT) Date: Sun, 24 Mar 2024 13:43:12 +0300 From: Dan Carpenter To: Markus Elfring Message-ID: References: <0efe132b-b343-4438-bb00-5a4b82722ed3@moroto.mountain> <08c9f970-3007-461a-b9f9-9ab414024f68@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <08c9f970-3007-461a-b9f9-9ab414024f68@web.de> X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711276997; x=1711881797; darn=lists.osuosl.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=Ribv/O+whBGnqTci5nPx7uHIdlxoMvUZURqWTthedJw=; b=MUuWy7CNff3XIBobU55Fx3UNvoJI3hVsjT0882QiUidukGYidSETrQ+TNNr1zql5Ng viUWdwV7CUk0ByxabftQkm3Qkd1v+iG/lpQkvT8dPMheX0EbtmqhuQXve4EdKYzNAMrz q0I8MnokhjYzW5N/KOLuDytqny/flE+EcFpNk4nE9ZEQ4KinECHIeVAxfwQju/8BcE58 KYWBCEFgpRNk/OJlVUPjy8DzQrkZBoZlyPW3Gx5E5Fbk59C5xydpJt3Jir1Hlj63x+xs LQp15lIs1T15NSFjmPY0OybDZ+Pfk4ijhF7hxv3l6VbxtiqJGWdVV/4hijskNiH/cWk1 NeJg== X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dmarc=pass (p=none dis=none) header.from=linaro.org X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=MUuWy7CN Subject: Re: [Intel-wired-lan] [PATCH v2 net] ice: Fix freeing uninitialized pointers X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel-janitors@vger.kernel.org, smatch@vger.kernel.org, Eric Dumazet , Tony Nguyen , Maciej Fijalkowski , Przemek Kitszel , intel-wired-lan@lists.osuosl.org, Jakub Kicinski , Paolo Abeni , Pucha Himasekhar Reddy , Jiri Pirko , Kees Cook , Lukasz Czapnik , Dan Williams , Andy Shevchenko , netdev@vger.kernel.org, LKML , Julia Lawall , Alexander Lobakin , David Laight , "David S. Miller" , Jonathan Cameron Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" On Sat, Mar 23, 2024 at 05:56:29PM +0100, Markus Elfring wrote: > > Automatically cleaned up pointers need to be initialized before exiting > > their scope. In this case, they need to be initialized to NULL before > > any return statement. > > * May we expect that compilers should report that affected variables > were only declared here instead of appropriately defined > (despite of attempts for scope-based resource management)? > We disabled GCC's check for uninitialized variables a long time ago because it had too many false positives. > * Did you extend detection support in the source code analysis tool “Smatch” > for a questionable implementation detail? Yes. Smatch detects this as an uninitialized variable. regards, dan carpenter