Message ID | 20200619161621.644540-54-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 49pPBZ2qwmzB47d; Sat, 20 Jun 2020 02:19:02 +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 1jmJjF-0004BC-Jh; Fri, 19 Jun 2020 16:18:57 +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 1jmJhr-0002vJ-R3 for kernel-team@lists.ubuntu.com; Fri, 19 Jun 2020 16:17:31 +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 1jmJhq-0003kh-Cp for kernel-team@lists.ubuntu.com; Fri, 19 Jun 2020 16:17:30 +0000 Received: by mail-il1-f197.google.com with SMTP id x63so6767235ilk.8 for <kernel-team@lists.ubuntu.com>; Fri, 19 Jun 2020 09:17:30 -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=XzwOXmbfK6RgJET7yluQITNNBvpNYT1x45HKFsZumcM=; b=XJ9HHcU8nZFHCQLd14XiwoWR+NX9KZD2QZF7Fpaqbr5uAshz4VO5AfMbu4zO3/vc8J gOjcUpKDuVq7F41ov/8AYGXmaVK56GzzZ8X65URUjx1DixNoyykqcaNq+fjD19gL+cbZ FRWpwSgEmtmzcH59oyCJvWq7el/JYuYZ81IoCsEVJyDbzHEOxokRW+sx+lOfcZPUWXcw RrrbCqc+/uXQRrJTmlVmMG2Uh5deaoEjnJG2qBWcAHgwkJbwP2eGlABXViQ1+M1z3HmM 1eO2XI8bo/kGhcdPz7mM3GajG8uB5sQzbPpI+nBCIkm9vbhbPrVnqjJP5ern6TWHzGDu 0Vbg== X-Gm-Message-State: AOAM533tZPXeWqVxEX4bgx7jBJbRl0y7BoDrqSKdoti3HnzSRLH1DhZx aHHcZjjnKGam2K7sd0kbX5xz/0KuH55B0vAFsP4WLBpcuInKTWHq+K+gv4H7P9whxIbobIkOCWD 1LuSULkPntm39ViPBaxKEl/Hl1nojEDtE/xLrdIst0A== X-Received: by 2002:a05:6638:bd4:: with SMTP id g20mr4452252jad.92.1592583449281; Fri, 19 Jun 2020 09:17:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSCfeJfOT802nVVpd5Xbd26x5tMdK/oGoPwfNx6nwHuB5a6nwCg2IAZQ4q3DsBh5LOk+Comw== X-Received: by 2002:a05:6638:bd4:: with SMTP id g20mr4452234jad.92.1592583448956; Fri, 19 Jun 2020 09:17:28 -0700 (PDT) Received: from localhost ([2605:a601:ac0f:820:f090:1573:c2fc:6389]) by smtp.gmail.com with ESMTPSA id u1sm3494814iol.42.2020.06.19.09.17.28 for <kernel-team@lists.ubuntu.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jun 2020 09:17:28 -0700 (PDT) From: Seth Forshee <seth.forshee@canonical.com> To: kernel-team@lists.ubuntu.com Subject: [PATCH v2 53/57][B] debugfs: unproxify files created through debugfs_create_blob() Date: Fri, 19 Jun 2020 11:16:17 -0500 Message-Id: <20200619161621.644540-54-seth.forshee@canonical.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200619161621.644540-1-seth.forshee@canonical.com> References: <20200619161621.644540-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 8a548bee1b3d..2e86d66f7850 100644 --- a/fs/debugfs/file.c +++ b/fs/debugfs/file.c @@ -842,8 +842,15 @@ static ssize_t read_file_blob(struct file *file, char __user *user_buf, size_t count, loff_t *ppos) { struct debugfs_blob_wrapper *blob = file->private_data; - return simple_read_from_buffer(user_buf, count, ppos, blob->data, - blob->size); + ssize_t r; + int srcu_idx; + + r = debugfs_use_file_start(F_DENTRY(file), &srcu_idx); + if (likely(!r)) + r = simple_read_from_buffer(user_buf, count, ppos, blob->data, + blob->size); + debugfs_use_file_finish(srcu_idx); + return r; } static const struct file_operations fops_blob = { @@ -880,7 +887,7 @@ struct dentry *debugfs_create_blob(const char *name, umode_t mode, struct dentry *parent, struct debugfs_blob_wrapper *blob) { - return debugfs_create_file(name, mode, parent, blob, &fops_blob); + return debugfs_create_file_unsafe(name, mode, parent, blob, &fops_blob); } EXPORT_SYMBOL_GPL(debugfs_create_blob);