Message ID | 1533062405-32524-6-git-send-email-amit.pundir@linaro.org |
---|---|
State | Superseded |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp5668374ljj; Tue, 31 Jul 2018 11:40:26 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfI/gCeEOopCXmUM9dL2amCx0U3HeCzeRHNjffLZxWTuSFCprho+pZT+FCJUBmOPLm+AEN2 X-Received: by 2002:aa7:800f:: with SMTP id j15-v6mr23297989pfi.174.1533062426602; Tue, 31 Jul 2018 11:40:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533062426; cv=none; d=google.com; s=arc-20160816; b=wE5NZ9W2Ek90zHyCL6glivL5lM76oF6Ue/eeLpZbBKiD3AKTnD+F6RYMN+Cw5oHe8d rtXJG8niDdiHnYEllhFOYOaVdbktvFIbCg523g/4iR3ZJAwvRpPX7TI1ANoEEh9KW6gD gRiJ8YEQP40F7p5K+eo5oe/LIxF/9YJCf7ex4Tros9sKE1NtTYiDh1odG75QQB6BuFRh sOdlL+R4CKRsCAPpsPNjcJRd7daU39k8FJAOWjHT7znvFIxDw/m88QsJxDSjTOF3vbz+ ak55A1jEmzjHGPx6/NF1OwQr312K1mKtjLwk+s6F2l/d8+yVJ6qky4IHGEiMgHp0QFSZ Cjrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=pPCSTeC84yOQxgyM8e/R+qVuuNtbJ5jVzPqymIzroPU=; b=Yx6BfLI6WjjxzM6E+tQRjkwai9jGy9RNexx7SXWJOyaRcnFbvK5S+RZzlFfPpb+9AI r/23oUHnxW+MjYMNQavPzpNHXsQCIsy/XJsYD6bK3Jdvn+pndGtY5aluRe4s76d7TjN1 7t0fO93vd919CS0S96cijChcq/deFWcwaHKdPRnXEux4Cz3sC8ihZDrySBcmC5JdedGS jp/aHfGdjs8FUPugwHPDI3ziC2BTs0y9Jhj0RSzHGOWp9PeVGFkqraSHEvRdTGApYosW vOxshjgXX7/oQbKu3bneTVo+vZJBe9U0KEv3shdRKzuBdNayxgCud/iye8Mn+r54Qb9x umVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="V/yw68DJ"; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: <stable-owner@vger.kernel.org> Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x3-v6si13746391pgo.542.2018.07.31.11.40.26; Tue, 31 Jul 2018 11:40:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=@linaro.org header.s=google header.b="V/yw68DJ"; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729790AbeGaUWB (ORCPT <rfc822;ruslan.trofymenko@linaro.org> + 13 others); Tue, 31 Jul 2018 16:22:01 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:46095 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729645AbeGaUWA (ORCPT <rfc822;stable@vger.kernel.org>); Tue, 31 Jul 2018 16:22:00 -0400 Received: by mail-pf1-f193.google.com with SMTP id u24-v6so6519583pfn.13 for <stable@vger.kernel.org>; Tue, 31 Jul 2018 11:40:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=pPCSTeC84yOQxgyM8e/R+qVuuNtbJ5jVzPqymIzroPU=; b=V/yw68DJ7a8B6j591LczghKiUi//JArZ/nluuLvY/8hwgqjTQNfvXadTv8ywTcdsur R7zY1jYEvDbDLBaVsYUX0ag+/46bPjGFPbwfbB/0y4bcJWX9j0COiFP12lqCJ2OmJWuV f/FKupEHbEbGVBNGkea+WyIetuSVRJECsGbeE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=pPCSTeC84yOQxgyM8e/R+qVuuNtbJ5jVzPqymIzroPU=; b=kh4t9H0R4P+Hl9ckJe0+XyLO1DFiHUEdAfPB7olLPKY0xTajIVxX3oxJPEm8mgbgHs /Y95GJU/OrWbrumNNaGkWpZ4UQdnhVd/KQmWSklenSAtxKtw9/LJ0i5wFnUBAJjM68k9 irWfKqT0vqBzn0hPXNBaylhLkgS6EWpc8QkmMI/ymi3+2IPnZF0ZgJvYMIyjkKsiq44q DLzB9RL5g/3RaTsmZUZxHAuLNaQDRGQ2uUmrc6EU/49tq2ga/M3P81Q5P6vVlv/w7pjz haJaAtseiFmtm8Vg80uXozLTuN8SuGgrzem2V1s6ACEcQtYEmeoLw64Oio+ej9Jftb/W rpdw== X-Gm-Message-State: AOUpUlGh7YhJ1hMWGV3IJw05b1YQGbuzEOm3Vz6xeRaSN/A24DNl5dcp ap0Tqms5EsTUMCUoOb2eFo9Zfw== X-Received: by 2002:a63:b349:: with SMTP id x9-v6mr21554534pgt.337.1533062424693; Tue, 31 Jul 2018 11:40:24 -0700 (PDT) Received: from localhost.localdomain ([106.51.18.123]) by smtp.gmail.com with ESMTPSA id d191-v6sm15467977pfg.172.2018.07.31.11.40.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 31 Jul 2018 11:40:23 -0700 (PDT) From: Amit Pundir <amit.pundir@linaro.org> To: Greg KH <gregkh@linuxfoundation.org>, Nikolay Aleksandrov <nikolay@cumulusnetworks.com> Cc: "David S . Miller" <davem@davemloft.net>, Stable <stable@vger.kernel.org> Subject: [PATCH for-4.9.y 5/5] sch_tbf: fix two null pointer dereferences on init failure Date: Wed, 1 Aug 2018 00:10:05 +0530 Message-Id: <1533062405-32524-6-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1533062405-32524-1-git-send-email-amit.pundir@linaro.org> References: <1533062405-32524-1-git-send-email-amit.pundir@linaro.org> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: <stable.vger.kernel.org> X-Mailing-List: stable@vger.kernel.org |
Series |
net/sched: init failure fixes
|
expand
|
diff --git a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c index 303355c449ab..b3f7980b0f27 100644 --- a/net/sched/sch_tbf.c +++ b/net/sched/sch_tbf.c @@ -423,12 +423,13 @@ static int tbf_init(struct Qdisc *sch, struct nlattr *opt) { struct tbf_sched_data *q = qdisc_priv(sch); + qdisc_watchdog_init(&q->watchdog, sch); + q->qdisc = &noop_qdisc; + if (opt == NULL) return -EINVAL; q->t_c = ktime_get_ns(); - qdisc_watchdog_init(&q->watchdog, sch); - q->qdisc = &noop_qdisc; return tbf_change(sch, opt); }