Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1678375rdb; Thu, 7 Dec 2023 06:09:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IEOmJ9M6R7tzevfh+tW1ccKDn0HRTtLrP7T2QEKGmgo9/2H1sJn8bh9av+MeEYbHw6zZGW1 X-Received: by 2002:a17:902:900b:b0:1d0:6ffd:cecb with SMTP id a11-20020a170902900b00b001d06ffdcecbmr1872137plp.132.1701958170856; Thu, 07 Dec 2023 06:09:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701958170; cv=none; d=google.com; s=arc-20160816; b=cilvqKKSXKaZgs7Aiph+Oim4/l+RQez4Ouai75Wvm7Unp2pUWHNj7fnwFUPDwdQ8Sx QdlaR0IaxJ0GXLrD6mYyeX0e4WnRjybZYWoL/GIkCe+9fFNHnBJkAndUNT3/NSnFGY1w 32sOFtcjUifwsUsB9yYJjUxx1avOsuQI0YG1S0rjrmd6vNIPxfA5Jv18wRlfacH1tdmj 0JO3ORsREbxBHpFGAMH4Lunsxyv/vPqS2U8qRploubGMFt/c07LdzxpRg6FvuSDtzkiI YoTeOzkyYH2SYT9vCn/ajfrCjedwPXrcCyw1cIkicoZKMc8bzS9iKvSB0uVaTcXvSGDN g5oA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:cms-type:in-reply-to :content-disposition:mime-version:message-id:subject:cc:to:from:date :dkim-signature:dkim-filter; bh=gQOvJwnP4RJmx4q0SMRimq7/pmHWQK9ZyIg5Zdub5FQ=; fh=F+seLicu2+0lodrWqq1yOikAPCIvf0PgOELkKn9NRr4=; b=Rpbi+RRJ3bE2LDrO/RPdMdeo6VVLwq08atALELN+QarJpkRV4EVzlVgai7F7Pov/cI 0EYxbolF/G4VjtC26N3x6znt81mM/i5eKts2TGw0Ml5fimHfSYpgMLLOqGDNJfCNOuXq 82Gk7Ii8tXI7vwS0Gyzj1FmVIcnG/G17cOZHqY+9w07kuwuI7wgNATVe71c3JN5vXXp9 qHq+BDFbHNOwBZcdFVWlqf4iRaQn3lK5ZIUR7NjWvF3CSXhWqfXn+0PJ+GFkVu8dRLr6 qZLlKA5JpRHro8AAgv8f6bfvZlfrU6Sq/XctY9aztPOyVo4NKwSc61kqu6/3sjSOI4OU sCsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=oDc1LQNs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id iw21-20020a170903045500b001d0050e246bsi1183231plb.43.2023.12.07.06.09.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 06:09:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=oDc1LQNs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 02A9B8045C69; Thu, 7 Dec 2023 06:09:28 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442975AbjLGOJE (ORCPT + 99 others); Thu, 7 Dec 2023 09:09:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442831AbjLGOJE (ORCPT ); Thu, 7 Dec 2023 09:09:04 -0500 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E8F210C2; Thu, 7 Dec 2023 06:09:09 -0800 (PST) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20231207140906euoutp01a968583816babe8207af359fc417f762~ekerLmbeQ1200612006euoutp014; Thu, 7 Dec 2023 14:09:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20231207140906euoutp01a968583816babe8207af359fc417f762~ekerLmbeQ1200612006euoutp014 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1701958146; bh=gQOvJwnP4RJmx4q0SMRimq7/pmHWQK9ZyIg5Zdub5FQ=; h=Date:From:To:CC:Subject:In-Reply-To:References:From; b=oDc1LQNsSbjh2qqzpnTX3PNzYKwZMKOewQFOhEL+ClVOX1S6nPstiZLNzzdhPtVS9 +GEVy8GxMWirtMPW+LSPdlH4TA1BdPZE6RZQuDmtCOepWeJIDoQIrlVU5tSBddL/WU DDlobbou1qcAuuXQyaOzt0I9Fs3XmuSyCtPk5B1U= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20231207140906eucas1p1ca0d19aed72cacf9fa18fc8a45a98464~ekeq_-Ztj3009030090eucas1p1r; Thu, 7 Dec 2023 14:09:06 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 37.51.09539.202D1756; Thu, 7 Dec 2023 14:09:06 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20231207140905eucas1p1b4a4b5df08ed08727df6094d9f84dd69~ekeqW7qsv3251532515eucas1p1S; Thu, 7 Dec 2023 14:09:05 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20231207140905eusmtrp2f080007a2612533b23a8b01f3fb466cc~ekeqWGZzi2087320873eusmtrp2T; Thu, 7 Dec 2023 14:09:05 +0000 (GMT) X-AuditID: cbfec7f2-52bff70000002543-61-6571d202bd44 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id B6.61.09274.102D1756; Thu, 7 Dec 2023 14:09:05 +0000 (GMT) Received: from CAMSVWEXC02.scsc.local (unknown [106.1.227.72]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20231207140905eusmtip20883ecdcf0cb7e5beb49b4056b777b70~ekeqKjJA20797807978eusmtip2V; Thu, 7 Dec 2023 14:09:05 +0000 (GMT) Received: from localhost (106.210.248.38) by CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 7 Dec 2023 14:09:05 +0000 Date: Thu, 7 Dec 2023 15:09:03 +0100 From: Joel Granados To: Thomas =?utf-8?Q?Wei=C3=9Fschuh?= CC: Kees Cook , "Gustavo A. R. Silva" , Luis Chamberlain , Iurii Zaikin , Greg Kroah-Hartman , , , Subject: Re: [PATCH v2 03/18] sysctl: drop sysctl_is_perm_empty_ctl_table Message-ID: <20231207140903.dxlazorxcolnhyrf@localhost> MIME-Version: 1.0 Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="etof6dfa6kluo2qz" Content-Disposition: inline In-Reply-To: <20231204-const-sysctl-v2-3-7a5060b11447@weissschuh.net> X-Originating-IP: [106.210.248.38] X-ClientProxiedBy: CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) To CAMSVWEXC02.scsc.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OOu/3qm8sJE1wdcioFpE1FhSOKDp4K+THzfkGawr8TL2JVQ/PsjVnazlxsd3jhV1o5+dKd LZIxWy6uKRGOMKyZylqy2zRloxhf44OJn+/3cX6x+bq3OM9xiW+Uw/9Hcw/tbfDSv6bK/+Tz U6/i02+TbvBF13x6k6nEUpyRaKjFXFScCABZDUT2igMAAA== X-CMS-MailID: 20231207140905eucas1p1b4a4b5df08ed08727df6094d9f84dd69 X-Msg-Generator: CA X-RootMTR: 20231204075236eucas1p150b54f5bca6816fb8130a30496a8dbff X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20231204075236eucas1p150b54f5bca6816fb8130a30496a8dbff References: <20231204-const-sysctl-v2-0-7a5060b11447@weissschuh.net> <20231204-const-sysctl-v2-3-7a5060b11447@weissschuh.net> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 07 Dec 2023 06:09:28 -0800 (PST) --etof6dfa6kluo2qz Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable If you are separating the work for permanently empty directories, you can add this patch to that set. as well as 2/18 Best On Mon, Dec 04, 2023 at 08:52:16AM +0100, Thomas Wei=DFschuh wrote: > It is used only once and that caller would be simpler with > sysctl_is_perm_empty_ctl_header(). > So use this sibling function. >=20 > Signed-off-by: Thomas Wei=DFschuh > --- > fs/proc/proc_sysctl.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) >=20 > diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c > index 8064ea76f80b..689a30196d0c 100644 > --- a/fs/proc/proc_sysctl.c > +++ b/fs/proc/proc_sysctl.c > @@ -48,10 +48,8 @@ struct ctl_table_header *register_sysctl_mount_point(c= onst char *path) > } > EXPORT_SYMBOL(register_sysctl_mount_point); > =20 > -#define sysctl_is_perm_empty_ctl_table(tptr) \ > - (tptr[0].type =3D=3D SYSCTL_TABLE_TYPE_PERMANENTLY_EMPTY) > #define sysctl_is_perm_empty_ctl_header(hptr) \ > - (sysctl_is_perm_empty_ctl_table(hptr->ctl_table)) > + (hptr->ctl_table[0].type =3D=3D SYSCTL_TABLE_TYPE_PERMANENTLY_EMPTY) > #define sysctl_set_perm_empty_ctl_header(hptr) \ > (hptr->ctl_table[0].type =3D SYSCTL_TABLE_TYPE_PERMANENTLY_EMPTY) > #define sysctl_clear_perm_empty_ctl_header(hptr) \ > @@ -233,7 +231,7 @@ static int insert_header(struct ctl_dir *dir, struct = ctl_table_header *header) > return -EROFS; > =20 > /* Am I creating a permanently empty directory? */ > - if (sysctl_is_perm_empty_ctl_table(header->ctl_table)) { > + if (sysctl_is_perm_empty_ctl_header(header)) { > if (!RB_EMPTY_ROOT(&dir->root)) > return -EINVAL; > sysctl_set_perm_empty_ctl_header(dir_h); >=20 > --=20 > 2.43.0 >=20 --=20 Joel Granados --etof6dfa6kluo2qz Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEErkcJVyXmMSXOyyeQupfNUreWQU8FAmVx0f8ACgkQupfNUreW QU+GIAv+KWbc8cruumpWQKvgTgVlEGLGgCJVse3Kfb0DYiRjt3V7lGQZv1RSqezm ZKMsMzljxb1o8OhymJAD1m658hQd/6pqN7z880QwPLQMLRb4SOnO9b0x3uyp+wSH q9hEl77PaAtXa64un9iY363HUrWYhE7yTCCLRJ26WuVLAFypd7ciX7qkxEK12swX s42K1APkW3uenFOoZxSb1HKwxGduFQYnjfaQB7/MWm4zwglExu7y9Xy9OnkavjX8 2QgE0RFSQfBUbf59fBWgMui0NdSNg0T5qFtP3yfyav/W4/BBKZiWl/7vsNPtXQ/v K/rRsOkRxyHtmKu8mZvWoiMhPyyLMWfIuw2KPp2A+QYVVfAfWMhuqJ/9f2UTR/uM Qmn+KW8szcU1WCM6GrG09HRREk82TROTALV0Rq0x1Vm/WF5UXpT2Sqg/Dc+japov iF7oYcAvPsBLIm3B1fPxeWlCx6o/l9XrXHrw8FP6GCAmveb7HMpccFJZtdHRL2h9 bi1HXhWK =NL3C -----END PGP SIGNATURE----- --etof6dfa6kluo2qz--