Message ID | 1533062586-804-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-v6csp5670783ljj; Tue, 31 Jul 2018 11:43:27 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdUz4ZNh+3wscIboAbUHqjgQZ3baZytse2h4swDDSlpvH3CAL59Btbdo/QiRxAXzqspw3uH X-Received: by 2002:a62:2459:: with SMTP id r86-v6mr23276044pfj.31.1533062607240; Tue, 31 Jul 2018 11:43:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533062607; cv=none; d=google.com; s=arc-20160816; b=j6h49UsReF7q0AR70M9zH0dOFz3S9x9bVE8jgDG8nGadkrM1o2T020i+FYhJ0qgsrg G3A6+aTw8WA+x/Vy+HkREIdfyfWjwNzSQPQe+LOAxElZOMRwLMpUxBKkYjrm4HfA2Asg mmqk1ZyOmW1VjeyGKpn71BAO3Jxn4CTjaqQYPyFEtE1QbaZ+8PR4cIz0p7bAxm0ZpSiu diKIeDD+ACtM+8qOYpmJPeRD1P9tkSqMht6RNHsgluu4cpTBjr+2UD0xw28rGV9BTIOT 2nEnYW6b7fn6+evzKao7QG5SLYmXfQDG/cKYlNTQL7ryeA1IK/b7U/gRlQAK3Rg2qouD fZGQ== 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=RJNnO8IHLbw6qyl8mzGItn8Xskeu5K2PJXDR9j+6pTfGJrCRN1QOwwhK8EtHoY+dxa YNelIXP/0MA+tFrDKplnC6+7WSGkLmXrM3N1Rt0+PfeSi9s+MxPvbqNtOrjh11yrET0b uKGiGstnZkduVYZCpuxpHY3Ph0qwmLnBoHKsIc19Z78v18tgqEummQB4yFWzfQdBqTtn fcaTHzlfEd81q/VtmBH0IDUgDTQVdB9d/TWMLnP+ZI2XMCxi4IhseikLVsE5QF9c5BaW 71DpsCVZgfSqhB4H1BXJ3z20FiBlgGqJS3a741Jpf8CJHv2ovXK40su7+yahEeJNVgJM IOOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NKx+951A; 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 t71-v6si13085197pgd.271.2018.07.31.11.43.27; Tue, 31 Jul 2018 11:43:27 -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=NKx+951A; 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 S1730028AbeGaUZC (ORCPT <rfc822;ruslan.trofymenko@linaro.org> + 13 others); Tue, 31 Jul 2018 16:25:02 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:33698 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729772AbeGaUZB (ORCPT <rfc822;stable@vger.kernel.org>); Tue, 31 Jul 2018 16:25:01 -0400 Received: by mail-pg1-f193.google.com with SMTP id r5-v6so9523666pgv.0 for <stable@vger.kernel.org>; Tue, 31 Jul 2018 11:43: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=wW/JB5r657EY9jTutY1AjNy3NOVa6lZDU4vsdgWAMfk=; b=NKx+951AGD1QRFBaUnGndEVsQHdXdzCU9WrIOGHxVvFLxe/8+942rTCTtwyWV3F1p5 ekhULIMHi7316SONDqacQoYDysp5XcObL7MONMd3C6w+WOOrmkG5Dk5HtSdyKIYjXb55 zfuVxqCLDgP7XTiT4JaMmT2YHz57r2ibIVvrk= 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=HrjN3IgLu8g2we32CsvB92XY2OVROfW4fJrNb+N1FnLKK9cJoq110FS5r1p1qrlS5G Swmv40x8s3q+y2cwGKUZQRR/qoGbyTOOsFK2cwM7iMnuUmYJOy3l5xY5Rv4a00qaw1DU eesrE9HxBa54eJyZlvP/KtUm3FLUtki55G23z+X4wvS8CBi2Ihh115TMV8V22KNa6uus +zYyZIaINkt4NZI+1KXDzyvsapmUMw8NwIPJTi0S9ubXFXE8ShoPuaHA4y2nxNfVPtww Lqvji+9jDSCNmRacmZrtXrTFlrDdZDebqx4CRym4B5+XY0gu/7y8rz+TqXbvaEYjdYMk iOvw== X-Gm-Message-State: AOUpUlEmIa7nNZxMbytlFelK3JRRdZhn2UczdxB5x7FVak+kDM0N29pS Fiy7lnPN2bnzzuX8iIQuGdJ4ww== X-Received: by 2002:a63:dd09:: with SMTP id t9-v6mr21759482pgg.370.1533062604735; Tue, 31 Jul 2018 11:43:24 -0700 (PDT) Received: from localhost.localdomain ([106.51.18.123]) by smtp.gmail.com with ESMTPSA id v22-v6sm38486956pfi.60.2018.07.31.11.43.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 31 Jul 2018 11:43: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.4.y 5/5] sch_tbf: fix two null pointer dereferences on init failure Date: Wed, 1 Aug 2018 00:13:06 +0530 Message-Id: <1533062586-804-6-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1533062586-804-1-git-send-email-amit.pundir@linaro.org> References: <1533062586-804-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); }