Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp904792rdg; Fri, 13 Oct 2023 05:02:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF/h34J+0rO1kt50qyHQZy3/Bg1hi30QUFXBsmvVGdxLQjQsxqt/XSxnfiBAcTbeIqH31Pg X-Received: by 2002:a05:6a20:5519:b0:157:609f:6057 with SMTP id ko25-20020a056a20551900b00157609f6057mr21194726pzb.27.1697198541757; Fri, 13 Oct 2023 05:02:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697198541; cv=none; d=google.com; s=arc-20160816; b=ZWdLwaQmsYGQMTBvsTI/qjq6kDhGUnlM+XdgRE7uKSyBgTzlMqCxdxTGNkwTbt5YIB P5J/33n5hY8V5y3MKNJYZ6fmfZBhBlcXRIoceHQIs1fStZgA9NApR18j31F+z9ntm0et AxnkNqAPcpnKmEnUZgi+Jf+6FVKvaky6dkwhxIlrM4t6vMVTLOEdUquRkrCje82DFGeb qKQYCAnRCFSopOHoDiyxsVHV/eVJneZNUnXigf/kshAWjl3bKtM2cLH9EtJyyHATTF2d gtg+nF+4dqj67Sqy3jPYirVzbtqpFDVjYvsXIuhGh5uNawZ4MbrxWl9yf0hCug84qP5A 6OXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=bo9l8YzZYj31whgeJZwl0aCXbS2OJe61xmU4dvv5c+U=; fh=PnBm+4nTPn/Q1MgqeJ/74KqeNfYxvv6poIM4WTwyUIE=; b=MpyoT0hdy/B1eXe7JIimloMVex2rIoQ4Ns56wYKhZ8mk9LrjSgva+b8NVA/z/b5bLp /fxSMPuJEz7PjX5fA5qjNMLo7bJARH0cS1wsiz9r7TPmGXQecUKar63Qq6O8ZEAU28Gu 06Cufi3lytM2880Z/R3FsOUfSNfN8BmW+sa4HC4cFn+ADlmR5MfhdI4yy9OkrKlLBqEW Or6PRTuMsTVkDzREv8KSPJqjtZfW6qW+4d9XHWwwVNHFHoshSb5MYDaVQILqE5noTXpN QMdG+RUifOsVFQqbxvzx4TlcfT2f9nexId/bO6Ok7QaVlZRPikZAl7cb3uvH/WiqRwJc J+nA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rlUxoZCO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id a11-20020a056a000c8b00b006933bf7aedbsi17456575pfv.285.2023.10.13.05.02.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 05:02:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rlUxoZCO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id E789581E554C; Fri, 13 Oct 2023 05:02:18 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231822AbjJMMCB (ORCPT + 99 others); Fri, 13 Oct 2023 08:02:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231362AbjJMMBt (ORCPT ); Fri, 13 Oct 2023 08:01:49 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8D32D5C for ; Fri, 13 Oct 2023 05:01:08 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 17FB2C433C7; Fri, 13 Oct 2023 12:01:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697198468; bh=3oSV4wrD/VI++CPjF8EIFb1o1M+cd24rSplIjiYIWZQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rlUxoZCOMvp9g/HsQZN5dp8ZWPZx6QOhRnZ98IJmckIaJoLyfYZNIzzG3vpb2dJzY DXWomoi7mo5Mu/CFkD0OPChiEzmBmdwwSv4HQiTCN4Omw4D7TLUtroJFMgPj1xtjHg 1cPG9g+YTJoLfLrrcZyw88Ul4XtmcohDdqBUNXiAfP6CL1YJnVRce8HNU0zIOkFaP4 M86iRH6QEqMSHSEw9rGN/0REWO6UJnrCTmSRHNq89QdHYwo3aeJzMwSrev/816v8YS sjMsSHJfRDkFY+gNdPNapi5HNuPnsTSeXtgRVZNDHaEz4Qy8j7ZkFCoGQNcPEKF0yW pzr5DK/7k5Crw== Date: Fri, 13 Oct 2023 14:01:05 +0200 From: Simon Horman To: Anjali Kulkarni Cc: linux-kernel@vger.kernel.org, davem@davemloft.net, Liam.Howlett@oracle.com, netdev@vger.kernel.org, oliver.sang@intel.com Subject: Re: [PATCH v2] Fix NULL pointer deref due to filtering on fork Message-ID: <20231013120105.GH29570@kernel.org> References: <20231011051225.3674436-1-anjali.k.kulkarni@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231011051225.3674436-1-anjali.k.kulkarni@oracle.com> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Fri, 13 Oct 2023 05:02:19 -0700 (PDT) On Tue, Oct 10, 2023 at 10:12:25PM -0700, Anjali Kulkarni wrote: > cn_netlink_send_mult() should be called with filter & filter_data only > for EXIT case. For all other events, filter & filter_data should be > NULL. > > Fixes: 2aa1f7a1f47c ("connector/cn_proc: Add filtering to fix some bugs") > Reported-by: kernel test robot > Closes: https://urldefense.com/v3/__https://lore.kernel.org/oe-lkp/202309201456.84c19e27-oliver.sang@intel.com__;!!ACWV5N9M2RV99hQ!PgqlHq_nOe_KlyKkB9Mm_S8QstTJvicjuENwskatuuQK05KPuFw-KvRZeOH8iuEAMjRhkxEMPKJJnLcaT8zrPf9aqNs$ For the record, this got a bit mangled. I believe it should be: Closes: https://lore.kernel.org/oe-lkp/202309201456.84c19e27-oliver.sang@intel.com/ Also, there is probably no need to resend because of this, but no blank line here, please. > Signed-off-by: Anjali Kulkarni > --- > drivers/connector/cn_proc.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/connector/cn_proc.c b/drivers/connector/cn_proc.c > index 05d562e9c8b1..01e17f18d187 100644 > --- a/drivers/connector/cn_proc.c > +++ b/drivers/connector/cn_proc.c > @@ -104,13 +104,13 @@ static inline void send_msg(struct cn_msg *msg) > if (filter_data[0] == PROC_EVENT_EXIT) { > filter_data[1] = > ((struct proc_event *)msg->data)->event_data.exit.exit_code; > + cn_netlink_send_mult(msg, msg->len, 0, CN_IDX_PROC, GFP_NOWAIT, > + cn_filter, (void *)filter_data); > } else { > - filter_data[1] = 0; > + cn_netlink_send_mult(msg, msg->len, 0, CN_IDX_PROC, GFP_NOWAIT, > + NULL, NULL); > } > > - cn_netlink_send_mult(msg, msg->len, 0, CN_IDX_PROC, GFP_NOWAIT, > - cn_filter, (void *)filter_data); > - I am wondering if you considered making cn_filter slightly smarter. It seems it already understands not to do very much for PROC_EVENT_ALL. > local_unlock(&local_event.lock); > } > > -- > 2.42.0 > >