Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp502676pxy; Wed, 5 May 2021 07:22:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwED02dKkc6b8q4C6LnKae8NuBwfeqCKtFkOWBj5ZXUahn5dmpeRnzNC+JhFTuqguec3f8H X-Received: by 2002:a05:6a00:706:b029:272:19a2:7280 with SMTP id 6-20020a056a000706b029027219a27280mr28503487pfl.8.1620224538744; Wed, 05 May 2021 07:22:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620224538; cv=none; d=google.com; s=arc-20160816; b=jarWvfQiIp35JCHJO7TGD+sYmOAmhJTpcOpablEqpFMyW2nT5tauSOFAUduwcF8nfg 1IMK88XO/uDYRB9VMhuesjcf134SJv9/tCFYfGHjo7VO1jxo5IdhQtmnf7WdBdR/Rz46 Vw+FZikfEMhUj414fda4GUJDuDUC3pohA0czTNVTA3q9G0slWLRETzB01Pa6m9eLQR3s TAXaTHp4rm2wBXCe8AbM6UV6bsj3mY192RWNzDF/L8PlOIQmLjT/kq5P9u5SOlet2Yy0 1iVIZ3Zh9pzFyQoq5xOP9fpCeC+8sVaICH8aO9gMaCe7XcLbDQt8cWzLj5+6hAgiQL18 t1Ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=tgBFW77w+tqXgd2qEhzNM+pBbVN0PtVs2ChlIQlnPok=; b=k5Y3pUoUPx/wdohjUGHj//Hw0dEHvksDJ+rMdRFlyG9lQlSFzxwJOW30iPiyTzdBtd F2zMcT8rOeDL5aPl6CSu2oeTiPcaBtAT8N/Wmnu5cImccUBJehTCHb1Y5edwOOUbGBx/ W/qdV/IeN2gQxf5wsT6hlRvKS3xhls0itEyOLdDZ1YIhL1RJBEVlSPswKRsSox0VpX3w bAwAs1C9MhQMS6HqtMiBHiDRfGZnivvRk32PSO0sG2u4XPGJ2V0653eThX/IZ0tPxeio 7jwrJuHfiQ09ZOLhNcCa+IJfSC+wSp0ldlz5fKETxzH5A/iEE+sL3T/Rlc1tvJCYX0KR Y2/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b="E0/0eSBI"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m14si539116pjq.134.2021.05.05.07.22.05; Wed, 05 May 2021 07:22:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b="E0/0eSBI"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232596AbhEEOVF (ORCPT + 99 others); Wed, 5 May 2021 10:21:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232349AbhEEOVC (ORCPT ); Wed, 5 May 2021 10:21:02 -0400 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32E94C06174A for ; Wed, 5 May 2021 07:20:04 -0700 (PDT) Received: by mail-ej1-x629.google.com with SMTP id n2so3130210ejy.7 for ; Wed, 05 May 2021 07:20:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tgBFW77w+tqXgd2qEhzNM+pBbVN0PtVs2ChlIQlnPok=; b=E0/0eSBIRoJ31aC+hu8b8fyOZgaiGRtak/6pzAv0VlIcRqBObMCPzEZaXsK/R085SU QNqZCv7io+8+UpPtOsLN9Gw4rXmi0D9EryZsIa2vA1H90I/J8J5ndJHnj0tDseLlGO6M O3b/XsVsGpaZUM6vXwEn/H7Tv2knupaQNUjSDhScaGZ1PsXZDRA0Tj/ytUmnqMSU1DKn l3ObaZV7lco5NHEOmSEZCUBEgEk0nWC/300ypBZFaZyfp10kT6K9l7563hSgWEBdYycE jezfZRst235bIHUGmfQyrgMJAUcbYZ5LLabv2eroQrm4eCZ9uDM/4RMX3n2kBNMVthZW iihw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tgBFW77w+tqXgd2qEhzNM+pBbVN0PtVs2ChlIQlnPok=; b=jppN3KZ+fwvuLZBCbZtBoneAYf+Lzxl9RMFP3UISgaiA4jFDlCotwrcNQs3Vl1y29S oBCgdCIDtgSJYcprRitY5fygjfeaPU5359FULP1JU7p0hRxOMzjKa8v98TGvN8B68PZa nfWiryMuBPf2yNFof2DFErGHZK3RX/irx8AjTculhGX+PejwPBTWgTajcZUv0Bm8nd2F xknc9ZW2bavlnrM57tOeCMS24t4hiW5wuE2yEvmJ58K/UMnz5E+YjOM/CkDQhwVtH2H2 76WStxbgwypqIEbRT1rB6su7flDHpnApuq5X+kdcVM5Gep+Kp/IXSD8ANpYksc98ygrM oxxg== X-Gm-Message-State: AOAM533Mf7qUevFJBawlNHsAyEGzKIqUBqezOdq6oV9voOUaVcoas9OR KnOLzgZ53o6yeChDuFKxS49i4sG1rLWhnbyNjlTPgw== X-Received: by 2002:a17:907:78c4:: with SMTP id kv4mr27335251ejc.445.1620224402914; Wed, 05 May 2021 07:20:02 -0700 (PDT) MIME-Version: 1.0 References: <20210502193216.24872-1-brgl@bgdev.pl> In-Reply-To: From: Bartosz Golaszewski Date: Wed, 5 May 2021 16:19:52 +0200 Message-ID: Subject: Re: [GIT PULL] gpio: updates for v5.13 To: Al Viro Cc: Linus Torvalds , Andy Shevchenko , Linus Walleij , "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 4, 2021 at 7:34 PM Al Viro wrote: > > On Tue, May 04, 2021 at 04:17:02PM +0200, Bartosz Golaszewski wrote: > > > Incidentally, if your code critically depends upon some field > > > being first in such-and-such structure, you should either get rid of > > > the dependency or at least bother to document that. > > > That > > > + /* > > > + * Free memory allocated for the pending and live > > > directories > > > + * of committable groups. > > > + */ > > > + if (sd->s_type & (CONFIGFS_GROUP_PENDING | > > > CONFIGFS_GROUP_LIVE)) > > > + kfree(sd->s_element); > > > + > > > is asking for trouble down the road. > > > > > > > I'm not sure if this is a hard NAK for these changes or if you > > consider this something that can be ironed out post v5.13-rc1? > > Rename implementation is simply bogus. You are, for some reason, attaching > stuff to *destination*, which won't be seen by anyone not currently using > it. It's the old_dentry that will be seen from that point on - you are > moving it to new location by that d_move(). So I rather wonder how much > had that thing been tested. And I'm pretty much certain that you are > mishandling the refcounts on configfs-internal objects, with everything > that entails in terms of UAF and leaks. > The interface's stability in user-space has been tested a lot with the test-suite for libgpiod[1] but I didn't look for leaks indeed. > FWIW, I'm not happy about the userland API of that thing (what is supposed > to happen if you create, move to live, then create another with the same > name and try to move it to live or original back from live?), but > Documentation/filesystems/configfs.rst is too sparse on such details. > So I would like to see the specifics on that as well. _Before_ signing > up on anything, including "we can fix it up after merge". Understood. I've sent out a new PR without these changes. I'll start another thread asking for your help on the correct approach and maybe some better ideas for the user interface. Thanks, Bartosz [1] https://patchwork.ozlabs.org/project/linux-gpio/patch/20210429094734.9585-3-brgl@bgdev.pl/