[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230613104351.GG169438@aspen.lan>
Date: Tue, 13 Jun 2023 11:43:51 +0100
From: Daniel Thompson <daniel.thompson@...aro.org>
To: Thomas Zimmermann <tzimmermann@...e.de>
Cc: daniel@...ll.ch, javierm@...hat.com, sam@...nborg.org,
deller@....de, geert+renesas@...der.be, lee@...nel.org,
jingoohan1@...il.com, dan.carpenter@...aro.org,
michael.j.ruhl@...el.com, linux-fbdev@...r.kernel.org,
dri-devel@...ts.freedesktop.org, linux-sh@...r.kernel.org,
linux-omap@...r.kernel.org, linux-staging@...ts.linux.dev,
linux-kernel@...r.kernel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH v2 38/38] fbdev: Make support for userspace interfaces
configurable
On Mon, Jun 12, 2023 at 04:08:16PM +0200, Thomas Zimmermann wrote:
> Add Kconfig option CONFIG_FB_DEVICE and make the virtual fbdev
> device optional. If the new option has not been selected, fbdev
> does not create files in devfs, sysfs or procfs.
>
> Most modern Linux systems run a DRM-based graphics stack that uses
> the kernel's framebuffer console, but has otherwise deprecated fbdev
> support. Yet fbdev userspace interfaces are still present.
>
> The option makes it possible to use the fbdev subsystem as console
> implementation without support for userspace. This closes potential
> entry points to manipulate kernel or I/O memory via framebuffers. It
> also prevents the execution of driver code via ioctl or sysfs, both
> of which might allow malicious software to exploit bugs in the fbdev
> code.
>
> A small number of fbdev drivers require struct fbinfo.dev to be
> initialized, usually for the support of sysfs interface. Make these
> drivers depend on FB_DEVICE. They can later be fixed if necessary.
>
> v2:
> * set FB_DEVICE default to y (Geert)
> * comment on {get,put}_device() (Sam)
> * Kconfig fixes (Sam)
> * add TODO item about FB_DEVICE dependencies (Sam)
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@...e.de>
> Acked-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> Reviewed-by: Sam Ravnborg <sam@...nborg.org>
> ---
> Documentation/gpu/todo.rst | 13 ++++++++
> drivers/staging/fbtft/Kconfig | 1 +
> drivers/video/fbdev/Kconfig | 13 ++++++++
> drivers/video/fbdev/core/Makefile | 7 +++--
> drivers/video/fbdev/core/fb_internal.h | 38 ++++++++++++++++++++++++
> drivers/video/fbdev/omap2/omapfb/Kconfig | 2 +-
> include/linux/fb.h | 2 ++
> 7 files changed, 72 insertions(+), 4 deletions(-)
>
> diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
> index 68bdafa0284f5..f226f934ca5af 100644
> --- a/Documentation/gpu/todo.rst
> +++ b/Documentation/gpu/todo.rst
> @@ -452,6 +452,19 @@ Contact: Thomas Zimmermann <tzimmermann@...e.de>
>
> Level: Starter
>
> +Remove driver dependencies on FB_DEVICE
> +---------------------------------------
> +
> +A number of fbdev drivers provide attributes via sysfs and therefore depend
> +on CONFIG_FB_DEVICE to be selected. Review each driver and attempt to make
> +any dependencies on CONFIG_FB_DEVICE optional. At the minimum, the respective
> +code in the driver could be conditionalized via ifdef CONFIG_FB_DEVICE. Not
> +all drivers might be able to drop CONFIG_FB_DEVICE.
> +
> +Contact: Thomas Zimmermann <tzimmermann@...e.de>
> +
> +Level: Starter
> +
>
> Core refactorings
> =================
> diff --git a/drivers/staging/fbtft/Kconfig b/drivers/staging/fbtft/Kconfig
> index 4d29e8c1014e0..5dda3c65a38e7 100644
> --- a/drivers/staging/fbtft/Kconfig
> +++ b/drivers/staging/fbtft/Kconfig
> @@ -2,6 +2,7 @@
> menuconfig FB_TFT
> tristate "Support for small TFT LCD display modules"
> depends on FB && SPI
> + depends on FB_DEVICE
> depends on GPIOLIB || COMPILE_TEST
> select FB_SYS_FILLRECT
> select FB_SYS_COPYAREA
> diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
> index f82357d4f84da..19eaca5e04283 100644
> --- a/drivers/video/fbdev/Kconfig
> +++ b/drivers/video/fbdev/Kconfig
> @@ -57,6 +57,16 @@ config FIRMWARE_EDID
> combination with certain motherboards and monitors are known to
> suffer from this problem.
>
> +config FB_DEVICE
> + bool "Provide legacy /dev/fb* device"
> + depends on FB
> + default y
> + help
> + Say Y here if you want the legacy /dev/fb* device file and
> + interfaces within sysfs anc procfs. It is only required if you
> + have userspace programs that depend on fbdev for graphics output.
> + This does not effect the framebuffer console. If unsure, say N.
Nitpicking but this *is* documentation so:
s/effect/affect/
Daniel.
Powered by blists - more mailing lists