From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9487BC35671 for ; Sat, 22 Feb 2020 15:24:57 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6863A20684 for ; Sat, 22 Feb 2020 15:24:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="gJ79XxoC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6863A20684 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E7F036E05A; Sat, 22 Feb 2020 15:24:56 +0000 (UTC) Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by gabe.freedesktop.org (Postfix) with ESMTPS id B15836E05A for ; Sat, 22 Feb 2020 15:24:55 +0000 (UTC) Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id CD9AC33E; Sat, 22 Feb 2020 16:24:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1582385094; bh=ilDCvLDvFbjHjXvnAb/eqCXyyqnKAG9hH3M6gIzgmo8=; h=From:To:Cc:Subject:Date:From; b=gJ79XxoChdjtTKZnFzoYBQ3Q+s4oWoGefewITMYxAYh7x+DlOmSpiurq/EDtycr4j owiNfTHQKrEtSr1MT+nSNTOrD/9ic8MN9Is4p9INuBXKjFV2ZPWmuv7AxLe3ESoqMb uWUAXYvRCyynvvpUg6a4DT/eQhJRu4sbL6mXXndc= From: Laurent Pinchart To: dri-devel@lists.freedesktop.org Subject: [PATCH/RFC 0/3] Constify drm_driver Date: Sat, 22 Feb 2020 17:24:27 +0200 Message-Id: <20200222152430.2984-1-laurent.pinchart+renesas@ideasonboard.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kieran Bingham , Thomas Zimmermann Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hello, This patch series makes it possible for DRM drivers to declare their struct drm_driver as a static const. This improves security by avoiding function pointers in writable memory. The change turned out to be fairly easy, with preparation in patch 1/3 that moves the only non-const field out of drm_driver, and patch 2/3 that performs the constification in the DRM core. Patch 3/3 is an example of driver conversion to const drm_driver. If the series is accepted, I'll write a coccinelle patch that handles all drivers. Laurent Pinchart (3): drm: Move legacy device list out of drm_driver drm: Use a const drm_driver through the DRM core drm: rcar_du: Constify drm_driver drivers/gpu/drm/drm_drv.c | 10 +++---- drivers/gpu/drm/drm_pci.c | 38 +++++++++++++++++------- drivers/gpu/drm/drm_vram_helper_common.c | 4 +-- drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 +- include/drm/drm_device.h | 4 ++- include/drm/drm_drv.h | 8 ++--- include/drm/drm_legacy.h | 10 ++++--- include/drm/drm_pci.h | 4 +-- 8 files changed, 49 insertions(+), 31 deletions(-) -- Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel