From patchwork Mon Jul 2 08:12:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 10500661 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DAEA760362 for ; Mon, 2 Jul 2018 08:12:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CBE06286F2 for ; Mon, 2 Jul 2018 08:12:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BF01D28768; Mon, 2 Jul 2018 08:12:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 57645286F2 for ; Mon, 2 Jul 2018 08:12:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B18346E2E2; Mon, 2 Jul 2018 08:12:29 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wr0-x244.google.com (mail-wr0-x244.google.com [IPv6:2a00:1450:400c:c0c::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1158F6E2E2 for ; Mon, 2 Jul 2018 08:12:28 +0000 (UTC) Received: by mail-wr0-x244.google.com with SMTP id a12-v6so14529383wro.1 for ; Mon, 02 Jul 2018 01:12:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=nGfIX/EeTaLivif8xiqp9pvhPS41+Y+BpdwFf582lAE=; b=B5rcvRdPy0aeGPdoWh8bNJYzwm0buxLyYIVGSWl8VGgIzuKkiH+UalrfBWUT48Mkgw uaW4c6LrIBjkul8e7lavbvwdS5sO+G95T4HSDOJou2Du69JtVxdPMcC8lOvyFHVj7ToI NCsvKo8vx1tQE/fVzjQ3w3LrHGor6wPx7cuuTZV34qxkioZE+zjkqZVlstKAuNUE96Bn RDJd4fhjhRJzeRB7OhgN6cMYeoqOMRvInO/urRERJVNsNV8m0t0x7HtCg7akRx8VEsJW 0RbgbNf9wK2p/Y23YFDc6nfcTImWYSHUAxI9aIVHQdzaGIDhxlw/yH061Drd/tax8Uw/ twhA== X-Gm-Message-State: APt69E0lJBzjsQlL7hNayMJZqu9MNZdmnJlpm3D0xVWvwW7f+ZWb8Bv/ B8FO6abzbZSy5EtQNmeH4Gwk9A== X-Google-Smtp-Source: AAOMgpfDe6L7xeFQ052FCzW0OGsY+YeHvnmepSbTBVMejRuEQkYah0KdKFfmEWy+9LkL7xbGWda/NQ== X-Received: by 2002:adf:81c5:: with SMTP id 63-v6mr16400739wra.88.1530519146764; Mon, 02 Jul 2018 01:12:26 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:5628:0:496f:7dc5:66d7:a057]) by smtp.gmail.com with ESMTPSA id j131-v6sm7233244wmb.35.2018.07.02.01.12.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Jul 2018 01:12:26 -0700 (PDT) From: Daniel Vetter To: DRI Development Date: Mon, 2 Jul 2018 10:12:21 +0200 Message-Id: <20180702081221.6150-1-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH] drm: Limite blob creation to drm master X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Stone , Daniel Vetter , =?UTF-8?q?Michel=20D=C3=A4nzer?= , Daniel Vetter , Intel Graphics Development Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP This interface allows pretty much unlimited kernel memory allocations, which isn't all that great. But we allow that anyway for any drm master client (through pinning display buffers and stuff, at least for UMA gpus), so just limiting it to the active master seems like a reasonable stopgap measure. Fixes: e2f5d2ea479b ("drm/mode: Add user blob-creation ioctl") Cc: Daniel Stone Cc: Ville Syrjälä Cc: Michel Dänzer Signed-off-by: Daniel Vetter Reviewed-by: Ville Syrjälä --- drivers/gpu/drm/drm_ioctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c index c148eb3be8c2..dc740c381f9e 100644 --- a/drivers/gpu/drm/drm_ioctl.c +++ b/drivers/gpu/drm/drm_ioctl.c @@ -656,8 +656,8 @@ static const struct drm_ioctl_desc drm_ioctls[] = { DRM_IOCTL_DEF(DRM_IOCTL_MODE_OBJ_SETPROPERTY, drm_mode_obj_set_property_ioctl, DRM_MASTER|DRM_UNLOCKED), DRM_IOCTL_DEF(DRM_IOCTL_MODE_CURSOR2, drm_mode_cursor2_ioctl, DRM_MASTER|DRM_UNLOCKED), DRM_IOCTL_DEF(DRM_IOCTL_MODE_ATOMIC, drm_mode_atomic_ioctl, DRM_MASTER|DRM_UNLOCKED), - DRM_IOCTL_DEF(DRM_IOCTL_MODE_CREATEPROPBLOB, drm_mode_createblob_ioctl, DRM_UNLOCKED), - DRM_IOCTL_DEF(DRM_IOCTL_MODE_DESTROYPROPBLOB, drm_mode_destroyblob_ioctl, DRM_UNLOCKED), + DRM_IOCTL_DEF(DRM_IOCTL_MODE_CREATEPROPBLOB, drm_mode_createblob_ioctl, DRM_MASTER|DRM_UNLOCKED), + DRM_IOCTL_DEF(DRM_IOCTL_MODE_DESTROYPROPBLOB, drm_mode_destroyblob_ioctl, DRM_MASTER|DRM_UNLOCKED), DRM_IOCTL_DEF(DRM_IOCTL_SYNCOBJ_CREATE, drm_syncobj_create_ioctl, DRM_UNLOCKED|DRM_RENDER_ALLOW),