From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C0ED0188A09 for ; Tue, 10 Sep 2024 08:13:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725955987; cv=none; b=i0mJ7Cfha7cv/f+ghLZ0LgRlA4JSAbn94AeTwV/EXsLy1NgOcLYT8fJl/50y2586Hvp2wni9vgKAW8jeNJ6hqt4VOb8t95WFCPYZp938QezOZ23pMl7GdftLNbYimiAwsyUHXmuKfqyHWVHssFHbXfuOQDTVFwrLfHxTXGWPOAg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725955987; c=relaxed/simple; bh=ApYz6Ufh7wiXgEhi9x8riKL8Lf0uI77QJCC4Ud/fcLU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=eob+wZTfHpvrqCC+VWXxPVaXQSHnn2l2CU2u5FaWoyDCkDXUfA++XD174OIot3ZE/eIrEa2plgyaM3JPZm7sL8EUyitiQWHgZar/E/5XlToEOll34P49cqu4gsuJYSz1YecTHtCRN0/EVYOocSvvLCHTdZfHfGamWs0XXKwgOk0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=citrix.com; spf=pass smtp.mailfrom=cloud.com; dkim=pass (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b=POd1+WIB; arc=none smtp.client-ip=209.85.208.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=citrix.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cloud.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b="POd1+WIB" Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-5c245c62362so6676073a12.0 for ; Tue, 10 Sep 2024 01:13:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1725955983; x=1726560783; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=ZrAkDLaXld3+MjEVbLTf0QH6amL7yZTph2uE3DVa+eA=; b=POd1+WIBRCAlTgtx+gMwrut22EwNO8TJVe/qpNU1h8FONE+AIljlCcMz+T8g+2UsNr /VE3ffvRV4RWUjhX1eljynqJ3dKuh6VjKYMEjCx5bSEp9CqnOvmFkrrpoxnHjd2iYSlx nrsDEfls2qwJEcgU+YVmwoi0n7FEy76kfdYqg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725955983; x=1726560783; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ZrAkDLaXld3+MjEVbLTf0QH6amL7yZTph2uE3DVa+eA=; b=Xaib5mz3oSaaWnqRN28Fic3S/NzJVokMlVvBu4TQpNHy3XCy4Mz5zREaj2htO8lRAs KtTDsS6oAny0lBOmemyob5q2q0u5RqmIwXd+IfVYJA4kF0y/s/6k88vLpsdYJYP3tl0u 1hm1daEe1xD89IVM1MZwb4TnCJ45RFIOTJwT9HV8RwWzZL/cHI9QvIingrPoI87B3eD3 CtWLn/7ldxu/Ttvxz6MIUr34Z06Ikga6LkRekxDL3UISXxwmbru6is4AsYoCXdZqcr8y DtNCqQiCiqBAaQcVWmsHMyvBxbvuCMpmr5UHF9E/8ucnuDIJivqqfd1Iua72loBB80Yp ircw== X-Forwarded-Encrypted: i=1; AJvYcCVIsR5ubPjDQIW4JcDrOd6f55J3WWk3FvSpWLsQSZogI6a0iOZXeBifgQVeI7+XhH5Zs+PHM9U=@vger.kernel.org X-Gm-Message-State: AOJu0YzJ+xKyAZQR8sRCJjyp+M0AsMlsuiMUetGgYXAiNIiJay109Qt2 vUG+0pl33R0eTXG2yRRM3wSVZiQ8T3Ad4ASTJfPReEgHcQ9jxUwV/IkwyXePJgE= X-Google-Smtp-Source: AGHT+IHiB9BjTCtXbGr3lRX9SELZFUb5HLAig7DxMwgiilncoD8W9NU5mPh05hS+XdfHoA6qWwrRQQ== X-Received: by 2002:a17:907:1c23:b0:a8d:4d76:a75e with SMTP id a640c23a62f3a-a8d4d76a983mr600932766b.30.1725955982405; Tue, 10 Sep 2024 01:13:02 -0700 (PDT) Received: from localhost ([213.195.124.163]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8d258354f7sm445482166b.2.2024.09.10.01.13.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2024 01:13:02 -0700 (PDT) Date: Tue, 10 Sep 2024 10:13:01 +0200 From: Roger Pau =?utf-8?B?TW9ubsOp?= To: Thomas Zimmermann Cc: Jason Andryuk , Helge Deller , Arnd Bergmann , Sam Ravnborg , xen-devel@lists.xenproject.org, Jason Andryuk , Arthur Borsboom , stable@vger.kernel.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] fbdev/xen-fbfront: Assign fb_info->device Message-ID: References: <20240910020919.5757-1-jandryuk@gmail.com> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Tue, Sep 10, 2024 at 09:29:30AM +0200, Thomas Zimmermann wrote: > Hi > > Am 10.09.24 um 09:22 schrieb Roger Pau Monné: > > On Mon, Sep 09, 2024 at 10:09:16PM -0400, Jason Andryuk wrote: > > > From: Jason Andryuk > > > > > > Probing xen-fbfront faults in video_is_primary_device(). The passed-in > > > struct device is NULL since xen-fbfront doesn't assign it and the > > > memory is kzalloc()-ed. Assign fb_info->device to avoid this. > > > > > > This was exposed by the conversion of fb_is_primary_device() to > > > video_is_primary_device() which dropped a NULL check for struct device. > > > > > > Fixes: f178e96de7f0 ("arch: Remove struct fb_info from video helpers") > > > Reported-by: Arthur Borsboom > > > Closes: https://lore.kernel.org/xen-devel/CALUcmUncX=LkXWeiSiTKsDY-cOe8QksWhFvcCneOKfrKd0ZajA@mail.gmail.com/ > > > Tested-by: Arthur Borsboom > > > CC: stable@vger.kernel.org > > > Signed-off-by: Jason Andryuk > > Reviewed-by: Roger Pau Monné > > > > > --- > > > The other option would be to re-instate the NULL check in > > > video_is_primary_device() > > I do think this is needed, or at least an explanation. The commit > > message in f178e96de7f0 doesn't mention anything about > > video_is_primary_device() not allowing being passed a NULL device > > (like it was possible with fb_is_primary_device()). > > > > Otherwise callers of video_is_primary_device() would need to be > > adjusted to check for device != NULL. > > The helper expects a non-NULL pointer. We might want to document this. A BUG_ON(!dev); might be enough documentation that the function expected a non-NULL dev IMO. Thanks, Roger.