Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1009762rwd; Tue, 16 May 2023 10:26:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7vM50m2m5qZ+KWLeQg5NZXK59aedY361Xve/44JQ/vUQZtQZeQgHpJue+UpbzOvqXz0ged X-Received: by 2002:a05:6a00:1794:b0:645:b13e:e674 with SMTP id s20-20020a056a00179400b00645b13ee674mr41124026pfg.26.1684258002832; Tue, 16 May 2023 10:26:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684258002; cv=none; d=google.com; s=arc-20160816; b=CV4pSN4D/7V3YWapl1s8Jwsv4fpb7fUy7pW7eY+oSNEDOqcPhAHmAhxhzAtsF4Mrya 8rO/FwvP+yHlzYqd45PGW5QpyOpKcMtvaRToMTiipBCMx3A9FfG47s0og6a+2bo6C8/w 3aXyYLH2EV38jxQyyiSQ5JSLqPemHiubv8M2+V38dKo+g7D5Vl+RDZQEFuQDzWDw+PtV kvxmAlXrSDQ28P4BQQ5cS97q27n6+JtzQdM0dq9e59mv3kqndMLlxt1X+kSWGns9Sqnq vH1ryXsYTZoYM7QIJgyKA91UgXn20O2EL3J62O80Sj0Dh3v6cUOhYSEmfMLaqXXJquI4 nU3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Z+Zp8qcTzyrig1+JoX4NpLUtCcN8UTaoOe4jcw3WnrM=; b=mYhbYrvWeMEdQbDs1Tg06osGrTC8srybOq1J6mQCMqsF+DeGJp/78LLVRPSRLH4DjX C2MYG02C2UIxBWdyw/f88725nEqmr6x3Oknwl9GZjVghgxI1OfejJJJ+ZiIXSWGoYp/u A+w9kAnQd0vFiKiGNX9BW+LdStJ7/4ksV/VBbt90hz+ZMS7FUDM4nORbZ1C2O55Rosu+ ywv213SeASWtA18hc44sWdSoaiQNg23Zw5VJau+kJ8kaYMCQ8eMItmkL4/KW9BHw5d35 K2mAWE94StlwRtn4X2PeTCJP5bJoFDYVXH4edqqgZ5G9reUDEnaPj/GZ5bGdZnn5WURD 5i3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=cPwUb73X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c5-20020a6566c5000000b00517ab01bb8fsi17842159pgw.100.2023.05.16.10.26.30; Tue, 16 May 2023 10:26:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=cPwUb73X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cirrus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231506AbjEPROX (ORCPT + 99 others); Tue, 16 May 2023 13:14:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230391AbjEPROL (ORCPT ); Tue, 16 May 2023 13:14:11 -0400 Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D33E83E4 for ; Tue, 16 May 2023 10:14:10 -0700 (PDT) Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34GFMCql029118; Tue, 16 May 2023 12:14:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=PODMain02222019; bh=Z+Zp8qcTzyrig1+JoX4NpLUtCcN8UTaoOe4jcw3WnrM=; b=cPwUb73XDESm9IQOXInw77uxLtBeS2ZEhy8cqAD7Uc2J73fvOsO8JnmtSvI/JM8Uj7SQ w7dlzh0EG43GbCMXb4yckNShgUzjiaYcIyZvByanw+X3vuPwJ3WPo2idzR/4S+fuaNlI t8gHZFpQoWyBmcSNzKgOgs56EocYEMB49CFh0G4s3mFMNqrw9xnua5Dkorc+cZZCiypG Z2Qa4UOlxpqzLiKlru+JOzFx+h/LHK+hpb6uflDEKOovPioT0REVCZ1rXxukB/D16Uw8 HCND2SxiNH/CHFZTjep/frP9VP0wdmsDp9XsyieOdOpmwn1Gh3Yzl0k0dH4PMdJqUFgM Tw== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3qj6ymvrp9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 May 2023 12:14:05 -0500 Received: from ediex02.ad.cirrus.com (198.61.84.81) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Tue, 16 May 2023 12:14:03 -0500 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by anon-ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Tue, 16 May 2023 12:14:03 -0500 Received: from [198.61.64.66] (EDIN4L06LR3.ad.cirrus.com [198.61.64.66]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id A9E2EB38; Tue, 16 May 2023 17:14:03 +0000 (UTC) Message-ID: <9a1d96ae-23eb-b979-5c85-ffff057f5e5f@opensource.cirrus.com> Date: Tue, 16 May 2023 18:14:03 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: [PATCH 1/5] debugfs: Prevent NULL dereference reading from string property Content-Language: en-US To: , CC: , References: <20230516160753.32317-1-rf@opensource.cirrus.com> <20230516160753.32317-2-rf@opensource.cirrus.com> From: Richard Fitzgerald In-Reply-To: <20230516160753.32317-2-rf@opensource.cirrus.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Proofpoint-GUID: tjmTow5D6Gpr1O0OEqo-Cruc9bjSxskI X-Proofpoint-ORIG-GUID: tjmTow5D6Gpr1O0OEqo-Cruc9bjSxskI X-Proofpoint-Spam-Reason: safe X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 16/5/23 17:07, Richard Fitzgerald wrote: > --- a/fs/debugfs/file.c > +++ b/fs/debugfs/file.c > @@ -878,6 +878,9 @@ ssize_t debugfs_read_file_str(struct file *file, char __user *user_buf, > return ret; > > str = *(char **)file->private_data; > + if (!str) > + return simple_read_from_buffer(user_buf, count, ppos, "\n", 1); > + Oh, this isn't right. I've somehow sent an older version that is missing the call to debugfs_file_put(). Sorry. I'll send a v2 chain.