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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44BFAC61DA3 for ; Tue, 21 Feb 2023 13:50:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234160AbjBUNuc (ORCPT ); Tue, 21 Feb 2023 08:50:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234153AbjBUNua (ORCPT ); Tue, 21 Feb 2023 08:50:30 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D291C28D2B; Tue, 21 Feb 2023 05:50:26 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6D9DE61029; Tue, 21 Feb 2023 13:50:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 83B19C433EF; Tue, 21 Feb 2023 13:50:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1676987425; bh=Z4aish3Apqp64SElU/yyo7PrgTh1M116rVxHyOgx8Lg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=z9iqgYk5Zv3oYRnYuVa4qZl34aqIJ9IZXL9I8ukVUkG7uPM6/t1Spj07z3JCqCRCS mO8m/u+h2MoiszeuplYv9TGtKU6TRTiIbovZc9yjRbFjI1ytKB2wnTWDllkQBIcyYK ecmpMUbSFNYxMdPtuCstA5t7menm8Y2ck/94+uw4= Date: Tue, 21 Feb 2023 14:50:23 +0100 From: Greg Kroah-Hartman To: George Kennedy Cc: Thomas =?iso-8859-1?Q?Wei=DFschuh?= , Jiri Slaby , linux-kernel@vger.kernel.org, Randy Dunlap , Storm Dragon , Linus Torvalds , sfr@canb.auug.org.au, akpm@linux-foundation.org, linux-serial@vger.kernel.org Subject: Re: [PATCH] vc_screen: don't clobber return value in vcs_read Message-ID: References: <20230220064612.1783-1-linux@weissschuh.net> <2094ecec-f63c-4e8a-ba97-da77c5266da1@t-8ch.de> <2941c2b9-5fa5-e25c-dcd0-ab9c9c0f143e@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2941c2b9-5fa5-e25c-dcd0-ab9c9c0f143e@oracle.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 21, 2023 at 08:30:11AM -0500, George Kennedy wrote: > > > On 2/20/2023 11:34 AM, Thomas Wei?schuh wrote: > > +Cc people who were involved in the original thread. > > > > On Mon, Feb 20, 2023 at 12:48:59PM +0100, Jiri Slaby wrote: > > > On 20. 02. 23, 7:46, linux@weissschuh.net wrote: > > > > From: Thomas Wei?schuh > > > > > > > > Commit 226fae124b2d > > > > ("vc_screen: move load of struct vc_data pointer in vcs_read() to avoid UAF") > > > > moved the call to vcs_vc() into the loop. > > > > While doing this it also moved the unconditional assignment of > > > > "ret = -ENXIO". > > > > This unconditional assignment was valid outside the loop but within it > > > > it clobbers the actual value of ret. > > > > > > > > To avoid this only assign "ret = -ENXIO" when actually needed. > > > Not sure -- I cannot find it -- but hasn't George fixed this yet? > > Indeed there was a proposed fix at > > https://lore.kernel.org/lkml/1675704844-17228-1-git-send-email-george.kennedy@oracle.com/ > > > > Linus had some suggestions so it was not applied as is. > > > > I'm not sure what the current state is. > > George, do you have something in the pipeline? > > Yes, that is in the pipeline: > https://lore.kernel.org/lkml/1675774098-17722-1-git-send-email-george.kennedy@oracle.com/ > > Linus suggested the fix, which was tested and submitted. > > Jiri commented on the patch, which I believe was directed at Linus as he > suggested the fix. And I was waiting for a new version from you based on those comments :( Can you fix that up and send? thanks, greg k-h