Received: by 10.223.185.116 with SMTP id b49csp308244wrg; Tue, 20 Feb 2018 21:49:37 -0800 (PST) X-Google-Smtp-Source: AH8x225YZalAYQR5SR2n9VfOhaC94mXaphoT7RdaoPAbdj6eFb2egVKmfRuX0jVMCy92mRBj0fcE X-Received: by 10.98.91.5 with SMTP id p5mr2125135pfb.163.1519192177291; Tue, 20 Feb 2018 21:49:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519192177; cv=none; d=google.com; s=arc-20160816; b=Y44BBim3ZsbDSroRq6n0fGrZCj12DGwGYOUXdMMfgR8S+87+cPD5uTGmxnAicGyYBK kf3vKbyon4efIer0ISo/QAhz2MYIBN8wz5OSshsO5NnmnX508c9LDmyHlbPd9GrEvt68 mtCvES+QomIkshSyiz3nuFPLBXpL8jYsPLoWNxk89P1ecdZswSD2nQUDFbdi0ifWhzhF RvD0V4IaVvVSH2eRY0prwclO/9mnomZ66eDla7hEjzOrBkDsWm+HdkljZfrxO/401Eaj 5+URZNf90wYTgFFtMgVs4YnH4aHPXNpf4tcNcUURuCCLvlvfDo4988f81ojm+uwak88E cp4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:to:from:subject:message-id :dkim-signature:arc-authentication-results; bh=lwFFLOkNYO8yNU4D+wEI1IPn++0M4SZ6MkgFNePHMME=; b=iFpTWOItLV+yU+xzkpXGOR7Cr5Rh9n2WZCizgbltUjI92OBohouNErjWWEyqXILr7E PG8FaYdMpnHJLjG/LxlIkj/nuuv1P5sgO3/DhaPVqHYk+tPmQMLcl1NE17XXvNzLwM/R v38F0c5l2vWU4QMrGzADgvJjQxzMW0cZFC8vPsKerOaPgIuYDIhkAq8WgmZTVn6uzOk3 wI/WFVXcwSDJDgeBGJK0l5GBKR1u6f4i1PpLzc25sLngPF5aY5qkTqnvaugawlMOOYcl uec0wLZaYUrdyL9mFZlXnayuKvk9awcXl2Bfl1oo4qEXoZZcEeEHOkMYiHAYZD8/5KB3 1OQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=G7P8C1wA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n65si202176pfn.179.2018.02.20.21.49.23; Tue, 20 Feb 2018 21:49:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=G7P8C1wA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751530AbeBUFrd (ORCPT + 99 others); Wed, 21 Feb 2018 00:47:33 -0500 Received: from mail-io0-f195.google.com ([209.85.223.195]:36399 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750738AbeBUFrb (ORCPT ); Wed, 21 Feb 2018 00:47:31 -0500 Received: by mail-io0-f195.google.com with SMTP id t22so885296iob.3; Tue, 20 Feb 2018 21:47:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:date:in-reply-to:references:mime-version :content-transfer-encoding; bh=lwFFLOkNYO8yNU4D+wEI1IPn++0M4SZ6MkgFNePHMME=; b=G7P8C1wArf2kjzlTfO72UXBBTDzztMIXtpoFbKLlO76Yw+wwb7Jv4W4Jcqr55C5lxW /fkREGGu6iiaxsTglofFb1pjo4ck8dIicSSVZ/rb7ZVAJpsrtvxWbc7PxgCtmYk1QjA2 i3Ypl+AwkUaaeS3K7uvByUs/3NEcV2qLD2Z4P6zdTMVXpBmsctESZGhWvkJdpe/wqyaE u3Q2wiiBclxcAdk2xDT2OPVt5n/JIs8Nbp4gzF34jXLXlJfnGabLKYTApCfma/VxU0Mr I/DQF+B6gJkUz7haWDRnDeTdR/fjauKDx0BDKQQ6BFtl3gFUSqY4HOE8Tse9B5/0RFdH K/BQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=lwFFLOkNYO8yNU4D+wEI1IPn++0M4SZ6MkgFNePHMME=; b=ZZn7uhQMB6jGRU8aYW8afpeA4mqbJNeCEPuYS0Idi2c6rgWy9UbuyuumO1kNVgaXl3 7qhepA6kJZb4fi+bL+5rJq1yiUruuo6AK/dkalkyk0Pz938QcgSAbqd3cQq4IGmD8j57 XWpp+3IRR3/BIrurNONF7FQK/UkKbdjUvv3sRySdbaQVj91KfSPea5SnZMFMGJ2t3Yhr hDmaDBpUWkfOTUO7KcseKMFkqi9R5Z9U+I5I2uUOU+HxJKLZQbokFR5ve1GQF/xhVZmi Bav98cmYycglnGGHdPat1T0iKL0P5D4KKwHQfIrLwDlbY4b2idFNj5OO4/C/WBj75vwa QpdA== X-Gm-Message-State: APf1xPAoBKd0Y3UeSpKRSCr6f0cQ6Vc4SnYkasQsrfWcbvrAS9dUWxC3 4EYil/LrvxtHMW862j8kNDY= X-Received: by 10.107.242.14 with SMTP id q14mr2851347ioh.240.1519192051266; Tue, 20 Feb 2018 21:47:31 -0800 (PST) Received: from edumazet-glaptop3.lan (c-67-180-167-114.hsd1.ca.comcast.net. [67.180.167.114]) by smtp.googlemail.com with ESMTPSA id 189sm4042940iob.55.2018.02.20.21.47.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 20 Feb 2018 21:47:30 -0800 (PST) Message-ID: <1519192048.55655.35.camel@gmail.com> Subject: Re: [PATCH] netlink: put module reference if dump start fails From: Eric Dumazet To: "Jason A. Donenfeld" , davem@davemloft.net, johannes.berg@intel.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Date: Tue, 20 Feb 2018 21:47:28 -0800 In-Reply-To: <20180221034159.14685-1-Jason@zx2c4.com> References: <20180221034159.14685-1-Jason@zx2c4.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6-1+deb9u1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2018-02-21 at 04:41 +0100, Jason A. Donenfeld wrote: > Before, if cb->start() failed, the module reference would never be put, > because cb->cb_running is intentionally false at this point. Users are > generally annoyed by this because they can no longer unload modules that > leak references. Also, it may be possible to tediously wrap a reference > counter back to zero, especially since module.c still uses atomic_inc > instead of refcount_inc. > > This patch expands the error path to simply call module_put if > cb->start() fails. > > Signed-off-by: Jason A. Donenfeld > --- > This probably should be queued up for stable. When was the bug added ? This would help a lot stable teams ... Thanks.