Received: by 10.213.65.68 with SMTP id h4csp454398imn; Fri, 30 Mar 2018 08:41:05 -0700 (PDT) X-Google-Smtp-Source: AIpwx49GDfunLwMWYvv+aCNCT02O3rsXMbnZh90YaodjxA/Ykf+K9cnFqv6TcbXynPvbJOa0Cshm X-Received: by 10.98.196.153 with SMTP id h25mr10269775pfk.111.1522424465414; Fri, 30 Mar 2018 08:41:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522424465; cv=none; d=google.com; s=arc-20160816; b=uO5ciIX9ciyaIm1ilo9kXAQ+js0hl587rNS1+UUbpHGs2cZKjuBMIjGSZMFXFGLXAZ YhE2k9KJKcqI5ox6fO+vlxcUcKswWU9wpQiChMoP3AdalmIeO/C3drTQeAsAkPjtxiyz 99DdijUYA2gSvM5tRwLYEGHjhtDz8EEJbAEKFTSMPctimxJzdCndJ2dsgfx3dCOHcPAF 2ThY33zT0fUqtoztb2af4j0w7JQ5DAHZJfo5LRHPKQxbB5qrCdloIhVQB+yJw0HY8prg COWe5fNXl4K5QIJv9esrJWXwrekuqmnS+NNSP01nfzSAo7ft3sgVilQ7Qa7vkFt6pW7k k31w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=5c/+fzoB/K01Ti7iDpx5GSJAkERaBnj510p6c1o8jts=; b=SE0cKzoUGybbjVmohV4bILKxeLjOfbnJAI4kx1gdraw0vvZK0Cu6w3aAdCl7om5mik XeiEleJJzHZbWkGV1qZ14pMEo7ovjQFI/JzlqUAUCRvwSct88FuI1B8tgGLLUckb5Qs0 /4ZALpxJvI94hkaKKksF7fA7HqVL0YOHDblXhfhvFXtEZDEnNHs0YizNdVwlg8ECiJUe +d0qEvQji07nYXW5dg3nyMDHWbBi3JSNnAnlIunsr0Wk+AiD1HR5GC/mYX5f2LgbzSX9 pi0xn4JDekJMe9+DAwwym/XfOr8PRPFNu7984Q66CBy8gur/G+jjz5lwtntkza8YwpYg cJ3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=F7cvHUaC; 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 u6-v6si8427423plm.239.2018.03.30.08.40.51; Fri, 30 Mar 2018 08:41:05 -0700 (PDT) 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=F7cvHUaC; 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 S1752966AbeC3Pdc (ORCPT + 99 others); Fri, 30 Mar 2018 11:33:32 -0400 Received: from mail-ot0-f196.google.com ([74.125.82.196]:40660 "EHLO mail-ot0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752584AbeC3Pd2 (ORCPT ); Fri, 30 Mar 2018 11:33:28 -0400 Received: by mail-ot0-f196.google.com with SMTP id j8-v6so2333010ota.7; Fri, 30 Mar 2018 08:33:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=5c/+fzoB/K01Ti7iDpx5GSJAkERaBnj510p6c1o8jts=; b=F7cvHUaCHHmHH0OUjIb1Lxoi8cC8hRQ+N6hSyK0+lbMpy/pt4OizARvWXu42clKtuq k+rOtYSES/NCU/lGPgGw4doYbkYklZk9q32GwkB+G/Zp6NyRZfTkrjRU/FiZ+R3Eqmby FgRJL6KYFbHu2FkR/6xE223R4uZze2/T/N1cB8IeFdhYqDRSFNOfgoT2tFQrvFUhNFIY 2p/Ikx3EjAwRhnyO/IwZ1TSr5qyTupojBMLAuu5KNuoMHw743smITf/MruPwiFa/d8uM lWaA7aooJ8PN/kaeHosScNUqICwJB1wtINdiotrdXGIfW/IJCYomerwlagYT0/o1jfgr urnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=5c/+fzoB/K01Ti7iDpx5GSJAkERaBnj510p6c1o8jts=; b=PXkWLy2wUrQQ6AzQVSmsHwpaXjdXges9HaEGa5i/99B5ApvGUwjYR2jWv2I1vHYVHC avZFrnObwOh3ZPRvlGTFrrWN//t1HZZrUQvuk+KG9GFCzpF5QDxu15GkTjI4oTL8j5fF yuUcSifzalbcWk/ggAEsba9eKk/pL64B+7VQhzB1HXvn9vWx6uYgZIuLXzq5JtqG9y9K duPGp7wTimuu5uuQiMlmaz/NRiOoSyzU+WwnZbDJO/X3a3nRWy1be80wbauFZCc60yyK mxm9xEUIQnywOxl8lSe93sCcFYlrjqv48ohyI0Dy9xyQdUpo6iIW+W+z4LGibq+nr943 FYeg== X-Gm-Message-State: ALQs6tBMDwXwdh2j0AwPYS0OegImzpr1g0b9H+p7wUf/FB8lbPo0mnZG PGt6sGtc1w1/TzbFEnlpuhRmJU6l81QN4++T0ig= X-Received: by 2002:a9d:2f26:: with SMTP id h35-v6mr7210659otb.61.1522424007641; Fri, 30 Mar 2018 08:33:27 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:6010:0:0:0:0:0 with HTTP; Fri, 30 Mar 2018 08:33:27 -0700 (PDT) In-Reply-To: References: <87po3mxf73.fsf@suse.de> From: Fabio Estevam Date: Fri, 30 Mar 2018 12:33:27 -0300 Message-ID: Subject: Re: [kbuild-all] [PATCH] OPTIONAL: cpufreq/intel_pstate: fix debugfs_simple_attr.cocci warnings To: Julia Lawall Cc: Nicolai Stange , Francisco Jerez , linux-pm@vger.kernel.org, Viresh Kumar , "Rafael J. Wysocki" , linux-kernel , kbuild-all@01.org, Srinivas Pandruvada , 0day robot , Len Brown Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 30, 2018 at 3:22 AM, Julia Lawall wrote: >> From commit 49d200deaa68 ("debugfs: prevent access to removed files' private >> data"): >> >> Upon return of debugfs_remove()/debugfs_remove_recursive(), it might >> still be attempted to access associated private file data through >> previously opened struct file objects. If that data has been freed by >> the caller of debugfs_remove*() in the meanwhile, the reading/writing >> process would either encounter a fault or, if the memory address in >> question has been reassigned again, unrelated data structures could get >> overwritten. >> [...] >> Currently, there are ~1000 call sites of debugfs_create_file() spread >> throughout the whole tree and touching all of those struct file_operations >> in order to make them file removal aware by means of checking the result of >> debugfs_use_file_start() from within their methods is unfeasible. >> >> Instead, wrap the struct file_operations by a lifetime managing proxy at >> file open [...] >> >> The additional overhead comes in terms of additional memory needed: for >> debugs files created through debugfs_create_file(), one such struct >> file_operations proxy is allocated for each struct file instantiation, >> c.f. full_proxy_open(). >> >> This was needed to "repair" the ~1000 call sites without touching them. >> >> New debugfs users should make their file_operations removal aware >> themselves by means of DEFINE_DEBUGFS_ATTRIBUTE() and signal that fact to >> the debugfs core by instantiating them through >> debugfs_create_file_unsafe(). >> >> See commit c64688081490 ("debugfs: add support for self-protecting >> attribute file fops") for further information. Thanks for the detailed explanation, Nicolai! > Thanks. Perhaps it would be good to add a reference to this commit in > the message generated by the semantic patch. Yes, that would be very helpful indeed. Thanks