Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp9438778imu; Wed, 5 Dec 2018 04:58:33 -0800 (PST) X-Google-Smtp-Source: AFSGD/UbOVWWgqUzdHCCCuwDNSSWWR1mYmRZKC4TiHitrwx4Pii1TmvyMt4wswzHD1FAxBy2AmVs X-Received: by 2002:a65:6491:: with SMTP id e17mr20176828pgv.418.1544014713144; Wed, 05 Dec 2018 04:58:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544014713; cv=none; d=google.com; s=arc-20160816; b=cfn0f9urDDku1vrN1JbUxevN4POw9TgNUCSDY2fhDPf2DmbR1DjQqdaeamPnZwXS7w 0o85JKSkELOimz/FSv7o8BN15r2rR1Sc3anlXd1IJ+xUlbOMF31spWtorCNiZf9eDrTY EYn4PC3NPKRCdP7bowIfJRHYuh3J7Co2zbcHyRfEeXMEfyvvGkavu05CNtlr3IJxWOeo 2y5UsgeiyYN8xpp5EGlbptizA7c1vVfCGYFUqRR2RXihrtpoe2nCiMxEDDXdemz7i3pV Hhk3bbSu9pDmw1RBCNju2kjXE8UIODcIifz6QA2d+KoenDUuQBYHGgFd2KU83mSE0izZ uSNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=PC7BrQmEfzWCr8q9sqrXP1JGYWzFjKewPiQemJx1DNk=; b=uE8L6S0pUkkkaUe4q+hypLmYlu8DyK//EZDGwdjPyTF+M/NcLBU6psb/5IxdjxPDmG ECQi8C8J+WUU8R7n82cZUzLgtUfrbcXPYWVDiF2ZuJ2DeEXgYA2WnILEaUe8rZLqq1CS 9aic9uXhjF1G3UevhedZtbRgXPnxOT+47wTONum9O5G1RZuh26Hu7N43HzmVL/Aaz49U Kk0dpPKWoTagg2hQF4paLH1k7JBpmXuqwIliIyAEYdA3mgaXq6YMbuTMWOgtQxlE0BLd 1F4ZGpl61Oy1hqviZBuNYkvABsURPyeH4v6bPfHmViuRK2pSrMHiVMQVK4Stysu7Mb4k Tbdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=REENqno4; 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 k5si9855323plt.111.2018.12.05.04.58.18; Wed, 05 Dec 2018 04:58:33 -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=REENqno4; 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 S1727970AbeLEM53 (ORCPT + 99 others); Wed, 5 Dec 2018 07:57:29 -0500 Received: from mail-pg1-f194.google.com ([209.85.215.194]:45235 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727475AbeLEM52 (ORCPT ); Wed, 5 Dec 2018 07:57:28 -0500 Received: by mail-pg1-f194.google.com with SMTP id y4so8976474pgc.12; Wed, 05 Dec 2018 04:57:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=PC7BrQmEfzWCr8q9sqrXP1JGYWzFjKewPiQemJx1DNk=; b=REENqno4/d51mTHYrue3cldbcPkdxNpHFa4zlIxLPRUUF0JqOYUX/KDggzm0HlXt5W DpFcKoK4dd9U3kGy9zCDS0HnFHhn6TLd7usWD8iPcioywms8swprXSalxof+hBj3U2bz mTVu8U9iQr6Jci5nU1gvFU0gM++wROJsoDbAPInW8A4GHREwxUw3xpJexleDpTH6ifgJ L+Wy8K50ovryqyksFLlN1hctjGsKcHBRBv8AVzmVvTQEiLVdyysYiCJm4P4Y+Yht3/Av We2B+RPLv0W5hkmXgCX3zF3wJEIwtW0cTdqbEZouP2eplC+W/B5tpPTtXvJH6Y9TIMr5 y4RQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=PC7BrQmEfzWCr8q9sqrXP1JGYWzFjKewPiQemJx1DNk=; b=LBt26rJ/zIua9bPappHFz3/PmDkg6a3WD5BRrgqfLWl2KQ15X8LR2pCjU9WEhbdbVp qa2Axstd8512ksiYGprJjIdaPV+bsC2gai2ubQM8QzelRs4gn8frqcBdxILloHl1Rhr1 Ruv/fx/gwrKhrrd3Lx1PwwXpd6SJlYmhld7rZS9hxRErnKiuCqnNJt1mCxUOtzkNi4Hx ZLLIRecMt9eruYziS7ktG1Bd6p7VOoV6bpwYziGj+Ze5yUQtMQyHhemRkw/O0x9olWVm KEafdnzeG/jbecPJ2ICL+MIFrjf05Q7Ccg70XgZbWRMftan7zruZl0qaonDjLD3pS1q2 crRg== X-Gm-Message-State: AA+aEWZ6zWTjKJVxMLGJN8qfXVA+2jIdu2WObj+1gga2gfWM77hIVzbj KWiQeX3yyHJnoUi40Hb0rFo= X-Received: by 2002:a62:4156:: with SMTP id o83mr24133244pfa.72.1544014647578; Wed, 05 Dec 2018 04:57:27 -0800 (PST) Received: from localhost.localdomain ([203.100.54.194]) by smtp.gmail.com with ESMTPSA id q1sm26348898pfb.96.2018.12.05.04.57.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Dec 2018 04:57:26 -0800 (PST) From: Yafang Shao To: pablo@netfilter.org, kadlec@blackhole.kfki.hu, fw@strlen.de, davem@davemloft.net, adobriyan@gmail.com, akpm@linux-foundation.org Cc: netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Yafang Shao Subject: [PATCH 3/5] procfs: fix double drop_sysctl_table() Date: Wed, 5 Dec 2018 20:56:28 +0800 Message-Id: <1544014590-14429-3-git-send-email-laoar.shao@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1544014590-14429-1-git-send-email-laoar.shao@gmail.com> References: <1544014590-14429-1-git-send-email-laoar.shao@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org All of the callers will execute drop_sysctl_table() whatever the callee insert_header() successes or fails. So we can't execute drop_sysctl_table() in insert_header(). Signed-off-by: Yafang Shao --- fs/proc/proc_sysctl.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index 89921a0..9aeb750 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c @@ -241,7 +241,6 @@ static int insert_header(struct ctl_dir *dir, struct ctl_table_header *header) if (header->ctl_table == sysctl_mount_point) clear_empty_dir(dir); header->parent = NULL; - drop_sysctl_table(&dir->header); return err; } -- 1.8.3.1