Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1881666ybb; Sun, 29 Mar 2020 16:07:21 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvu0EsOPoNwJf8bpsQTKVD0P7w7DENZ2zPoL9gYj+eXE+JsbaK9vWM+anYRZO6QWR+hZiEw X-Received: by 2002:a9d:1921:: with SMTP id j33mr7341572ota.309.1585523241664; Sun, 29 Mar 2020 16:07:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585523241; cv=none; d=google.com; s=arc-20160816; b=mvU8TCYp6N+uhC6We0v2tm+3cy1KJURQz+7Wg34ZWct/WNg0szXEVF+m8r3E7fIJz4 YNvt4Liq+dvfDx+U4xtBU31FUbvplPwhleTQQwIV7Bw04VD+ufH0267EAoLrtWVyJxyJ cnTXPOnHHd8d/ZP9EgulAfjalrZfBbl2dxfq06EymilyLa1Or6UrNIWOrkG5+p2zKY02 hlGTDvOC7lPVY+oFFeW7c7cT1Wi8aoJAfZRVTzZso+5yPYDpfphCXlXIj9RSm3lFGwOH xrt21HZwSx2OhGq3hapO5SbtGDZMZiAV/MjU9osvmOFc6MnUcAeQItA9TGuTGzTC2iW2 UauQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=ulfC6hgy6ACkHw+iBinr76TbGOLClSVkLu9pFAuKoVk=; b=hW2nEz2d+JqjHn+JfOhekG5DTs5Xx4O36sS3f5mOvDirUFdSd2thQVVog+3jdzSpo6 q+Zr7tzq11sZB8LYup05iNyE7jGBc3wh4sCihWT7K3UyOu7KCXdt5gd5xcVZ7e9MqC3A hRgLdPEe3s5i83eWfENR/rccLo24UdkJ9XykkZlmxvCUc3Al7sEF/H7R3DVz+EuSetqi SuGTLpnIZRLMNDQkGTzCayzmMADJ0mMEzqHrnmSInl2h2VE1VEpLL7qvawg8lLg5cTtD TzrziV0oNIljwdyRVtiz6+1l07g05x/lEOQMKjPqNqGbAE0/uqfWkswauKOdyZPORiEs EazA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iqWLNyBy; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z16si7029258otj.5.2020.03.29.16.07.09; Sun, 29 Mar 2020 16:07:21 -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=@gmail.com header.s=20161025 header.b=iqWLNyBy; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729110AbgC2V4B (ORCPT + 99 others); Sun, 29 Mar 2020 17:56:01 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:55605 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728966AbgC2V4A (ORCPT ); Sun, 29 Mar 2020 17:56:00 -0400 Received: by mail-wm1-f66.google.com with SMTP id z5so17740671wml.5 for ; Sun, 29 Mar 2020 14:55:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ulfC6hgy6ACkHw+iBinr76TbGOLClSVkLu9pFAuKoVk=; b=iqWLNyByOYdM4pCxKi6Y+Yw8cPv1WLvCSpp3c81OjmFm5ZdrBUX6u7jYDIQvci1j3v TXxbTQvIB7KB+VZYPD66CLdbbg7m27bNtAXVx00jWlGmnSx4MFgt4rd3dfMB3UForC/6 FrgEw8ni2L5DlIFeNHOPKi5g/A2pRODrkZv2Ce4O8cNDkVAt1ph5z+TffaHEVIaqUD+/ 5WxGdas30Ni3v7IYugEe2KCW6YLvoMe0/GWhz+eh9DE0jBnGBgrrpRjl0kd85hDXlhKX ioVMNb141ADzdXw3Kjvp/C88HOsgGty0Ybyuj/rfuBAceHTl3sLIkVVEl2VIqigUVEKZ dP0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ulfC6hgy6ACkHw+iBinr76TbGOLClSVkLu9pFAuKoVk=; b=tW4QZyWvdHaOIDAI327KfCSCy0BuWfJBb0ygaJYSN7+Iq7aZ9j53+/6wfqHbY5WNEB fKxWRZl329LfFqgaQ/H7YkTpfOeOfvmfHHtjBwRbcHVNOs2cjHTXFY2kc+RijEgoMS9Z uVhq4jird6Q0PmXE6GdTSgEZoZ1oIIkdxNinOZrKBT8Bhsh73vbqvrOXo9o7e3CMPh9m sxlFyGzGO+8oP+4B5op1ZDuAxIdpd+Pn7ieOFe6t14zNF3xvW347u7Tm5Hm8TNaGBndn OIeb+mUNoWH8hGlpXIEu3r2eex57s8uY54hyhMDzsCiZ9VRlof4W/4Nn2R6Ac9RDUCbz f6Pg== X-Gm-Message-State: ANhLgQ1HjjV6Nx4+m7/0tRr8ifbL74TvxWyY0UHr1N/xpxj+/lb0yboT km2lBzsGvN9avCJC1CQj1HhS4gIbbRr7hRZv8tEGCtSe X-Received: by 2002:a1c:2e10:: with SMTP id u16mr9475250wmu.143.1585518958887; Sun, 29 Mar 2020 14:55:58 -0700 (PDT) MIME-Version: 1.0 References: <20200216213624.800463-1-sjoerd.simons@collabora.co.uk> <74c04f11-4b67-d1a7-7d05-197a229b245c@cambridgegreys.com> In-Reply-To: <74c04f11-4b67-d1a7-7d05-197a229b245c@cambridgegreys.com> From: Richard Weinberger Date: Sun, 29 Mar 2020 23:55:47 +0200 Message-ID: Subject: Re: [PATCH] um: vector: Avoid NULL ptr deference if transport is unset To: Anton Ivanov Cc: Sjoerd Simons , linux-um , Richard Weinberger , Jeff Dike , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 17, 2020 at 8:54 AM Anton Ivanov wrote: > > 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 Applied, thanks! -- Thanks, //richard