Message ID | 20200619165010.645925-56-seth.forshee@canonical.com |
---|---|
State | New |
Headers | show
Return-Path: <kernel-team-bounces@lists.ubuntu.com> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49pPxf044yzB4CT; Sat, 20 Jun 2020 02:52:53 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from <kernel-team-bounces@lists.ubuntu.com>) id 1jmKG0-0000JS-CZ; Fri, 19 Jun 2020 16:52:48 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from <seth.forshee@canonical.com>) id 1jmKEj-0007bU-OZ for kernel-team@lists.ubuntu.com; Fri, 19 Jun 2020 16:51:29 +0000 Received: from mail-il1-f197.google.com ([209.85.166.197]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from <seth.forshee@canonical.com>) id 1jmKEi-0006Sq-ND for kernel-team@lists.ubuntu.com; Fri, 19 Jun 2020 16:51:28 +0000 Received: by mail-il1-f197.google.com with SMTP id o12so6897513ilf.6 for <kernel-team@lists.ubuntu.com>; Fri, 19 Jun 2020 09:51:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GW8aNucHHFLoEUw3v2p4Pf8Cy1GhbghS0McjHxyj78c=; b=Xn0Oz+qfN4WDkCbZ9xVGxIk3/LOXBxy9ywE5yMCOPktVf6K4UvggLj1tDL5/0C+lps tLLtZMN6W4qYQGX3ZLaUXd/eNZLzZ3GJvygHk8kxcZVsmQGvR/e+UoxLmDPN1ye7eIcM Cku2YueWK+bfJzSCGK/NjP4yTwO/2SfKhZoDTJVcxRuSftHlQVx+4hH9b1s0A4sIB/qu 7tCSms5IakuL20EQ3pGoL8FfAFfAhK9t1ntisoByvYJCaITKGKw5Zjw2dr0mbl/RT5le KKhbOqNT49cV9EO7idiz6fQjGq2aOFYXMldVD67kdtQokho/PkW8e8K4I+d7HEcrxPoY +4nQ== X-Gm-Message-State: AOAM531sMaJsntzcTFK3UyDkAtFoAzSO71e/W9PVPmHYY9TJiFC6Vqiv sPXBKCKwC45OmNuzajsGLKou+ekSb4Jf0D503KpAj1MAir7CLBIYcy+sx9IP5yn73Iiuayb4W/D bPzLZWb/FU1khy2hVweEo4xRxHiMZ3rouxLLEpYvjNQ== X-Received: by 2002:a92:ca92:: with SMTP id t18mr4780035ilo.132.1592585487576; Fri, 19 Jun 2020 09:51:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBK/s0I6JCKTTITXs8l5IXUUVbH3IA4NBBR44LyhUHb/lGDqzSx1fT/IYgW7TVt4lR6Coftg== X-Received: by 2002:a92:ca92:: with SMTP id t18mr4780015ilo.132.1592585487348; Fri, 19 Jun 2020 09:51:27 -0700 (PDT) Received: from localhost ([2605:a601:ac0f:820:f090:1573:c2fc:6389]) by smtp.gmail.com with ESMTPSA id k5sm3353579ili.80.2020.06.19.09.51.21 for <kernel-team@lists.ubuntu.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jun 2020 09:51:23 -0700 (PDT) From: Seth Forshee <seth.forshee@canonical.com> To: kernel-team@lists.ubuntu.com Subject: [PATCH v2 55/57][X] debugfs: full_proxy_open(): free proxy on ->open() failure Date: Fri, 19 Jun 2020 11:50:08 -0500 Message-Id: <20200619165010.645925-56-seth.forshee@canonical.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200619165010.645925-1-seth.forshee@canonical.com> References: <20200619165010.645925-1-seth.forshee@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions <kernel-team.lists.ubuntu.com> List-Unsubscribe: <https://lists.ubuntu.com/mailman/options/kernel-team>, <mailto:kernel-team-request@lists.ubuntu.com?subject=unsubscribe> List-Archive: <https://lists.ubuntu.com/archives/kernel-team> List-Post: <mailto:kernel-team@lists.ubuntu.com> List-Help: <mailto:kernel-team-request@lists.ubuntu.com?subject=help> List-Subscribe: <https://lists.ubuntu.com/mailman/listinfo/kernel-team>, <mailto:kernel-team-request@lists.ubuntu.com?subject=subscribe> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" <kernel-team-bounces@lists.ubuntu.com> |
Series |
Lockdown updates
|
expand
|
diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c index 9c1c9a01b7e5..d1ec80331414 100644 --- a/fs/debugfs/file.c +++ b/fs/debugfs/file.c @@ -262,8 +262,10 @@ static int full_proxy_open(struct inode *inode, struct file *filp) if (real_fops->open) { r = real_fops->open(inode, filp); - - if (filp->f_op != proxy_fops) { + if (r) { + replace_fops(filp, d_inode(dentry)->i_fop); + goto free_proxy; + } else if (filp->f_op != proxy_fops) { /* No protection against file removal anymore. */ WARN(1, "debugfs file owner replaced proxy fops: %pd", dentry);