Received: by 2002:a4a:301c:0:0:0:0:0 with SMTP id q28-v6csp1103757oof; Tue, 25 Sep 2018 08:18:30 -0700 (PDT) X-Google-Smtp-Source: ACcGV63JPYtVRtBbiffkUzOJHKzok3lsi0HvB4vMXNXO5al1DVnZJ4vJD/R6PGyJuMxLQR6sj2KS X-Received: by 2002:a63:1752:: with SMTP id 18-v6mr1550986pgx.131.1537888710166; Tue, 25 Sep 2018 08:18:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537888710; cv=none; d=google.com; s=arc-20160816; b=v/rQ2j3n2oMsz1oiyn3P8qENvCOuP+r8CtEOE1DPeDwMTs/HByRR+6AaGbo5w8Ddf9 rtcZ1B762cOVvgNiJz/QaWWRiLNhX1yLZ741jzCbUiZoUrsz6V+FghbVqJWhyTOvp+eX cNL4PxtiUG2e7yG/HwZKzZEFrOlH54lizly2Vt050FPHjq0dPUYWCB3fiw7Vzw8tZB9W sSxRnTc5UcY212JT+xsh5nwFjIA9LY2hvaVasgF5Jcx3EA/B8aEQ1uQZj4ZSWedxH5UF EqxPKdR64eZwHsbYT87cGTXPr/BLzxxb7eEVBds023tcfy6trPPaHxkTyI5qYaAPh1fN VDgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature; bh=8UUVAD38hGnTglp3buGNXoMwy7QMXgBYYcNuRYSqpRg=; b=m68dF3zlJ+67Bw+IbKUFdKVAkUnFAY2Dcz5FTvs4RUieoOhly6sRWhg+qEgxFKqnk2 KzcP+D3SUDVhrjVAvoroJcj5aijdtYBIp3wcSqwW6UqkYe+cGK/7CsfO4ONpH1vm4Vtl vhGHKqL/e+vyKsY0KqhifSlBVy8qxPU8O/8q4Oaf3aulxVEnX1IXfy6QaDBs78YmsHDL m8x+46Jxvun8U4e0hSJLn9e+9Sepj/Gac9uN6DEbF6I8Qm6YZGpYzGp8noTwUxYyi95V 9j3LjrUF/4g2yexLlAEcNp1pEBy6JOS426L5OglQsm2ARD6gcyShlafdeMGCUSFRZ9yT wAIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=JGLZJll+; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c4-v6si2313973pfa.285.2018.09.25.08.18.13; Tue, 25 Sep 2018 08:18:30 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=JGLZJll+; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729545AbeIYVZ1 (ORCPT + 99 others); Tue, 25 Sep 2018 17:25:27 -0400 Received: from mail-it1-f193.google.com ([209.85.166.193]:55018 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729421AbeIYVZ1 (ORCPT ); Tue, 25 Sep 2018 17:25:27 -0400 Received: by mail-it1-f193.google.com with SMTP id f14-v6so15885496ita.4 for ; Tue, 25 Sep 2018 08:17:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=8UUVAD38hGnTglp3buGNXoMwy7QMXgBYYcNuRYSqpRg=; b=JGLZJll+czTPgaBaV87eg6dLFY14RU2lwP08uYgPpYq1pBJUaKBVSPiawJ1jgZZPrk 3fRprBefZVHu6XpWSnM19MPk8iCWdoenXNepI9dQP6epgiJozZuCOqEaT45puuldP/Go c4Wr12jCGGvN13I3glgmTutHgJ6Nr+3YnZ1pYE2eujDJM/5JVWMbCBYc5m17yc7gn3Ih Eln1bHdTAajvNWAOLG2REAUxM+YNYQd1p31rKwzSrmIT3xNlu1383fGNJCq0LlrKRWhx ASyPEDZWpZGBsedy6qxfMkgFmKJhlfzVmcMtASR1l88p+P6R/vZkbSkPibLPredNO+6K lWZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=8UUVAD38hGnTglp3buGNXoMwy7QMXgBYYcNuRYSqpRg=; b=Gb05afzjUoyYcn7Tx1849e8UiYd5Qn98FXoUgeugJP6fRLs3oqYUjB805gWvamq/v6 K7+kZLxfQBu0s6sbTMUgUotD3WmQzO/5kh9Fakmu9uuAo4ml3Qr2HFTdI08qTCM/BFnu TnYYWqd0Q/d/cTMnQI9d4/SkV/dw24oWcZyuO7rOzEZRr5pCpbjGkDDyBVgSjV/bfBYb 7P/N/aU8eh53HQzNEBi/RmMM3vee/KKOBq/tUGKZoA+cCZuzNVqCv4QqnMMg3CAhZ6zg qIc1/YnJCExgVnjFueU4w1ha77iXrb0ChcSKovazW2q0tuPNtqI59dV6cL4yYVd4Ua+J 8WZA== X-Gm-Message-State: ABuFfoji6d5stX84i/V2PcA8jPFHV2UHkweqCWQZYcYCFkVBGgKVA6ui jX1eUbGcrN6oXwlE2r3vIkJ/4QZg9F3JWZobylmJsw== X-Received: by 2002:a24:be8f:: with SMTP id i137-v6mr1186222itf.113.1537888649681; Tue, 25 Sep 2018 08:17:29 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:3d47:0:0:0:0:0 with HTTP; Tue, 25 Sep 2018 08:17:29 -0700 (PDT) In-Reply-To: References: <13984886.16016319.1537887354102.JavaMail.zimbra@redhat.com> From: Andrey Konovalov Date: Tue, 25 Sep 2018 17:17:29 +0200 Message-ID: Subject: Re: [PATCH] usb: usbfs: fix crash in check_ctrlrecip()->usb_find_alt_setting() To: Alan Stern Cc: Vladis Dronov , Greg Kroah-Hartman , Oliver Neukum , Hans de Goede , syzkaller , USB list , LKML , stable Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 25, 2018 at 5:15 PM, Alan Stern wrote: > On Tue, 25 Sep 2018, Vladis Dronov wrote: > >> > What reason is there for having two different fixes for the same bug? >> > This one isn't going to get into any mainline trees that don't already >> > have c9a4cb204e9e. >> >> I believe this is the right thing to do, so usb_find_alt_setting() >> is not called with a known-bad argument. >> >> Honestly, I would change "if (!config)" in usb_find_alt_setting() to >> "BUG_ON(!config)" so we know when its callers do smth wrong and go > > (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 the > kernel. The basic problem is that "BUG_ON" is not a good name: That > routine doesn't really report bugs; instead it brings everything to a > halt in situations where the kernel is unable to proceed. In practice > this tends to make actual debugging more difficult.) What about adding a WARN_ON()? It doesn't crash the kernel and it will be detected and reported by syzbot.