Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3628615imu; Mon, 14 Jan 2019 06:25:51 -0800 (PST) X-Google-Smtp-Source: ALg8bN4hailyE0P6JFg4QXrdPqgpzlP5yCHfK543Le2HDblZL+wQK//mR8oYMu8CCAleyTH7mc3u X-Received: by 2002:a63:fe0a:: with SMTP id p10mr20694139pgh.265.1547475951269; Mon, 14 Jan 2019 06:25:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547475951; cv=none; d=google.com; s=arc-20160816; b=QeAedtqcMcpff3wRa9p7p6gYSzQ3QyTZJy0t6ODrP4UyU21/C2d9mNDVyvG1tPifxr 2RCWnhfO10q8hawdoNQDx2d7e/yseDIFGfBpUZ7Tl7EIXaSvwHtB/AzXqKZpzP7CO1Tw uTObFQpqKrb7SodcGze6hd0HKvVgWc/rtJNhwdjeeY8DX0cb40UlpcKGzQVB/VM3/OQV lA+N4dYvRXwMiPfa+zhVJFMN/u+ObTC69hWeTnV+7hsU0K2hakEZgueDoIA9GoZA64HP mW7pd7ouNKIgETIv1KohxDvIAIaCY1RiY/7T8tfShfJqzNZZOfp6I9DjzVGCaXDkQkiV 1s1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=pvrcZ5qClIJy9+s/pvg4XctfRSTgieMg5pDWpl6LQmI=; b=jSqMlniWYLy4pTzLImNqGro/iSzE/q1lRnxXvRJx3w3vG6hs8GYEZBsTPelFjUyYVx 6JXEFtIBUcWUU9DAQIbiGD7cqTv3QwiyhvWSMQuYyO6iuJB9zyof1RJgZE6YWpDn/NzH cAKwb3CDgvZEUEQp6zVuCIMU16UYOvtQ9DIrWPlNTTiRSIy0Xs8Sw61fSegMDBLUor2d 6J+ekrURHyHudz13oJLhkCie8yGkCe/bS6/+xHyyeVZlMniIY2PjYgU68efau5A/v7p4 D7ovQ7io8vvjsQG7twfVKf2qZM11neEDkurFgXl4EaA5QjhlJXXSmF94BLRldS7x7LDh NV/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LfJh6TwM; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g187si404387pfc.43.2019.01.14.06.25.35; Mon, 14 Jan 2019 06:25:51 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LfJh6TwM; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726653AbfANOX1 (ORCPT + 99 others); Mon, 14 Jan 2019 09:23:27 -0500 Received: from mail-lf1-f68.google.com ([209.85.167.68]:44755 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726470AbfANOX1 (ORCPT ); Mon, 14 Jan 2019 09:23:27 -0500 Received: by mail-lf1-f68.google.com with SMTP id z13so15695388lfe.11; Mon, 14 Jan 2019 06:23:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=pvrcZ5qClIJy9+s/pvg4XctfRSTgieMg5pDWpl6LQmI=; b=LfJh6TwMsWFHDn99Um+H1BXQJ3RkVnxOtf7FUByODVEsrMA1lS0VbH1jhwrK/zSSSk sJcikJ0fWPVpZUbaET6R4iY9HB3N4CSPml7rq48MDxiiVRY35XSXbgq31m4WqkPUBI3d j+AwMdwrwb29cJGnfptnSFW9+ejCE2ogHFr91/CTUU0mNxbFiPuwz04+kFfpfBv+FI+w uem6kEkagay5m1ABi9un/3hODtWIopC9MDquAMp7uTQZ4cdgDE57PTjZlw3oQ46z6mAP p4InlKc4+iBOmnRlOea8iNHzzHYPsFeaOo9azNDCY7uTpoMa2F6VIO3vlYOAp5morDfT 7/Lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=pvrcZ5qClIJy9+s/pvg4XctfRSTgieMg5pDWpl6LQmI=; b=JVdMFvVk8SorYRFCxZFlQcDEM/U5Qz1RDS3KagC1kmpj+UxDZ17G4zXpR+MUyWGJV7 CiEk8CKIkfl5RNhORKGYucUuay6x9YV9DJxTsv+hvHQWuC+5SBMOW3XpHByXlaFiqhoY Df2CM1JOoePmNZS+RwyxKXhlm9rYt8bsqhT7waQzt9qgS2r4gU0Aur6fj9hPmYAu6Op0 N6p0aNcEh5gyg+8uyOoSBumyZ4zD+1Slr9eysMQSd0fHczk0dir2/qJ2SpwAGN6t+H+H bRhHZZ/3wIo9udHw7qCgZY+F8+oMBU+wRVQIFKfw/QJ8oJFW6A1CuxGTUZqQdywWitRl osfg== X-Gm-Message-State: AJcUukd98kLva18Wo9V+3/lHJQwk9kT+s2dzqapA5knurY67JBU69RzM BhBS5zcfDM4g9Dr7LhFnQochxc0/a3fILkR+a9s= X-Received: by 2002:a19:5394:: with SMTP id h20mr14175972lfl.75.1547475805073; Mon, 14 Jan 2019 06:23:25 -0800 (PST) MIME-Version: 1.0 References: <20190113230946.GA18710@amd> In-Reply-To: <20190113230946.GA18710@amd> From: Anatoly Trosinenko Date: Mon, 14 Jan 2019 17:23:13 +0300 Message-ID: Subject: Re: NULL pointer dereference when writing fuzzed data to /dev/uhid To: Pavel Machek Cc: Benjamin Tissoires , Jiri Kosina , lkml , "open list:HID CORE LAYER" , Roderick Colenbrander Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > fuzzed data is hard to discriminate from valid data. Just in case it can be helpful... If it is about manually "parsing" descriptors to understand what is wrong by hands, then maybe Kaitai Struct parser generator can help. I understand it is probably not suited well for in-kernel binary parsing, but given a text-form description of a format, it can visualize parsed binary data as a hierarchical structure. Best regards Anatoly =D0=BF=D0=BD, 14 =D1=8F=D0=BD=D0=B2. 2019 =D0=B3. =D0=B2 02:09, Pavel Mache= k : > > Hi! > > I just want to note that while these may not be high-priority, they > are still security holes to be fixed. > > > > When writing the attached file to /dev/uhid, a NULL dereference occur= s > > > in kernel. As I understand, the problem is not UHID-specific, but is > > > related to HID subsystem. > > > > Thanks for the report. > > I wanted to tell you that I started investigating the other private > > report you sent us, but couldn't find the time to properly come with a > > fix as the fuzzed data is hard to discriminate from valid data. > > > > A couple of notes though: > > - writing to uhid needs to be done by root. Any distribution that > > doesn't enforce that is doomed to have several security issues > > We want to protect kernel from root, too. > > > - we could somehow reproduce those fuzzed data on a USB or Bluetooth > > connection, but that would require physical access to the device, so > > you are doomed also > > Not neccessarily. Imagine a kiosk where PC is protected but keyboard > uses USB connection. If our USB stack is buggy, you are doomed... but > you should not be ;-). > P= avel > -- > (english) http://www.livejournal.com/~pavelmachek > (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/b= log.html