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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 1EE07C77B6F for ; Tue, 11 Apr 2023 13:58:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7B3A410E267; Tue, 11 Apr 2023 13:58:51 +0000 (UTC) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4238F10E267; Tue, 11 Apr 2023 13:58:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681221530; x=1712757530; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=yexL/N1m4BbU3jFepRVc09D3Ftt41ycmTKQzelkjxfo=; b=FHmMaScZpTkfTSNvycUOCXipRdJvhP/uAB1DpwOl0hCwY1yw71VS3Wkd vV/rJD9gjTT5jX24cVURPRob6aXkMg75JM/qYFA0iWe30pLmx6esOxzUm 22Z8xJ8cOlVAK7rp0Ciu3FIRutEeOa8LLFXWeQoekDHTsqXOvuCY8MwQf 3QlqxcrrXIsAmo6XA1C/4L+ow19q+/YpP5PyMoHEzbERd2HVTH8VZ8/eU G8TyNHFw78huykQO+9iLYplRNyN9u/40Cnpq65MS6bJctVu1x2fwE4umt Ryen8eOnAPT/jC4++4TG32RpDALd5YWAKIuQiZT6dG6mwwOM26zBgb8nU A==; X-IronPort-AV: E=McAfee;i="6600,9927,10677"; a="323982912" X-IronPort-AV: E=Sophos;i="5.98,336,1673942400"; d="scan'208";a="323982912" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Apr 2023 06:58:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10677"; a="777919862" X-IronPort-AV: E=Sophos;i="5.98,336,1673942400"; d="scan'208";a="777919862" Received: from aburgsta-mobl.ger.corp.intel.com (HELO [10.252.45.152]) ([10.252.45.152]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Apr 2023 06:58:43 -0700 Message-ID: <8cef35ad-881e-3db3-5c7a-e27ff9968b77@linux.intel.com> Date: Tue, 11 Apr 2023 15:58:41 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.9.1 Content-Language: en-US To: Daniel Vetter , Intel Graphics Development References: <20230404193934.472457-1-daniel.vetter@ffwll.ch> From: Maarten Lankhorst In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Intel-gfx] [PATCH] fbmem: Reject FB_ACTIVATE_KD_TEXT from userspace X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-fbdev@vger.kernel.org, Shigeru Yoshida , Geert Uytterhoeven , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, Daniel Vetter , Sam Ravnborg , Helge Deller , Tetsuo Handa , Geert Uytterhoeven , Samuel Thibault , Bartlomiej Zolnierkiewicz , =?UTF-8?Q?Michel_D=c3=a4nzer?= , Maxime Ripard , shlomo@fastmail.com, Nathan Chancellor , stable@vger.kernel.org, =?UTF-8?Q?Noralf_Tr=c3=b8nnes?= , Thomas Zimmermann , Alex Deucher , Peter Rosin , Qiujun Huang Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On 2023-04-11 15:44, Daniel Vetter wrote: > On Tue, Apr 04, 2023 at 09:39:34PM +0200, Daniel Vetter wrote: >> This is an oversight from dc5bdb68b5b3 ("drm/fb-helper: Fix vt >> restore") - I failed to realize that nasty userspace could set this. >> >> It's not pretty to mix up kernel-internal and userspace uapi flags >> like this, but since the entire fb_var_screeninfo structure is uapi >> we'd need to either add a new parameter to the ->fb_set_par callback >> and fb_set_par() function, which has a _lot_ of users. Or some other >> fairly ugly side-channel int fb_info. Neither is a pretty prospect. >> >> Instead just correct the issue at hand by filtering out this >> kernel-internal flag in the ioctl handling code. >> >> Signed-off-by: Daniel Vetter >> Fixes: dc5bdb68b5b3 ("drm/fb-helper: Fix vt restore") >> Cc: Alex Deucher >> Cc: shlomo@fastmail.com >> Cc: Michel Dänzer >> Cc: Noralf Trønnes >> Cc: Thomas Zimmermann >> Cc: Daniel Vetter >> Cc: Maarten Lankhorst >> Cc: Maxime Ripard >> Cc: David Airlie >> Cc: Daniel Vetter >> Cc: dri-devel@lists.freedesktop.org >> Cc: # v5.7+ >> Cc: Bartlomiej Zolnierkiewicz >> Cc: Geert Uytterhoeven >> Cc: Nathan Chancellor >> Cc: Qiujun Huang >> Cc: Peter Rosin >> Cc: linux-fbdev@vger.kernel.org >> Cc: Helge Deller >> Cc: Sam Ravnborg >> Cc: Geert Uytterhoeven >> Cc: Samuel Thibault >> Cc: Tetsuo Handa >> Cc: Shigeru Yoshida > An Ack on this (or a better idea) would be great, so I can stuff it into > -fixes. Acked-by: Maarten Lankhorst