Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp614420pxa; Thu, 27 Aug 2020 10:54:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhabD8NJ71ZprpR+7zBM4ugD28domh3N1p/YpLdMDCajVxkCTVsuBOg0N/5jYzL4GzH1bY X-Received: by 2002:a17:906:6608:: with SMTP id b8mr21591192ejp.317.1598550847860; Thu, 27 Aug 2020 10:54:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598550847; cv=none; d=google.com; s=arc-20160816; b=sYBqqYQK29RBc4iYJ1lzviFBVM2di/UVc/nV4IJKD2HoI4q0VNSbpWORb3ryHqsL1L 3Ofsvl0qSJYKyh5ybsowczqL8eQriHtuh9C9NmT7hBXB/krAQzLhV/p0KkjIDzNLroxz pIHFpry2lQ2oa02tkF/89sQQMpcVeG8agdeSLHGdS/v9xprgrSeVVmdMlXVW1am76J1B qx8vmBMTZXP+24QQVMvY1EbYgvCnU7tdon9h3JZJq4qhmDBnVq5n4CsKG4TaE79zVSKx GxoMxTmcN6BhjRvYr1mTGg/sty2kkAVzTCNBJn0iYVicn42VkNrwKhXV9K/3DRfMcpeK RbhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=b/SqgsWTsXb0lAU8siKr5ztfJwzAssbL+oJi/YbwiHA=; b=OzXfldsQ5sy1hpjXstoYofV+ZOOqKl4hI6UgXysQsnlNqEoQ3haukDmN+9qoHyWOf8 hSK7pkyFh1Cy657vaFoSuRIqC4Mlm6O9a9d4RQjGkCZMIbaL1+k7NXiSqvu/pdMYPAPw EHP/oceyYSXWRLV0auMUSyVBVsc9FFK0D93eItPMJ7ws0rlKNMo+QCkXjD/HzPVC2sbA y8JyxIkv6eMbnNHjgFrKbcaE5OXj/hUyvPiDRnFnfpmUdpVxLrTOJxrdfqjBTZbZtuKg i1LwGCCJb7Fu/m6COOZSCdkJyX008wEJdl6zm2QyXeTvYTqwWSn5chmRLuO5yilFwp+0 80xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=EqsgqqAc; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l23si1865499ejb.496.2020.08.27.10.53.45; Thu, 27 Aug 2020 10:54:07 -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=@chromium.org header.s=google header.b=EqsgqqAc; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726878AbgH0Rue (ORCPT + 99 others); Thu, 27 Aug 2020 13:50:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726236AbgH0Rud (ORCPT ); Thu, 27 Aug 2020 13:50:33 -0400 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A72D3C061264 for ; Thu, 27 Aug 2020 10:50:32 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id o68so242526pfg.2 for ; Thu, 27 Aug 2020 10:50:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=b/SqgsWTsXb0lAU8siKr5ztfJwzAssbL+oJi/YbwiHA=; b=EqsgqqAct0LzsIgirTyObWdj5tHI8+KgB9NSPeSYMO10Ye/pXUa8Eiui0nReAip/gw 8gTsgoiPhgewoZFInWgvSHQrixdPD3vIaeQptrt6UzPV61WxLq9AjRK5rhN3uJKoocWK 8Zflarg0F905B8wAM0GXvkpo47/VJdSMsYxJw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=b/SqgsWTsXb0lAU8siKr5ztfJwzAssbL+oJi/YbwiHA=; b=QKgnk6h38cV8Z7Q79Yu/9ZL/JmMsCHUhp3yd8NeBjPbnjS12Fm3VmRpw6yKuoXAl+/ NFLlPRhK9K8109UwNmK7lK3vz4UIPK4vFe9hWaP01jvlgFCzq9jD4nh5jatCERIXqlcr AFW0dmFMi2e9m9LCynBu2pmHMniLc0WRC9veX90T9wHmgPP5mBgRQ9DW2pwu7KBuGI+b 7Fe/SVka9kwYd+ewEcIDjE3wzP0TxUO7I46y/iwmAReJCsouIsYU9hp6gO81WvlISxgN 7VTPg2aMjoH+ucPjQx9MZsMLEmc6TE6J3Q0vU26mwB/jiytOwc0fD79ZkznBXMaPms3g U8Ew== X-Gm-Message-State: AOAM533VYGfkA5M+Aj/4JNfATtEU7Mah13tnHbQgXomywVQ4T+gwChHw NYrUP1SqwWPCwjOr6mLiN0qx0w== X-Received: by 2002:aa7:850b:: with SMTP id v11mr17467146pfn.240.1598550632247; Thu, 27 Aug 2020 10:50:32 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id g17sm2676168pjl.30.2020.08.27.10.50.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Aug 2020 10:50:31 -0700 (PDT) Date: Thu, 27 Aug 2020 10:50:30 -0700 From: Kees Cook To: Greg Kroah-Hartman Cc: Allen Pais , torvalds@linux-foundation.org, akpm@linux-foundation.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, "James E . J . Bottomley" , Jens Axboe Subject: Re: [PATCH] linux/kernel.h: add container_from() Message-ID: <202008271050.009BE3795@keescook> References: <20200827013636.149307-1-allen.lkml@gmail.com> <202008261929.A50D0DB3E8@keescook> <20200827121941.GC420527@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200827121941.GC420527@kroah.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 27, 2020 at 02:19:41PM +0200, Greg Kroah-Hartman wrote: > On Wed, Aug 26, 2020 at 07:31:40PM -0700, Kees Cook wrote: > > On Thu, Aug 27, 2020 at 07:06:36AM +0530, Allen Pais wrote: > > > Introduce container_from() as a generic helper instead of > > > sub-systems defining a private from_* API > > > (Eg: from_tasklets recently introduced in > > > 12cc923f1ccc: Tasklet: Introduce new initialization API) > > > > > > The helper is similar to container_of() in argument order > > > with the difference of naming the containing structure instead > > > of having to specify its type. > > > > > > Suggested-by: James E.J. Bottomley > > > Suggested-by: Greg Kroah-Hartman > > > Suggested-by: Jens Axboe > > > Signed-off-by: Allen Pais > > > > Acked-by: Kees Cook > > > > Who can carry this so it can get used by multiple trees? Should I keep a > > git branch folks should merge when taking Allen's conversion patches? > > I can put it in my driver core tree, and give everyone a stable, signed, > tag to pull it from so that it can get propagated everywhere, if that > makes it easy for others to use it now. Thank you; that would be lovely. :) -- Kees Cook