Received: by 2002:a4a:301c:0:0:0:0:0 with SMTP id q28-v6csp1099952oof; Tue, 25 Sep 2018 08:15:45 -0700 (PDT) X-Google-Smtp-Source: ACcGV61I2H+P/IpP62FCLCGqxYrBAREvplYsB0qGU14vw7vrSe9xlKY2uS/rzi5ddEOtiwpuz7wx X-Received: by 2002:a63:e14a:: with SMTP id h10-v6mr1533842pgk.358.1537888545799; Tue, 25 Sep 2018 08:15:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537888545; cv=none; d=google.com; s=arc-20160816; b=Rz5256tzpAdvHKQHh+ih6UXicVojK1KCHSa03rDDuL34LLFGNsQfbYXXedou7dcAn/ yPRKP7uagjS+4P42dj3b46Shbn/qQgqrwIhnX6W84Cyaxxt/qF/K5URczX3D8TvhBFh3 TdcfF/QOop0rVsJYwSQlThne5CtdwRaLobfsyiJoxEDJxpONeh+4wohaXnG1WV90SNMb 8Bj1ROYlbw1df8zVJiUmWAP13yAnCzk6ld7aGBmq1V8FXiidNndoKzREG+FrMcAcWFgh J1wkP+cDImCERdWxVX/tP6ubFXd62ErXxHGPgJzA5lis7UlB4wpM7ggBfmahl6TZvTxS XgKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to :subject:cc:to:from:date; bh=KOpUtoNuX/dA6PH8ngpo+yBn2f8ZeFWhYXqR3Ecj1kY=; b=u8lQu//5QHW1i3LeBoLY0zN5zzDxL0Jvl8q28pC3geIUaTGdlNWv8gC3RrX1PW5O9H jKdUVD/fE0M5/56Ko3d/l+JuLzI4L/Y5X/KgCpzwsHLKivta02TJQxPZ7DDO+2IZgV81 eEW+NgPIPI7C67MnVsr3+OgWobr4r8RypjngvxnBu+/+6nt9UBQNCrwqO/4m6KZSnBiH 9kYY8yKWPD3gaxodzJLq3IqFBrxfUvcTnc6jcWb98AvzsPCEwyhF1Rnv9ByoBkECBYmZ XTmD9gpsCSAIOgoY0jr604Fft4Lc+JC3zgZg9bZvgAzEPcrbyEkne2AaBiOyAT5xOeOr ZATg== 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 34-v6si2630218plm.205.2018.09.25.08.15.29; Tue, 25 Sep 2018 08:15:45 -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 S1729494AbeIYVXD (ORCPT + 99 others); Tue, 25 Sep 2018 17:23:03 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:39150 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1729436AbeIYVXD (ORCPT ); Tue, 25 Sep 2018 17:23:03 -0400 Received: (qmail 4326 invoked by uid 2102); 25 Sep 2018 11:15:05 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 25 Sep 2018 11:15:05 -0400 Date: Tue, 25 Sep 2018 11:15:05 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Vladis Dronov cc: Greg Kroah-Hartman , Oliver Neukum , Hans de Goede , , , , stable Subject: Re: [PATCH] usb: usbfs: fix crash in check_ctrlrecip()->usb_find_alt_setting() In-Reply-To: <13984886.16016319.1537887354102.JavaMail.zimbra@redhat.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.) > fix callers. Unfortunately, I understand this hardly will be accepted. How is this different from calling kfree() with a NULL argument? Alan Stern