Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2510041imm; Thu, 7 Jun 2018 11:52:36 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKVGAJP8tXu0+PyfG3qsLiemaAYJ1tNFhVcOhxLWUQNCWeuqkarDlBk3+mCSmmhOCisz/Wy X-Received: by 2002:a62:e8d:: with SMTP id 13-v6mr2839232pfo.63.1528397556812; Thu, 07 Jun 2018 11:52:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528397556; cv=none; d=google.com; s=arc-20160816; b=ehD7iLaq63Ov1i/sFgMhJx7QRLr8d3+Iii4UKrv8E0Gb4CmeMrX3z6vl2tMHeJbkx/ 14PUoYiaEbAwUn0xVFA0Rim36dfPeNeOIHGCXjmqsWkc23xaeLBIhKnopxIKl5znBdVm MDHrSaDGtWBungLM5JOJfR7Du3L8ZDN0F1yLxyrCe8rA/Jh3lDPwhL8IPIbyKjtX5zR2 sW8+IxBBKcjRsG1z1xHVWRNl82dEJQaTYzXpN0dNCiyyyMQm5zwmasU355C1SukKWosk NPhJocGTnU7ytINXKVd0mnwIuPXM3czQBjLqiiYC7hW+KD0ToPzGAnWrhrodf5Hy1OVs g1vQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=3eUqdrufvt3nmsfQlLuUVk2Br83T0pr6nKhqod0PgbQ=; b=vEGgHk6XcD3yxl4TnGsVoirGH6yMgaWkGDeLW8nJGpLjEBQBSQgMl5GKT3ueBDwQIQ mQvdwHXls1o29563yBtaIoq7c7herMpVmtXuWtTa7cgE9fIn7PGDSgDYiXiiSsR1sOwP ZDaw9CcVQY3YUIIWrYdyWdMXuWnPHIQxqZtt3GCSpgBclVjvT/GSBQ+JiF2zIG255KXr z5VHPVwpiBe9nmp1P685r3+5fiP0O9YMqR14CcwOJbXMfBnUVTSxEK3XqINTkVGLHuoS WiT+nk/ujeF7tUioKjdAgzqPmOOCagPcRoH6RuDcsQtxGxcGdmQUZY4/VAK6Kwubrmnk EcYQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g83-v6si31563371pfg.225.2018.06.07.11.52.22; Thu, 07 Jun 2018 11:52:36 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935668AbeFGPXh (ORCPT + 99 others); Thu, 7 Jun 2018 11:23:37 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:41209 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935550AbeFGO6l (ORCPT ); Thu, 7 Jun 2018 10:58:41 -0400 Received: from [148.252.241.226] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1fQvbY-0005hL-Qb; Thu, 07 Jun 2018 15:09:32 +0100 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1fQvb9-00036x-Ez; Thu, 07 Jun 2018 15:09:07 +0100 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Kees Cook" , "Johannes Berg" Date: Thu, 07 Jun 2018 15:05:21 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 277/410] regulatory: add NUL to request alpha2 In-Reply-To: X-SA-Exim-Connect-IP: 148.252.241.226 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.57-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Johannes Berg commit 657308f73e674e86b60509a430a46e569bf02846 upstream. Similar to the ancient commit a5fe8e7695dc ("regulatory: add NUL to alpha2"), add another byte to alpha2 in the request struct so that when we use nla_put_string(), we don't overrun anything. Fixes: 73d54c9e74c4 ("cfg80211: add regulatory netlink multicast group") Reported-by: Kees Cook Signed-off-by: Johannes Berg Signed-off-by: Ben Hutchings --- include/net/regulatory.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/include/net/regulatory.h +++ b/include/net/regulatory.h @@ -78,7 +78,7 @@ struct regulatory_request { int wiphy_idx; enum nl80211_reg_initiator initiator; enum nl80211_user_reg_hint_type user_reg_hint_type; - char alpha2[2]; + char alpha2[3]; enum nl80211_dfs_regions dfs_region; bool intersect; bool processed;