Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4133377imm; Tue, 25 Sep 2018 11:56:23 -0700 (PDT) X-Google-Smtp-Source: ACcGV630e+ibSlNMTwNw+UVLkvYVL4mbmum6hZ+C6U7IlqBMysxodU/k+QXfxoL9dnBKwaRxPfJg X-Received: by 2002:a63:160d:: with SMTP id w13-v6mr2273664pgl.43.1537901783382; Tue, 25 Sep 2018 11:56:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537901783; cv=none; d=google.com; s=arc-20160816; b=LD7qIjfp7j3T8U7RVA3EimEUzuJ/isJdwwlmknN/rgravDg6tk7M2Ptb04qhCfGHYP p8joErpDS+SdouvPJbA4vD7z7+/LyRVNjz2v7+PO9SdB8mxG5i5FIvit9TtebeDrP3HY XNfHZKFlF/nsAd/Xuw7XId+dEq4F1RDk4LXJxfLYmwU+Sbn0hEltV12aTTUBRxRnvPcD ZeOidr6yGZMjBzFZFogLGKgrVo1iysMUN12GvQeVWy+jYCeg4s3K5nSDkjnfBrf+zi1D doGZ5N+3sdwdnaQyIp+gi78GiGX0Ivcx5oLMNl1KEdyOnTTnQtNXGi3GJxeNvk0eLHf+ snMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date; bh=39bb7wp3I69PSrdc0rnG6q5Sw0k8rsiUXTL5bn1YOAo=; b=bI33YuCMYUnrEKoaLVtNsZEt/UMk6aWmXiBmwj9vk1zurBaDufUV8OjNx6GEr+G7Xh U/fFRpYONaTl59u21A4cft/bLcjq0b6Kut0nsZFCnGFI3IaKveEzRStKxOQF5G3AFLps 1XJAzketu2b04XX/3TYxtcs+dy5bHQMLwGl++fR5403kqPgQ+tEugELg0HORSQ+Vhcnw qrQaVGvf4E24O0WdJ21VAT/8lnz/HMhqxMpozLsN4MVEBur2SqqCTCf1eNGm2oKyKQdK qf7qHu3npSVyhKt9qVVVcPVMmcL4DEBv92Zvm4oOKffIaTJYbnPHKY7KwAkmNIpn1jDw 3TQQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i4-v6si3051134pgd.2.2018.09.25.11.56.08; Tue, 25 Sep 2018 11:56:23 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728053AbeIZBEJ (ORCPT + 99 others); Tue, 25 Sep 2018 21:04:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:3039 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727151AbeIZBEJ (ORCPT ); Tue, 25 Sep 2018 21:04:09 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 65C38792C0; Tue, 25 Sep 2018 18:55:14 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4DEF95D76C; Tue, 25 Sep 2018 18:55:14 +0000 (UTC) Received: from zmail21.collab.prod.int.phx2.redhat.com (zmail21.collab.prod.int.phx2.redhat.com [10.5.83.24]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 02B4A181A12E; Tue, 25 Sep 2018 18:55:13 +0000 (UTC) Date: Tue, 25 Sep 2018 14:55:13 -0400 (EDT) From: Vladis Dronov To: Alan Stern Cc: Andrey Konovalov , Greg Kroah-Hartman , Oliver Neukum , Hans de Goede , syzkaller , USB list , LKML , stable Message-ID: <1810191004.16066868.1537901713871.JavaMail.zimbra@redhat.com> In-Reply-To: References: Subject: Re: [PATCH] usb: usbfs: fix crash in check_ctrlrecip()->usb_find_alt_setting() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [10.40.200.19, 10.4.195.30] Thread-Topic: usbfs: fix crash in check_ctrlrecip()->usb_find_alt_setting() Thread-Index: 769AhKLgnsn5MS0mertdHakXGYdjeg== X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 25 Sep 2018 18:55:14 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, Alan, Andrey, all, > > > (You'll be lucky if Linus doesn't see that. He yells at anybody who > > > suggests adding BUG_ON for anything that doesn't completely crash Now, may be not ) > > > How is this different from calling kfree() with a NULL argument? It is not, it is the same case. > > What about adding a WARN_ON()? It doesn't crash the kernel and it will > > be detected and reported by syzbot. Yes, that would be a great solution. > Sure, we could do that. But would be the point? We know when usb_find_alt_setting() callers do smth weird and go fix them. > After c9a4cb204e9e, calling usb_find_alt_setting() with a NULL config is > no more of a bug than calling kfree() with a NULL pointer. Yes, exactly. > You wouldn't want to put a WARN_ON in kfree(), would you? Honestly, in the ideal world I would, again, to be aware when some code does something weird so we know about it. But this world is this world, it needs more performance to the throne of performance. I have no other arguments except the above, please, feel free to not to accept my patch. Best regards, Vladis Dronov | Red Hat, Inc. | Product Security Engineer