Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp792460lqs; Fri, 14 Jun 2024 06:03:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXkQg+NE9ml0XLWmEVUVedNwFepaJNG8m/ZY9q26AJaTX6VAU8Snl0OZJfBMRqg6i1BuI3V1XKK7veVqE3GAtrJZmlf4W5rukjfdiD3Ug== X-Google-Smtp-Source: AGHT+IFTzpmL0Nmr/1wkvgL9GEJSPuMbOwHB+RUGOAgXaKJjL9SGyIGX2C8NiBaaxcNhV4IwZ6sM X-Received: by 2002:a05:6602:2b8d:b0:7eb:91b2:8520 with SMTP id ca18e2360f4ac-7ebeb4b8686mr267337239f.7.1718370218628; Fri, 14 Jun 2024 06:03:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718370218; cv=pass; d=google.com; s=arc-20160816; b=Bwh9bE/EZW24TUVEmPkko1YJJJgipg+JfdsnGtf9LF/jhhhdTNEUoFO3Teii+yK+Sc NmxCV+7kFKF84fihPE4+ThzpO3BL+pY19FMjmabvCBF3v/srRpqmBoBcGUvK1afAw0Jo VTAo4ERo6ZnHlQ4o8OKlEu/1U1kAB3uFW5xzqwnNW0ZQmwjERRKeAVgtSquVFRtJYdiW l23dpo6WM2Oy6oNionVJMLpEqhsskUw8I4Zb4s394Bx6sTLX1kHMhJSaaFHCERzzqT7Y sdJjFZPJD4sxThUWEvYPyb4cW38FSD44TyWfc0T/Pn1LKM7hAwugY0fn5fWWBlNZNv/9 D7EA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:cms-type:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:message-id :subject:to:from:date:dkim-signature:dkim-filter; bh=Cu9Kth/VrhXwdZCe9UNE3CqQju5jHEgy4z5jh3by9oU=; fh=M6jsjS9wQEa0Tdo8ykkKe8uZ3wn3slBUYT+yu2JfP/c=; b=EQoo9FsNy9yqs0QwDsm2lZWIL2ThVUT0Rf/5XMvqwbnJAnB5+oM86YfazDCofnwAM+ q2UGbHjXQOcpObtEK0MUMTX9kJcSe/KUFqajasmXZlR7f0/kf19ZuhOUnsnb0Qd9jtKy 7KVRQz8kHpfFB10CO1b5hyPjkF5yDQLCvDN6nILXIgn0MzaxfDbSYEVILD643BkZ/oCd kZMn/Tp5AcJDM2CNQtzGfv5hzY/OKy3lC3qHHIBv44mz+s1G1dlsU9VQe/CrX2bm684p xWv6k1uqSIBCtrRughjmKGJ0ehstlQQyAg3e81eXbj9r9OnFnbpooTZUTCXu16RDPnbe A8JA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=m81n540M; arc=pass (i=1 spf=pass spfdomain=samsung.com dkim=pass dkdomain=samsung.com dmarc=pass fromdomain=samsung.com); spf=pass (google.com: domain of linux-kernel+bounces-214925-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214925-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 8926c6da1cb9f-4b95693f800si1828232173.69.2024.06.14.06.03.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 06:03:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-214925-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=m81n540M; arc=pass (i=1 spf=pass spfdomain=samsung.com dkim=pass dkdomain=samsung.com dmarc=pass fromdomain=samsung.com); spf=pass (google.com: domain of linux-kernel+bounces-214925-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214925-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 3068028233C for ; Fri, 14 Jun 2024 13:01:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1C44D19ADB6; Fri, 14 Jun 2024 13:01:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="m81n540M" Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0187D19ADA3 for ; Fri, 14 Jun 2024 13:01:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.118.77.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718370082; cv=none; b=JqyKkVCm+wIiZEHNY5+jsiBSHqE1FbmcKR/o7/n2a4/3nX5DAFkpO4EQwIKOS0eNUl+DCFyhouwMOfRSAuFipw4foiSuKEXwQRS3QvL+bXRJgxFS8St14biTIuI3pZy1cAVbgNUaqQH8noew2VYnnse7AMH1LZELtNTmi5aJEDU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718370082; c=relaxed/simple; bh=hMvpZ9tbClbrtkjPDgxqeJECwCWJoQC4gPzaXkKI5VE=; h=Date:From:To:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To:References; b=W8vb1VRPYWe58ca+D61ECCnjBI2xMMp5yH80VZ76Nll10v/K3k3r4lRNjlB//RLypboPqeAxyA/pUSeZMBtnX1GW5IeYN5eZzjyB96SmXux6D4JjIBymFbZMDPbrztu7eKiIPH+Fx670K4tzfkWuxu26AqIEMrRAkVkx/LHZHOg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=m81n540M; arc=none smtp.client-ip=210.118.77.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20240614130118euoutp012959eb5670261c87a336cd0b80455534~Y4HtVXp8Y1546415464euoutp01e for ; Fri, 14 Jun 2024 13:01:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20240614130118euoutp012959eb5670261c87a336cd0b80455534~Y4HtVXp8Y1546415464euoutp01e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1718370078; bh=Cu9Kth/VrhXwdZCe9UNE3CqQju5jHEgy4z5jh3by9oU=; h=Date:From:To:Subject:In-Reply-To:References:From; b=m81n540MYWTAA9ydrCEFZoh5sPrQ3Qz8hD/mLU7LAD8raEfX7M3BXmZ5BQNE8jawp x2EX1wDs8vdMzyNoYeVjXPiiT7JPk4BUINRz0R01I94fu3ui6GGwxfaFoB2/j0Y0In vTwvo8IV4g7FfBTbGoqs6zTLJdzoAtf3QzSOQiik= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20240614130117eucas1p1c39ba449271398be15a5ea68c843d411~Y4Hs5JJlv2271122711eucas1p1P; Fri, 14 Jun 2024 13:01:17 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 57.7C.09875.D1F3C666; Fri, 14 Jun 2024 14:01:17 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20240614130117eucas1p2657abb565497200b6f1425771ae37129~Y4Hsgg1rh0312203122eucas1p2F; Fri, 14 Jun 2024 13:01:17 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20240614130117eusmtrp11437275246ceae19229be6dbc6195987~Y4Hsfyw_q3250832508eusmtrp1L; Fri, 14 Jun 2024 13:01:17 +0000 (GMT) X-AuditID: cbfec7f4-131ff70000002693-9d-666c3f1dc2de Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id B8.D7.09010.D1F3C666; Fri, 14 Jun 2024 14:01:17 +0100 (BST) Received: from CAMSVWEXC02.scsc.local (unknown [106.1.227.72]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20240614130116eusmtip2e539933a9e2dd0d084995254c57ec5fa~Y4HsMU8NA1374913749eusmtip2N; Fri, 14 Jun 2024 13:01:16 +0000 (GMT) Received: from localhost (106.210.248.168) by CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 14 Jun 2024 14:01:15 +0100 Date: Fri, 14 Jun 2024 15:01:10 +0200 From: Joel Granados To: Peter Zijlstra , Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng , Suren Baghdasaryan , "Kent Overstreet" , Andrew Morton , Luis Chamberlain , Kees Cook , "David S. Miller" , "Eric Dumazet" , Jakub Kicinski , Paolo Abeni , , , , Subject: Re: [PATCH 8/8] sysctl: Warn on an empty procname element Message-ID: <20240614130110.rovlk7be2ytkcm6x@joelS2.panther.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20240604-jag-sysctl_remset-v1-8-2df7ecdba0bd@samsung.com> X-ClientProxiedBy: CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) To CAMSVWEXC02.scsc.local (2002:6a01:e348::6a01:e348) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrIKsWRmVeSWpSXmKPExsWy7djPc7qy9jlpBu0vlSzmrF/DZrFmSyOT xZzzLSwWT489Yrc4051rMfv5V2aLC9v6WC327D3JYnF51xw2i3tr/rNanD52gsXixoSnjBaX Dixgsji2QMzi2+k3jBbHew8wWUy+tIDNouWOqYOQx+yGiyweW1beZPLYOesuu8eCTaUem1do eWxa1cnmsenTJHaPEzN+s3gsbJjK7PF+31U2j8+b5AK4o7hsUlJzMstSi/TtErgyju48ylhw iKtiwoQpzA2Mezi6GDk4JARMJE4/AzK5OIQEVjBK3P68i6mLkRPI+cIoceGGM0TiM6PE17Yz YAmQhjn/mpggEssZJZbun8sOV7X04V1mCGcro8TLia0sIDtYBFQltk6QBulmE9CROP/mDliN iEAvq8T/LacZQRLCAk4SE7ZNB1vBK+Ag0bRpLSOELShxcuYTFhCbGah5we5PbCAzmQWkJZb/ 4wAJcwq4S/y/eIkN4jplieWnZzJD2LUSp7bcArtUQuASp8SqhkOsEAkXiVcLtjFC2MISr45v YYewZSROT+5hgWiYzCix/98HdghnNaPEssav0ACwlmi58gSqw1Fi8/R+VkhI8knceCsIcSif xKRt05khwrwSHW1CENVqEqvvvWGBCMtInPvEN4FRaRaSL2ch+XIWwpcLGJlXMYqnlhbnpqcW G+WllusVJ+YWl+al6yXn525iBKbC0/+Of9nBuPzVR71DjEwcjIcYJTiYlUR4Zy3MShPiTUms rEotyo8vKs1JLT7EKM3Bo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9ZLzczcxAmN/27Gf W3Ywrnz1Ue8QIxMH4yFGCQ5mJRHeWQuz0oR4UxIrq1KL8uOLSnNSiw8xmgK9P5FZSjQ5H5h8 8kriDc0MTA1NzCwNTC3NjJXEeT0LOhKFBNITS1KzU1MLUotg+pg4OKUamNT+r56rsGbGjJeF On6TZnsEztogKpO/sPfl5yw/t9id3dNUK1Y9uFpg4f/EpNYn6PYciRPiksf/df4Td47LlpcU m1HjbVHbL23yUdJN5nTawzvLLxw/2n0xu0BOy5ElSSX2hKKzQuupTbqTZl9r/s9W16yn/ULz 1NTaydznVWe8CGK8yl6Ra3Dv59RDqSoXgnwElbe7aPY/37G06N6rBZVd05d4nun6GRYkMGFR nb29SL1trHXyhVkCTEZnNR4+jXhudVLksOGWG8km7S90X3Uzbpa+rZ985Nwm4QWvEqa6HbWz uslzb34z4/TuvUbtPx2/PPTRnPTzrPtsydmyh7XvP9Q0kjjx9G6avkngNiWW4oxEQy3mouJE AF8X9TCGAwAA X-CMS-MailID: 20240614130117eucas1p2657abb565497200b6f1425771ae37129 X-Msg-Generator: CA X-RootMTR: 20240604063006eucas1p144c1d1a90606e5cd0c1852c6270ed3e1 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20240604063006eucas1p144c1d1a90606e5cd0c1852c6270ed3e1 References: <20240604-jag-sysctl_remset-v1-0-2df7ecdba0bd@samsung.com> <20240604-jag-sysctl_remset-v1-8-2df7ecdba0bd@samsung.com> On Tue, Jun 04, 2024 at 08:29:26AM +0200, Joel Granados via B4 Relay wrote: > From: Joel Granados > > Add a pr_err warning in case a ctl_table is registered with a sentinel > element containing a NULL procname. > > Signed-off-by: Joel Granados > --- > fs/proc/proc_sysctl.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c > index 806700b70dea..f65098de5fcb 100644 > --- a/fs/proc/proc_sysctl.c > +++ b/fs/proc/proc_sysctl.c > @@ -1119,6 +1119,8 @@ static int sysctl_check_table(const char *path, struct ctl_table_header *header) > struct ctl_table *entry; > int err = 0; > list_for_each_table_entry(entry, header) { > + if (!entry->procname) > + err |= sysctl_err(path, entry, "procname is null"); > if ((entry->proc_handler == proc_dostring) || > (entry->proc_handler == proc_dobool) || > (entry->proc_handler == proc_dointvec) || > > -- > 2.43.0 > > To add to this check, I sent out a static analysis check to smatch in such a way that a warning will be printed out if there is a ctl_table element with a procname or prog_handler that are NULL. You can see it here https://lore.kernel.org/all/20240614-master-v1-1-c652f5aa15fb@samsung.com/ Best -- Joel Granados