Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4495307ybv; Sun, 16 Feb 2020 23:55:54 -0800 (PST) X-Google-Smtp-Source: APXvYqxMAUBehxRR3+RkFeXFdBS2W7ynbDdYeJ4kBUaWHUXqnjAXl6B3fIZexLg9xwr1gVWSDofi X-Received: by 2002:a05:6830:1385:: with SMTP id d5mr11692541otq.61.1581926154718; Sun, 16 Feb 2020 23:55:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581926154; cv=none; d=google.com; s=arc-20160816; b=pL3neJymF2/xV+B2xybMutWKms9kg9xul2yccdjJvheIhFkU/UI/c78+a6YO79PBvs byU/kZj4ynZxOBUnOb99QpP1xAww3XVP0peg2iFYn8M593dqyZ0tmvvCt6T3oSR5W9MJ DptK5IyyzdMpSh71F/mEjPfTr6l5F6jPzHBaYznAUFB+TV9kW6fsS9LHXDoPSZQvm5hV 2gxqbGVgDpPexvHhIlEenFKNCUA2Vma5p5qRq5kfavnW66lkE51mmUeFgmE1YidEd1vq lxzy833lKj54QyyGavqOw/Ln9Be7NB32hfAx1/0eWUH+58ovbRDXm23G5gQJ7FCoCAYC tAUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject; bh=0VL4U/Yok2nsdhu/NDoIBJcUfTvyx6fq3eWseTNjfxE=; b=H5VC6FsyKZu6HHEttTO1Z6eiIgf+z57S27oVGvLiPQSmDx4aGHMKZzDQ2Qay9I2WtW rY4Yk/8c8KeJrTbOXS4ZyL9HOuIW0sjyuYs+lJ3u/EGf5iHj6/zIyQ0ANB8IeZm+Is5/ y3WxoWpP7Va/8PpKByF0ypanN2zJqlhhpax8vGdH07Qcy3yC+45npAdWFmjowTt3Vgom GKycnwSL3fgDY7cVIH94HZJQaFOx9F+qDLRjoh3qWQe983hOeeafVKz3sbWVnWyMWBeM CNA3elRmLaejere5DOkcDQ9J8oB9nBWqlx7xju2bPo6E4XUvj46WDce1ywhfM3WkAFad iMqQ== 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 o1si6354884otk.154.2020.02.16.23.55.42; Sun, 16 Feb 2020 23:55:54 -0800 (PST) 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 S1726414AbgBQHx4 (ORCPT + 99 others); Mon, 17 Feb 2020 02:53:56 -0500 Received: from ivanoab7.miniserver.com ([37.128.132.42]:60426 "EHLO www.kot-begemot.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726289AbgBQHx4 (ORCPT ); Mon, 17 Feb 2020 02:53:56 -0500 Received: from tun252.jain.kot-begemot.co.uk ([192.168.18.6] helo=jain.kot-begemot.co.uk) by www.kot-begemot.co.uk with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j3bE0-00077C-Qf; Mon, 17 Feb 2020 07:53:53 +0000 Received: from sleer.kot-begemot.co.uk ([192.168.3.72]) by jain.kot-begemot.co.uk with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1j3bDy-0000Vm-LO; Mon, 17 Feb 2020 07:53:52 +0000 Subject: Re: [PATCH] um: vector: Avoid NULL ptr deference if transport is unset To: Sjoerd Simons , linux-um@lists.infradead.org Cc: Jeff Dike , Richard Weinberger , linux-kernel@vger.kernel.org References: <20200216213624.800463-1-sjoerd.simons@collabora.co.uk> From: Anton Ivanov Organization: Cambridge Greys Message-ID: <74c04f11-4b67-d1a7-7d05-197a229b245c@cambridgegreys.com> Date: Mon, 17 Feb 2020 07:53:50 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <20200216213624.800463-1-sjoerd.simons@collabora.co.uk> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -1.0 X-Spam-Score: -1.0 X-Clacks-Overhead: GNU Terry Pratchett Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 16/02/2020 21:36, Sjoerd Simons wrote: > When the transport option of a vec isn't set strncmp ends up being > called on a NULL pointer. Better not do that. > > Signed-off-by: Sjoerd Simons > > --- > > arch/um/drivers/vector_kern.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/arch/um/drivers/vector_kern.c b/arch/um/drivers/vector_kern.c > index 0ff86391f77d..ca90666c0b61 100644 > --- a/arch/um/drivers/vector_kern.c > +++ b/arch/um/drivers/vector_kern.c > @@ -198,6 +198,9 @@ static int get_transport_options(struct arglist *def) > long parsed; > int result = 0; > > + if (transport == NULL) > + return -EINVAL; > + > if (vector != NULL) { > if (kstrtoul(vector, 10, &parsed) == 0) { > if (parsed == 0) { > Acked-By: Anton Ivanov -- Anton R. Ivanov Cambridgegreys Limited. Registered in England. Company Number 10273661 https://www.cambridgegreys.com/