Message ID | 1535007041-31605-6-git-send-email-amit.pundir@linaro.org |
---|---|
State | Superseded |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a2e:164a:0:0:0:0:0 with SMTP id 10-v6csp756982ljw; Wed, 22 Aug 2018 23:51:02 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxqeeraERy4eRH5LvIuzQVb2PP+Ij3KmN1/IyCCZkhCsrPoS5Wnqdfn6a03Lj5r57I60k6v X-Received: by 2002:a63:1d22:: with SMTP id d34-v6mr54690414pgd.133.1535007062421; Wed, 22 Aug 2018 23:51:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535007062; cv=none; d=google.com; s=arc-20160816; b=iSpNUbnJf67DaQS0JQ5jVoasGVeT6EPBjjHv+5e4oDJwNyXIxTNoVN1Ahvqx+yMwr8 yJXL7fFfchCij50XM0OY01lFOx4Pl/eu0qNMqkbDDxRUkLdQ+3tUDHtUUFgE7RjiTrPn fL2TJ7d915NkuhOg8MS/zh3Azp2BCICHT4Aje2y4vWlR9tFpzKZgyi0inq4toAH2NM1q X+eHtRCBofpPbbON3nxBOjEg8yvEh4qv0SpOnha3tujPcK458exmTnkqkRO0P7BoOx7B zu7oVh/6ul91MK8ZWsoftUUubCXvZy+IP4OXkAgCro0KmaP17mtG/3Cns7DoJEmoN4gE Yupw== 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=MAoxlLGWQakM8g5LZrfJqznMUxn2HYHMDaD6CDn1dsNy1Zke75BwghO4Bw7nRMkRLQ UYp7gYfTpmHQ4nynkvmPbg9YzyJaEqE9rquq98idiWbABGm2Fx5DNUelvOwVE8FXQpbx ETwwmWLxiwg4vdzNRogNPNnJ+voW69sf35kZC+Mf31dNHCAxrU5l5YjHNABOBcbGqR0n W3uQe9OFxCOx2WVwqJikqksIkCF5ucWwb/7T5hLTc22I2dcm/i93wWrw4Bt8OxM8NNXA 3CXRCwMODI0ViAmABpE6/dRQ34Z/IcEQkMt07FUQVT1Y4xqIiBcK1AOrgeoXQRKvmCpN qv+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ByqD4iHt; 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 cf13-v6si3685258plb.334.2018.08.22.23.51.02; Wed, 22 Aug 2018 23:51:02 -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=ByqD4iHt; 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 S1726194AbeHWKTK (ORCPT <rfc822;ruslan.trofymenko@linaro.org> + 13 others); Thu, 23 Aug 2018 06:19:10 -0400 Received: from mail-pl0-f68.google.com ([209.85.160.68]:39362 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726068AbeHWKTK (ORCPT <rfc822;stable@vger.kernel.org>); Thu, 23 Aug 2018 06:19:10 -0400 Received: by mail-pl0-f68.google.com with SMTP id w14-v6so1970206plp.6 for <stable@vger.kernel.org>; Wed, 22 Aug 2018 23:51:00 -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=ByqD4iHtEsRHCTQvNTkbl7iKZCOnBi0/6t6BaRibmQ5K/Gis/10mF3dmdpHMGLx4n2 qfKTqzbnSyDpsOvgEDbrxS5Y74K1EY76J6H4I4103qm9uWTpwKZu8UxyKWZwjIQFE66c D1xKpKvFn6Xou6kzz7j8PUImyHoNU63wwBtec= 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=MTiGJeW/fPHLLMVniT3hGXJ/014rpmXUNN2jVlHHWhIb3YRTOdOq79p6+enkeg0Nef x64zDzm1DLWDqcRuiopfC500eR7T7JWQNFz6lzwXhJQlvIpwrRb30JhqFzuDExd8SJyE 9VydUmmd90ie1Twoic9lZRLv0/VLp+vKmTk1w8qWvz1d8ofdW8gCEPs/4f8rXMgrAc4g n/Rreli8GueTgbJapsll6Gctpdp2XkTUiMsc2F15fwyzFQDZvwFIw8bxB2wB/kqCQUw7 N9fEw5mTZWukccKE0pLWgK1mqH8Cf2Wvf4YIkAp2WhZbXiYnAErM5a2JstE98EYK1En4 wYIQ== X-Gm-Message-State: AOUpUlEq03CsXThS9gN5ouKtGGT77CLUw08SDzeXAQStrTVekR0UEF+L XMl4NY1mPIU7P2fKTG1VWkdZ8Q== X-Received: by 2002:a17:902:7147:: with SMTP id u7-v6mr57546106plm.154.1535007060398; Wed, 22 Aug 2018 23:51:00 -0700 (PDT) Received: from localhost.localdomain ([49.207.48.21]) by smtp.gmail.com with ESMTPSA id l85-v6sm6274501pfk.34.2018.08.22.23.50.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 22 Aug 2018 23:50:59 -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 v2 for-4.9.y 5/5] sch_tbf: fix two null pointer dereferences on init failure Date: Thu, 23 Aug 2018 12:20:41 +0530 Message-Id: <1535007041-31605-6-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1535007041-31605-1-git-send-email-amit.pundir@linaro.org> References: <1535007041-31605-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); }