Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp465921imm; Sat, 7 Jul 2018 01:02:43 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfCmIHNLiAY5U4N+6nnwl/WMeF13J5oNamcZ/nOC57aZnRflof1UOBmOWTpJVGbP0tOwf1L X-Received: by 2002:a17:902:321:: with SMTP id 30-v6mr13305717pld.122.1530950563899; Sat, 07 Jul 2018 01:02:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530950563; cv=none; d=google.com; s=arc-20160816; b=aifu8wjwvQ+A6E6g4VpDpbWyOP3j6CFv2jnD0ecpHJff8b3QIVIACcHdSUXlp11c2K KRKPDGeBbtcMyWwRcIvmMJaL6ZXYF+nVIfu7p556ZV6nLftUMiaWnOfXS90UDTvJVxFt HSdBL9vNBk0jYqoPbN4mgO8jFyOb+e87c/AuOttRCnGxvEpjRMEcs7xfjHN5gJ3SRQ5Z rW/xIwHbmykS+cKMHw/5wfPMW/K9dm28JW6fUl3gjXDADqTaWtNCsED5do55jkU47mn2 ZFH3DgHhQPZM1LXUKoMVcFdMqxGer5Nu6rj72SZ164bFZEcAKs9ECnRHD0KWByLNW6jP Qz7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=xTXmMSKLgGiUMzLydDy+yO+UjlHHDDqcbes8M9su+RM=; b=oT84hYPo6TncHWQTqx+UL9IJawWx+H70C8kXjU17OxkOfZI5l6FVhR3WYuOyBf1Ufd vFhkHQkSZ3/aaVJ9d/jq7doySqFWbyM9qVEC/b1YpOfmBHvblXHJTkGaySYcjNh3A9JS 9IFi9gbQ31bVzuw7wC8dNUrVRR3HADm/7gAck1n1TILXXG5PyXcdC0s59LchG0GVV8aD kd9wEn9jR/99xN+yigFOAPEb3DKG9gGnFSgeMuUjaV3qfxoVT45Ews5XAbazqIt7rSky 6a0r0bX8BOC4FlumMUeYAR5dGJmgCpvFuPv4EXE9SYY4zAL0YpvYSlr7Gm6nT1lb3Q2v pxwg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b5-v6si10108170ple.417.2018.07.07.01.02.29; Sat, 07 Jul 2018 01:02:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753173AbeGGIBm (ORCPT + 99 others); Sat, 7 Jul 2018 04:01:42 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:38252 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751863AbeGGIBl (ORCPT ); Sat, 7 Jul 2018 04:01:41 -0400 Received: from localhost (unknown [37.170.5.79]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 79F59BB6; Sat, 7 Jul 2018 08:01:40 +0000 (UTC) Date: Sat, 7 Jul 2018 10:01:36 +0200 From: Greg Kroah-Hartman To: Jann Horn Cc: William Hubbs , Chris Brannon , Kirk Reiser , Samuel Thibault , linux-kernel@vger.kernel.org, speakup@linux-speakup.org, devel@driverdev.osuosl.org Subject: Re: [PATCH] staging: speakup: fix wraparound in uaccess length check Message-ID: <20180707080136.GA27656@kroah.com> References: <20180707015344.146672-1-jannh@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180707015344.146672-1-jannh@google.com> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jul 07, 2018 at 03:53:44AM +0200, Jann Horn wrote: > If softsynthx_read() is called with `count < 3`, `count - 3` wraps, causing > the loop to copy as much data as available to the provided buffer. If > softsynthx_read() is invoked through sys_splice(), this causes an > unbounded kernel write; but even when userspace just reads from it > normally, a small size could cause userspace crashes. > > Fixes: 425e586cf95b ("speakup: add unicode variant of /dev/softsynth") > Cc: stable@vger.kernel.org > Signed-off-by: Jann Horn > --- > > Reproducer (kernel overflows userspace stack, resulting in segfault): Nice find, thanks for the patch! greg k-h