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 C0E8518893C 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=1725955986; cv=none; b=fBkRYtaN2yNQPuCcwZS/LSkKbX3Hv1bfGXkX/diVA15y/w6LsXm5juV3dKI/D7nt0MJlXeLD1AStU2KTTIiAP0ney5gFY0sdeyXau/l1SoSW2PuObtvSR5WkL2fa200osUZNhydzsHO7mXNjLC6+auEw+KdqNCS8QywXUoJ4c6A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725955986; 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=SSPb0oP3lthsOpxWkHFHlqFKsIuYCYX5Hn/fz1UgnMAiFev2r/OSCkTgiisQTHf+kGAht1B+GFLBFpnLPoVB8AlYBrlArH+AbwkQlKdjwIXY4VbtiVwwq30Snzu8o2C0NmRkFzvH2x2iFpTtnZBpaX7LxVmMqR8hGWEAh5XUY/8= 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-5c24c92f699so5796867a12.2 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=MXE4nV5d6Px+x5U4BirfQ8OJo3p3m2HW+t/UkQXaDxf3PkmUR/4hWtOd/H0LPdQmOg z1bB31nnG/jFFz8ucL8KVtmj/jUUrqlp8QQnvSVq8LCQHJYLrF4M+qZ4LhOKscjnQj2J 6BKu3jLKrfGPbDSgNbfOiopvvCErDu8V8DsXyEEKbnwEpNqM7gmedcvtX8oj0+MDYwbX ILwKTT5dQxv+hZv8lzpnMckYQtX9zO5jG4uKz7VXsIPZU24sclUfEnFIE91fFesgxGcd n65XrYhVvyVwTSees+8lUJgIV8zvzkRqpVbeNex/3pyeC5LqrnNukctrnkASBbX1JKZF dwKA== X-Forwarded-Encrypted: i=1; AJvYcCVxqdVOSd4YA8gpvWKcNbMyoxxTIKVb5AktfzydbOvZBYCKRb/f7vqQXxsbc70taiQSXEYm9jpMowRNoa8=@vger.kernel.org X-Gm-Message-State: AOJu0Yxd9kXw3BNFJbTWJ4vNDDRv7bSIVgnCQjB/LqkTQn061/fI+s10 FvsMpKHBg/9vTVFpvC/Iec+cydbfdP5ti1uyRnxRqGRG0Yn61LDkhsR4Dr8RDzE= 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: linux-kernel@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.