Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp695386ybx; Thu, 7 Nov 2019 01:09:38 -0800 (PST) X-Google-Smtp-Source: APXvYqz3wmXSO7tstm7e9H9EXIt6oO/cWJz/FRRHY4WCKXYpPfLpF+JxeJd1Mu9T8glYwKF7qzml X-Received: by 2002:a05:6402:205c:: with SMTP id bc28mr2321644edb.124.1573117778547; Thu, 07 Nov 2019 01:09:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573117778; cv=none; d=google.com; s=arc-20160816; b=pJuaEpOO8aV0ZSjyRxEaXy5Q4S792WOSnzjPbVoEGyLo7o0ZBDLO2Wg0k5Hr6qwsni bt6msd+yiZW1b6KycIxitaAsrlmhfg+pqzPNvLk/6XwdaKpQz32ZpBl9zApqK+x+Mx8p ubviO8KyQ9RDn2/ttm3zSMMb6ckNe/P2aGKzPLLwUJ8kCoHyERUZZnUGFvZ8FjHYz+vx SM2pzE9UEaSquxBKjz/iw6+tp4xemuByWow5lqS9J4Rppx4tQIhECFmStTrQrdoL5Kbu pkSIEGjj7BudDCCISeOKIabXgghVFBAEo6HR/JObmdXYzNoSnuqxjhBxyk8jFJCI3wOC J4TA== 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:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=SEqG9doKOZ7j4mZzFizpWdXx8L7d+RNtl8yXbIVvxGg=; b=Uy9dJ5Qcjx3cxsYynl+HLbzRUSw073SSdmqHvxZ8v7Hdy5E2BG2XWPnftxKsYrf7yT 1RssuRrGAv4HCdrsQawHIJGeJJA4c8GbwEmZzBeM6c203YVKYAzuOGgYesqZK1sfFRqW 3J9gvaKbEcofi+v4ZC0o7HMo0u2aVTnCWcsWwFHL8/q/YXq5p/aqrmqE7lUArE6E0lUC PQkcbzT7rJqpUnLAoLhBjrSsCmqicNMJFfqr9mYkAWlNgjeooM2TcPJG49ULPM5NeZiu fDC0B/Q1eM65vFU4XyZAyZhliqA1cyjgW6cTXubOAYVeUISEjenYUa7Xs8YKcyMa6Sn3 sP+A== 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 q19si965715eda.112.2019.11.07.01.09.14; Thu, 07 Nov 2019 01:09:38 -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; 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 S1733228AbfKGJGd (ORCPT + 99 others); Thu, 7 Nov 2019 04:06:33 -0500 Received: from mx2.suse.de ([195.135.220.15]:54070 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726800AbfKGJGd (ORCPT ); Thu, 7 Nov 2019 04:06:33 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 339D5AE65; Thu, 7 Nov 2019 09:06:31 +0000 (UTC) Message-ID: <1573116629.3024.1.camel@suse.com> Subject: Re: [PATCH] usb: appledisplay: fix use-after-free in bl_get_brightness From: Oliver Neukum To: Phong Tran , syzbot+495dab1f175edc9c2f13@syzkaller.appspotmail.com Cc: 2pi@mok.nu, alex.theissen@me.com, andreyknvl@google.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, syzkaller-bugs@googlegroups.com, linux-kernel-mentees@lists.linuxfoundation.org Date: Thu, 07 Nov 2019 09:50:29 +0100 In-Reply-To: References: <00000000000042d60805933945b5@google.com> <20191105233652.21033-1-tranmanphong@gmail.com> <1573040577.3090.22.camel@suse.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.6 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Mittwoch, den 06.11.2019, 21:22 +0700 schrieb Phong Tran: > compare with message size (2) can be considered. > > if (retval == 2) { > brightness = pdata->msgdata[1]; > } else { > retval = -EMSGSIZE; > } If you do it that way, the error reporting will be distorted. Hence I did it a bit more complexly. Regards Oliver