Message ID | 1524045904-7005-2-git-send-email-amit.pundir@linaro.org |
---|---|
State | Superseded |
Headers | show
Delivered-To: patch@linaro.org Received: by 10.46.84.18 with SMTP id i18csp5694407ljb; Wed, 18 Apr 2018 03:05:22 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/3lTL3Ggl8QpTR6K0m6FLA2BUli7a7xtllzhaLuzsD4J67EUsFmha1xsvL+S8G2RUDZ7xD X-Received: by 10.101.96.65 with SMTP id b1mr1264720pgv.340.1524045922048; Wed, 18 Apr 2018 03:05:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524045922; cv=none; d=google.com; s=arc-20160816; b=bCHFJL2/gxKPxZEHyHg6A6OFbhmryIbc3vcaeNkF4aEEOX1dKGOiYbErosO5RSfSdB dvPtClGQp37Ilzg0HJXimAge+Il+IuGiv+1Y3yifuUK65S/NCInoKKvrPwC6iDLiLFuQ +6p2q2R49rIe8qJXvbhahNePc+fiY8DffTNdQ/Y++5B21oAekx49IXOLkhYEoycTbsBK Wf2hp73yL1sTRYKydtFDpVsU/FYrMtIyEhGjb/vLPp6jOIFwRY8JVqidkaJ7imPT09dO kjl6GeM0bz2FiKHsLAoBA+8klb8QymtBzDaVusDT0ThxHc/nZ5Tm9KGpW8+D4OtrqQhY T4YQ== 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=BSvaSnSaUmVJ7Li8G5jPfvmWzxU8loCxeYaDdT0Atkw=; b=X0JeYhKow/Jj2cVPYF+KQtC60t1GJTl5e32b++Y9wZC64YAYvPy4cUjEsVNpCT5Bmn WNBCie7BnyAKNf1UF7fZ3tvrn1hVh6UQeVxpNvRy14aMc4bc1LZFibi7280DdFRYx7Kq id2S6bK3CrDwrXDy3LMIxGcXxerRmOfeTm6HG6AuVeFhdxghFOuf0gunFl810+d3EB0h fsm3wU9GoRnfvZLlrWQtIaTc3YwCljrJD5yrbmIa4G+6t3Oyw8G2AEu+4amLfInsoRvI 9vlGRmJvxV5i/LhtYi3oEFov8OtTtR7n6DlsqMnuQDY/CC1khlSvjI1be2QCcC2RxVd5 QZkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=A2Yb2+ds; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: <linux-kernel-owner@vger.kernel.org> Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g12-v6si941274pla.133.2018.04.18.03.05.21; Wed, 18 Apr 2018 03:05:22 -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; dkim=pass header.i=@linaro.org header.s=google header.b=A2Yb2+ds; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752981AbeDRKFT (ORCPT <rfc822;ramon.fried@linaro.org> + 29 others); Wed, 18 Apr 2018 06:05:19 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:39410 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752747AbeDRKFQ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 18 Apr 2018 06:05:16 -0400 Received: by mail-pf0-f196.google.com with SMTP id z9so665820pfe.6 for <linux-kernel@vger.kernel.org>; Wed, 18 Apr 2018 03:05:16 -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=BSvaSnSaUmVJ7Li8G5jPfvmWzxU8loCxeYaDdT0Atkw=; b=A2Yb2+dsBznNACeCzktKB04NeyHXS/rtf8TNYmHdR6p18lbyTuw01g3vbym58csWOX w/2ZOp6BsbdU7jQZG9itdEnq/m8Ia9UTg87qn9YHV05Pa5iCB5cn1f1/XIXgn6pWSSie 0IVZBj+0vCR5l55epgmOIA9EQFAx/1d7kvrvQ= 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=BSvaSnSaUmVJ7Li8G5jPfvmWzxU8loCxeYaDdT0Atkw=; b=kFzuIRIEocjiLFFVH8j7gXVfFC9S3hqgvLi0VAK5Jj2sUS2oI8hKiO3EMT8qbvVsNT thJhAC2R6XLVf4hvaPQTZWEysFSOfJHH3+aT3vvG20AmzyWngGuojfrZicaUSIt/BFnk aqHWRe7MJizEptEvOemdXR8Yov9uqV7jOehd2XiyBBMcC8d9GPJ75p/03qAiF8ST+gIe I8wsMM1ClcAAZ6kibZ+l+k0j4O+8Oet8dL0OA3Ov7LsysWT70HqNV9jeLygMovxuL7GK YwuaqtH6KZi+fmQ8f3HCH+6a3znDH6xcP4+KwubMgdLs0kSCIOnwOYPi3jmDLqjElquB 7w1A== X-Gm-Message-State: ALQs6tCDr0W9hG46oHHo5cBNOKbdinQMR18Hbu8yL3irZu7hPpBIf3+V 2gCIL5oZog7lraLgdlLQBQiMXYNCxMQ= X-Received: by 10.101.93.7 with SMTP id e7mr1264772pgr.119.1524045915213; Wed, 18 Apr 2018 03:05:15 -0700 (PDT) Received: from localhost.localdomain ([106.51.17.69]) by smtp.gmail.com with ESMTPSA id z16sm1970298pfn.101.2018.04.18.03.05.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Apr 2018 03:05:14 -0700 (PDT) From: Amit Pundir <amit.pundir@linaro.org> To: lkml <linux-kernel@vger.kernel.org>, linux-wireless@vger.kernel.org Cc: Samuel Ortiz <sameo@linux.intel.com>, Christophe Ricard <christophe.ricard@gmail.com>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Greg KH <gregkh@linuxfoundation.org>, John Stultz <john.stultz@linaro.org>, Dmitry Shmidt <dimitrysh@google.com>, Todd Kjos <tkjos@google.com>, Android Kernel Team <kernel-team@android.com>, Suren Baghdasaryan <surenb@google.com> Subject: [RESEND][PATCH 1/4] NFC: st21nfca: Fix out of bounds kernel access when handling ATR_REQ Date: Wed, 18 Apr 2018 15:35:01 +0530 Message-Id: <1524045904-7005-2-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1524045904-7005-1-git-send-email-amit.pundir@linaro.org> References: <1524045904-7005-1-git-send-email-amit.pundir@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org |
Series |
Few NFC fixes from android-4.14 tree
|
expand
|
diff --git a/drivers/nfc/st21nfca/dep.c b/drivers/nfc/st21nfca/dep.c index fd08be2917e6..3420c5104c94 100644 --- a/drivers/nfc/st21nfca/dep.c +++ b/drivers/nfc/st21nfca/dep.c @@ -217,7 +217,8 @@ static int st21nfca_tm_recv_atr_req(struct nfc_hci_dev *hdev, atr_req = (struct st21nfca_atr_req *)skb->data; - if (atr_req->length < sizeof(struct st21nfca_atr_req)) { + if (atr_req->length < sizeof(struct st21nfca_atr_req) || + atr_req->length > skb->len) { r = -EPROTO; goto exit; }