Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp66712lqh; Fri, 3 May 2024 13:37:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU1P3ZSXNQHmNXh7NYRmI3/6Pjm5jw67zeAukRStLgRVUepfvn0/TUcPIPtJqJRq/lTWOkVWlc7BEMj7t9MfYcJl5QKE7iXXAqO3NXbfw== X-Google-Smtp-Source: AGHT+IE8ShpKD725e1R/uR/dSpHcc1kjFR3DX+Ue66DN/8BNOBaZzjJM6r2xuO/D8LEno/dl4HIG X-Received: by 2002:a50:d498:0:b0:572:6ee9:5a37 with SMTP id s24-20020a50d498000000b005726ee95a37mr2336745edi.11.1714768620413; Fri, 03 May 2024 13:37:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714768620; cv=pass; d=google.com; s=arc-20160816; b=m4fMY05TaEvpEbI5J/Z9EV2jzsc01OVM84/6A5yPqqjzUXpKavRrmdz/9wXtJqvqVQ dnB9DNwEFxLJDtDlqc2au+gxlNxulihtDqv+WBQUqiAm87s4kk1aK8HpOBYSNnp4evld UUmuk+o5nZlZrCk23qz/ZESJbwizk/lZYfyzq44BDnFfErMLlxQVW+IuuVPCGH5CZ3tF 8GuPg8eyGR5duqby4rY4Fi/i9MhJf95hu75zbvLLrMd8zmlG7/IcKKl1LMXHOPUhyhwe T5D4V8/Ydrb0RRoXfZYLYlkMjq4h3PDAA5IR/56+BJZUjiJ58l3KFcZVae/ranig1wcq sjMA== ARC-Message-Signature: i=2; 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=SOGaco3fXlUM58da9nIuO+b/VVWLgaUOQsvu5003Nmw=; fh=/WtlonFFlDoxWSSSyeD6Jn2rVWYtuzg0XfdV5x7lYtQ=; b=qDfuJW4Pky06G6DpK9oC+dznnW2/SX8STmLARy7DSKtt7ZY+6nTItInTbzcjkXeBfG KfDwlRH/oYstPDFY5vnT/g0d8IwbbIcpqmZ6y5Xmq9fy9vz5VvLYVYC0MzQw6mdIGu89 1tQIb/BoFxtJf5MdhSY/9RHbUPD/fQS66b9VBxZB68+PPWgADvUdtGJe8iG6xawzMpbx SYxbM9Myyl80VBnnmaif5UGVPgXGR+Fe+FQmv+L8yDkdFWVaRUU5Ad6bGqNKI6Snl1d/ 6UZbnXKjC5CT4A1qCtYm6XnF7H04oD5xTt2MsTUN0b0p/+k7wwEn+K8e+N59XRG4QNfz j3Vw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GD6O8Hin; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-168195-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168195-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id n19-20020aa7db53000000b0057223971c40si1916391edt.30.2024.05.03.13.37.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 13:37:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-168195-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GD6O8Hin; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-168195-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168195-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 515B31F213E0 for ; Fri, 3 May 2024 20:36:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D5D812E65B; Fri, 3 May 2024 20:36:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="GD6O8Hin" Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 13EDD224D4 for ; Fri, 3 May 2024 20:36:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714768606; cv=none; b=aNKnqB+PBeyqqX/t3dEXGda5LFll5R7COLyG8lnsnHctkB6w7EKvH4YiofuHpVQsf0Mcr6ZfWBpkdOUaZ5j6AXSogANJetvumxiG9lpD5ifJTPfs/skZhL6g+AlvZz7cSLc3VboYWM51K4wI1yidACGA7dSTtLveVFtBQY5Mm7o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714768606; c=relaxed/simple; bh=FBZMACvGRXJqMeLEDzDUFBkDEnHe6DAU3slqqPNPaqg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=sAI0TV7FSlLswoJvQUU8pHSQZ87gKlQqMgmUYDCpIu7KAQnXSW/rSDK3ke4U1+bDvj7qCp4LmsVZbQQAyByXr0UH0PlbRSNWL6DRVMZNi5MrADEwNF4gTqWAxn2gVUIf6u8610MQ6MRHGBt1yb6h7HIdxuts4DkBN0B95cslAN8= 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=GD6O8Hin; arc=none smtp.client-ip=209.85.128.49 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 Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-41a1d88723bso1426375e9.0 for ; Fri, 03 May 2024 13:36:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714768601; x=1715373401; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=SOGaco3fXlUM58da9nIuO+b/VVWLgaUOQsvu5003Nmw=; b=GD6O8HinHuMJbamq0ke8yQHFLrkso1UKNXelni7YFcwZ4nHMKCTOFHFx+XSo/YwT7e rIUmuZNa9lZp16ToKr/BqFDOTVsa1pkFY+jRARlqd+7fBCQ8FaUluobC9FLIK6U9TS3d X4aGYYXpy+GDgZVMVfeoA3omLI4MYAXeD8PjzvcLsQjK6INcpdEBwyg6HQg42qsuGYxD GhkUfV04sTBhtErjBeY4sVI43bd8hqtpSjDkJwnOm/0fWIC6ssBAgw1vyDw87+h/Yxw3 tlUffhKU1rMfVz8ULC4hA54CXAXF7p7ybtHEy64U9xE6YcSdpCFtgcRdABGaH+zK6phw +TKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714768601; x=1715373401; h=in-reply-to: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=SOGaco3fXlUM58da9nIuO+b/VVWLgaUOQsvu5003Nmw=; b=sW0qejNtthC3KiPt8axJ8oX9GaylnAa7N84My4cku1DiH1y+gXJuqnPjPfnzCxWGOh eGO8776iu4c5JzaaZjk+KMFQB9bkmaTVkbGUvqkjMhgG8yx6A6J7WMcyQPtsVw/POCri UmNV5VayILLoGS4jgj080a5TGOpJ59LtTfrIaNkyRquGtcluVfPuOQCl2bK2jMEOiTzg GBjDz1KbXBBCLsaFIEXSc51xH848qLW7sOdfuAUnc/W4llSn6+s1BzJCgwldYCU+8W58 C32VhDPlGCpGlT9rg9TTfda8qIMQrMePTVo/r4AzC8yWIa4PdWdnSJdwG+lelae52SKS SDjg== X-Forwarded-Encrypted: i=1; AJvYcCVWvTD248XNXbb7wOaMl9dbIGCcZmthVFz+DHbJOdwu9Rjgc0TQzmhY6aVu7ezgl2GypRmj/SeV7YKP+Up6p2QAFoLB1pC6Xs+iEM2T X-Gm-Message-State: AOJu0YzB+7cGDEFqzZ1i9y1fQlUQ7t6SuJZJUFuERhyErXD53pd4oBZ7 wFUuTMJXeY89iyczU0O5ByLjlGhdCvMELrH8/LU1r0PQktWo8Quy17Exg/PVWyU= X-Received: by 2002:a05:600c:1d26:b0:418:e88b:92c3 with SMTP id l38-20020a05600c1d2600b00418e88b92c3mr3068178wms.2.1714768601152; Fri, 03 May 2024 13:36:41 -0700 (PDT) Received: from localhost ([102.222.70.76]) by smtp.gmail.com with ESMTPSA id r9-20020a05600c35c900b0041bf5b9fb93sm6826049wmq.5.2024.05.03.13.36.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 13:36:40 -0700 (PDT) Date: Fri, 3 May 2024 23:36:37 +0300 From: Dan Carpenter To: Lars Kellogg-Stedman Cc: Duoming Zhou , linux-hams@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, pabeni@redhat.com, kuba@kernel.org, edumazet@google.com, davem@davemloft.net, jreuter@yaina.de Subject: Re: [PATCH net] ax25: Fix refcount leak issues of ax25_dev Message-ID: <78ae8aa0-eac5-4ade-8e85-0479a22e98a3@moroto.mountain> References: <20240501060218.32898-1-duoming@zju.edu.cn> 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=us-ascii Content-Disposition: inline In-Reply-To: Could you test this diff? regards, dan carpenter diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c index 558e158c98d0..a7f96a4ceff4 100644 --- a/net/ax25/af_ax25.c +++ b/net/ax25/af_ax25.c @@ -1129,8 +1129,10 @@ static int ax25_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) /* * User already set interface with SO_BINDTODEVICE */ - if (ax25->ax25_dev != NULL) + if (ax25->ax25_dev != NULL) { + ax25_dev_hold(ax25->ax25_dev); goto done; + } if (addr_len > sizeof(struct sockaddr_ax25) && addr->fsa_ax25.sax25_ndigis == 1) { if (ax25cmp(&addr->fsa_digipeater[0], &null_ax25_address) != 0 &&