Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2341954ybz; Thu, 23 Apr 2020 16:22:12 -0700 (PDT) X-Google-Smtp-Source: APiQypJnil+5pvSMAdIM/ilWlLRn7Tu47NEClsMWsG25vQ3UfzX5Cr/A985uys2iLp6YtKoCfWkl X-Received: by 2002:a05:6402:d0a:: with SMTP id eb10mr4760626edb.60.1587684132709; Thu, 23 Apr 2020 16:22:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587684132; cv=none; d=google.com; s=arc-20160816; b=Dv2tF+0yu+de6JbGN0U+Qzn8ptjJzPwpVtTckhQ17kXLQjc0zAjoX+5wmiF4YYiD9B BMiGXfm8LKnEFGij5Jmddv+KBRKc+X8RkQfmDOPcrXCNg05/W/Om36cacZ058WihGape /gCD+obYyqaKAOjJBK2CudH6rgcDZtTm2gkVIoDL/IuP24jWbcdkDS7Y9Q/h+o2/x4J2 +W9eDB3/mLtt/xMv0SXvY3xr0KUXNg4mpW7H83ze6c+ky74peMaVkcJNUGj8mkrjF3Wb yRtnPxjaY8Iz2oo1gsTxXIcAf7vMF/cmuoulUH5ni/+TuMhVWACDKl/xFPtZXwmbfO7N ab6g== 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; bh=o9QZEZY2mF51YsqMYWyTvQPdMjm8gDhTlIF+pSiIvlQ=; b=MHHYJrdShxJutE7RisHj7mBJV6YuT7PyZxjwvWAF5NU4B7SVAiWc/amlQpM9sXIPuE 61LsUEVpSjhbbXMiUH/CoEvTc262umpqw4o22l1MknuNDU831/OSx/BnILpnTMhJcAq2 FPEqcm9Hjst5N+Wj9HLJrugQybAY4LZg4NNEaiFHQTjyVjvlcGHQ3ayuVOqaFXREk3mI KIk4qH8hvP3GO8eFpH6SUG6tfKTDratbbxwX7pP7YBliXbYq3gOmRwWlpGTbTLgKryh5 FpGIpfiDXX4B94YCYgCe8IK3+z6diq4Hy1My9xLLwS7m21YOStlIXR/Dbsx3M7n+484i qOSQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x61si2110984ede.23.2020.04.23.16.21.49; Thu, 23 Apr 2020 16:22:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729713AbgDWXUe (ORCPT + 99 others); Thu, 23 Apr 2020 19:20:34 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:48646 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728225AbgDWXGd (ORCPT ); Thu, 23 Apr 2020 19:06:33 -0400 Received: from [192.168.4.242] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1jRkvM-0004bs-1H; Fri, 24 Apr 2020 00:06:28 +0100 Received: from ben by deadeye with local (Exim 4.93) (envelope-from ) id 1jRkvK-00E6ir-5F; Fri, 24 Apr 2020 00:06:26 +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, Denis Kirjanov , "Mike Snitzer" , "Goldwyn Rodrigues" Date: Fri, 24 Apr 2020 00:04:46 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) X-Patchwork-Hint: ignore Subject: [PATCH 3.16 059/245] dm flakey: check for null arg_name in parse_features() In-Reply-To: X-SA-Exim-Connect-IP: 192.168.4.242 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.83-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Goldwyn Rodrigues commit 7690e25302dc7d0cd42b349e746fe44b44a94f2b upstream. One can crash dm-flakey by specifying more feature arguments than the number of features supplied. Checking for null in arg_name avoids this. dmsetup create flakey-test --table "0 66076080 flakey /dev/sdb9 0 0 180 2 drop_writes" Signed-off-by: Goldwyn Rodrigues Signed-off-by: Mike Snitzer Signed-off-by: Ben Hutchings --- drivers/md/dm-flakey.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/drivers/md/dm-flakey.c +++ b/drivers/md/dm-flakey.c @@ -69,6 +69,11 @@ static int parse_features(struct dm_arg_ arg_name = dm_shift_arg(as); argc--; + if (!arg_name) { + ti->error = "Insufficient feature arguments"; + return -EINVAL; + } + /* * drop_writes */