Message ID | 1535007116-31801-6-git-send-email-amit.pundir@linaro.org |
---|---|
State | New |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a2e:164a:0:0:0:0:0 with SMTP id 10-v6csp757719ljw; Wed, 22 Aug 2018 23:52:16 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbRsU6OrdLH80yERscz3nVytuGCgQWVuGHHRZQ8UE3VF/tuGZPKrHKQXZBFGlLPT6BxX62i X-Received: by 2002:a63:5343:: with SMTP id t3-v6mr3516227pgl.425.1535007136434; Wed, 22 Aug 2018 23:52:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535007136; cv=none; d=google.com; s=arc-20160816; b=l+rq9hhizLG0YvBak9v/gvoFPX1q+XSGQkXD3KstDaztLCTOemFXN92saDKilNHFPl iqQwtGwZSXMKbelvcGZMLSaGlnq+ohp1LV0v/c/wSwRv/2mFGaAad+Pv+ZJH9dcETm14 51l/soGHRGb8QAHmHmFeUS0PfIAFWYunkw7pZe38m0L8oKLc1qXMuFe9Rrg1HZek0otM FAjhQVCif944lo302bdhG1iYwYE0GF6jRv0Dp2laKjE0SZRKAt/OAV/oRFY9l1ZWKZJl ZD3oxkngy8u21Ig6AfW4fZypc2wt53pqW0SdDxoC8QpN+Gaa+V60tVYPt0hMwzV20IuZ 09Bw== 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=wW/JB5r657EY9jTutY1AjNy3NOVa6lZDU4vsdgWAMfk=; b=O5n/qL5luRzE9BZjHEbYRPfFhpVu4k+oOjTRDQLtdRT8Wsknze8dVmJT8QXDl19/qt PL1/tTu7d/55QiA0C8MAeEMiPC+aOb+KfLHweJvCeRzFMuqt+XrvsCvX0eGSCRhAQudM hNmfwy4lyi9vvrkFVmFuPJSwnRO14BwP6h0PvPej+Crbc32lnpBGOGm0i9yo01G9hy8E Nq5x+xtA6T7jCWH7vvT7P0pRXLfIzDUD1lyqjYUkqhmFA7kT+5g2MkFYUjNBhU38synA OgaoPH3Bf/fDuM+8xiWxMZZ7zgQsXqzsm4+FwnR8HNLoetqrqmzBgNto7W+VMAEwA183 /yYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EMNiiByf; 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.52.16; Wed, 22 Aug 2018 23:52:16 -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=EMNiiByf; 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 S1726301AbeHWKUY (ORCPT <rfc822;ruslan.trofymenko@linaro.org> + 13 others); Thu, 23 Aug 2018 06:20:24 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:33638 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726285AbeHWKUY (ORCPT <rfc822;stable@vger.kernel.org>); Thu, 23 Aug 2018 06:20:24 -0400 Received: by mail-pg1-f196.google.com with SMTP id t14-v6so2107075pgf.0 for <stable@vger.kernel.org>; Wed, 22 Aug 2018 23:52:15 -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=wW/JB5r657EY9jTutY1AjNy3NOVa6lZDU4vsdgWAMfk=; b=EMNiiByf9SGoe8qU2xGK7LP8/DIOt7JmAWq+GQryNGJ4Gi1tkMn+bZfysFaijTc18w tv+jYg2hKiTsZp9Ng07vwn3dNnF+uNEw9c+JBBMYpKBovIweNIwnTejwhZbmbRLox7ur woGqOnHfwa5k3Kmg3YlghK/+MQgK0LEhxGNjU= 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=wW/JB5r657EY9jTutY1AjNy3NOVa6lZDU4vsdgWAMfk=; b=t8cJGfwfF42VDbof698iwmth58cOWaC9LsorwzXeKbpn28iBuOCS2of/W1mevFog8H ST+3RHGBPssnPVwlIWOoMI0My2QYY7j0EIltIBPBXpjLKF9Vt2zvNVQXECuGOqQhz8ub K0GYb5tJNfiPiUp/vM/qRlRPSAQrF1M6rY5i/PZDzsSJh5cpt8Y1YxBp/ob1iB//bV4H 4sjDZVNaSwvb5rUUovB2YAyZUTJLnuhjHcqFtGl7WHr2QGXZAwMJxh46BN6cohxU1u9t PE0KhImzug1zS3I4TkboT048o9jcVOL800i99PIMLYeboAaFj6qc7LFI1p2NUeWZ5g6L 1cxA== X-Gm-Message-State: APzg51AiPmZDBrQxIZNIFXvHLT/uiDFdKCrEEZTwfyUM2QAvCgDJe5as tI+Dxf45g0t7nnCXQNfACjjfgA== X-Received: by 2002:a63:4a44:: with SMTP id j4-v6mr2724918pgl.167.1535007134635; Wed, 22 Aug 2018 23:52:14 -0700 (PDT) Received: from localhost.localdomain ([49.207.48.21]) by smtp.gmail.com with ESMTPSA id d132-v6sm7559932pgc.93.2018.08.22.23.52.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 22 Aug 2018 23:52:13 -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.4.y 5/5] sch_tbf: fix two null pointer dereferences on init failure Date: Thu, 23 Aug 2018 12:21:56 +0530 Message-Id: <1535007116-31801-6-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1535007116-31801-1-git-send-email-amit.pundir@linaro.org> References: <1535007116-31801-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 c2fbde742f37..a06c9d6bfc9c 100644 --- a/net/sched/sch_tbf.c +++ b/net/sched/sch_tbf.c @@ -432,12 +432,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); }