Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1963965pxj; Sun, 16 May 2021 09:38:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzV+pEIUI5hDcTf1WKickOIm9wQp6OCwvjTDdLbnQaRzkgHjrYA466Esb1kIsINjrEU++o3 X-Received: by 2002:a02:a19c:: with SMTP id n28mr5838266jah.117.1621183136869; Sun, 16 May 2021 09:38:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621183136; cv=none; d=google.com; s=arc-20160816; b=PgxIgfYvTcX12Sp0vg/argPsJEu0vhe0s5BFWifMMes5UBVHmWXOP/EjbKZ52Jyg78 7ZzPr3N5B6zZU0TJUj55cVTMyLXUNT1GvlF21RRPok5HyzFCTICGZ5/XwWfAbf6sMDYT nldQV8zqvOR6NOlHIu0DCUshUavWKfjEsJRSIuzYXr2Hf8w08urcdRCtS0Rhb72kpBRS fC/MxeVWyDGZpPdvLhLYzbDNCagL9LlwiBzDtU+jDvOo3b1N1/X1eJmUs4bU8pVMTEOD 9QRQt8tT18IpkcK7M7+8RPcyzYTAiwpw1oZxTA53YRmqUO2ky/bmpLakZQW1VH4iK//U 1J8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=uKxhfXqsz5KiS3/U8uvLI52MLsIje961R562h2mq3u8=; b=EhCBAAARl6i9d7gmlOB5vwVf4sU3r83kIpefWaoq1Dv1IPFCyzuKH8WXJ2K/ovhQfZ ko+5IR3/4lwzEt7bs1I41vBmsAQ9wgQ63eqeL8LscryH/gEId66bM5yhk+CPmvLa5MZl QKSqdF33zz3iNxWDCrycG7E8k8OZbucPh1jbl/GiRs2YAURbkbl9roxLeY8RJjKLFVs6 llrtEYm+M2TE78zdT3hp1RjaIYqQ1/SyF+WofFn+skWcfSK7f7BnUQyakc6BMp/zkdWB OoYP9bFZn//KD79q8W65JixOb+ufWUgjHb/gtYG1WozgMj+p1A91QuLTv6Q7LqE6sR+S Bkww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ajEVunZo; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k21si15059439ioh.78.2021.05.16.09.38.44; Sun, 16 May 2021 09:38:56 -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=@gmail.com header.s=20161025 header.b=ajEVunZo; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233504AbhEPNCv (ORCPT + 99 others); Sun, 16 May 2021 09:02:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229888AbhEPNCu (ORCPT ); Sun, 16 May 2021 09:02:50 -0400 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1612BC061573; Sun, 16 May 2021 06:01:34 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id y14so1561383wrm.13; Sun, 16 May 2021 06:01:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=uKxhfXqsz5KiS3/U8uvLI52MLsIje961R562h2mq3u8=; b=ajEVunZo3Gvh6N5465bXB+09XeuhSK4MSpnt0cIb6Z/rnwM4cyEZkIcpVpWiw/u/dU 3IzMjNeVU26UNzFu/sHPKsA2YLpRA4t+kTKa1hGW3JO39PHhYj8cSQe6xS26NWtRuv24 hqVvsc/mhZrLlJj/RqePV+wGT68o0pU68sUNsTBdaGqQCSWKo4XMUVFmk5YCNrl7Bb93 ZqpuqhkR8G0rS7CTHAdfq9ybzio/1CDILDQn8/eAfveXmxNy3z7OZcnZvs06t1HS4jzP 7veW8LiHN4oGR0DYVskeD5jFvHHaPEnx66LYPp/OUEwQM003U8U/NJcnIo16QMLQlDo9 Q1RA== 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:user-agent; bh=uKxhfXqsz5KiS3/U8uvLI52MLsIje961R562h2mq3u8=; b=tQiWPjiaXO6Jm38LJ9HA39s4BuyEDzHVFvxuBmpWrK5oHL2R43/WzRRGH/VoOZ1Sva gsLZXlbVdeTDtfxsgo4r3dXj3E1lK4aTc0aMhf9v7pnCz827k+M9BivL8pMhmQ0PMROZ cC78A/RRO5Umtn6uKAud5qlpN+UjYv1gvueZUyrRh05iyqG3fGQwCiP9iqrUs/sWBVMP 741dfam/q9ySveKqWKj7Kb3uPjOixlZPdRx7eZvQpU88HQHliHP36r7dY4bqN1yeGER9 rOTG2RCz4B1kMSY2kWnclxzRwoy7E3XrICzUUl2H6CTm4ZyXGyt4UrhSZI2DlEJ5Kve+ d96g== X-Gm-Message-State: AOAM530RRid2tbYOPYvpyCNvCxhf82xbWLeVe0sqbTNVPaUA9+s7heSq FOCPS9EFW8cKbyptChpz2ys= X-Received: by 2002:a5d:6248:: with SMTP id m8mr69071465wrv.42.1621170092715; Sun, 16 May 2021 06:01:32 -0700 (PDT) Received: from ard0534 ([102.156.106.137]) by smtp.gmail.com with ESMTPSA id u126sm5937911wmb.9.2021.05.16.06.01.31 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 16 May 2021 06:01:32 -0700 (PDT) Date: Sun, 16 May 2021 14:01:29 +0100 From: Khaled Romdhani To: Peter Zijlstra Cc: mingo@redhat.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH-next] sched: Fix Null pointer derefrence Message-ID: <20210516130129.GA32445@ard0534> References: <20210515164645.22849-1-khaledromdhani216@gmail.com> <20210515210238.GG5618@worktop.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210515210238.GG5618@worktop.programming.kicks-ass.net> User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, May 15, 2021 at 11:02:38PM +0200, Peter Zijlstra wrote: > On Sat, May 15, 2021 at 05:46:45PM +0100, Khaled ROMDHANI wrote: > > The 'curr' variable could be NULL and derefrenced by > > pick_next_entity. Fix this by adding a check that prevent > > the invocation of pick_next_entity with a NULL passed argument. > > And why exactly is that a problem? > Within pick_next_entity, we could have 'left = curr'. Thus the function wakeup_preempt_entity which is invoked from pick_next_entity, derefrence the the sched entity 'left' that may be a NULL passed argument.