Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp418140ybg; Fri, 12 Jun 2020 05:09:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTxE2ZMQO2nSADtQpV87I2hUcdJCM1gad8UxqqYhsN7v7xW37P4M4XLcyOMxVtsgPXjijo X-Received: by 2002:a17:906:ce28:: with SMTP id sd8mr12622755ejb.280.1591963795350; Fri, 12 Jun 2020 05:09:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591963795; cv=none; d=google.com; s=arc-20160816; b=R1aEQ2Lb0xgFyLBinlutFxcDFdkTQjS/NPpjqD4x0ANDDpgAvdDOZ+9BpMxyyc/8bJ zpS6R5I3zYrplyuZzG+LUOTiLBG+ew32kkZ1TDeViUT15sjg+LHyEKJOv/CcQgAFPgsH C3hZSxnAGN9NI52kUGGg6Qw/jou1PVrmzoNbCVRIrEbYoeRlc6mnOnY73vXeaUKTTrKQ ivwR7s70tQTb6xgKgV33CBHkWr5ivXqIrqxp+hIEKOXlw9kJ8RGDe0M5V3s+K3D0lRcf +EGOWidfOBhDO8CpUwWhg/P8YTa/6480QMBWDptZRnH9mW4h9zYknf/sKiV+T35j8TwK GSUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=naLbiu6HsX+Z2d/q/OU86dDzWk8INFro9FYGhNZfqd8=; b=mu3reNa8qsUe3+Qap4gj/CJO4G8XKpgqtcIgGzy3FEjOEUGHQ49hAJ8ChToNRJU5VP kXf3ksibUfUimcLHosMHeS9K1bUbZni3m0rD85wKQTEkPB7L3e2ptHCmkb+o8IxQ24jz soylyRE1+OkHzcgEqex8s4/xWpHnSW2Y4NrBF2sqGbrDoXVuUqtF+uUOanpggbpqd95D NXP8ML+fPc51iXIg+6LtCB44cAA3uaM2Oo/RazAAAg2qtAc1JU1dTEY8QHFvgBRv25Yb QFmHnkddmewxoluG6qvWU1YnmIPbnJb7XQa52CY37o9Vs8pPOg0aGazszLVrtuw7ZPYI F4aQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eetM67RL; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dp6si4129938ejc.472.2020.06.12.05.09.31; Fri, 12 Jun 2020 05:09:55 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eetM67RL; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726281AbgFLMHI (ORCPT + 99 others); Fri, 12 Jun 2020 08:07:08 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:60083 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725791AbgFLMHH (ORCPT ); Fri, 12 Jun 2020 08:07:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591963626; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=naLbiu6HsX+Z2d/q/OU86dDzWk8INFro9FYGhNZfqd8=; b=eetM67RLrETyT3K6iYouoMEJhdvi5QScB0BihcsfHyU2GyuHhUDpcSf71A7Nw+CN9/5oS0 KM5degyB+4c9vf07BK99Jn5N8qsHSjastfGMJshy7wV7GQn0U1BRS09HAs7k1lIMyn2TXi w+/TddjcbYDEU8JUTPua6t0iNCKGsCU= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-55-nx0SCqPJOY6-_Cyy0KwhKw-1; Fri, 12 Jun 2020 08:06:54 -0400 X-MC-Unique: nx0SCqPJOY6-_Cyy0KwhKw-1 Received: by mail-ej1-f72.google.com with SMTP id ch1so4074215ejb.18 for ; Fri, 12 Jun 2020 05:06:54 -0700 (PDT) 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:in-reply-to:references:date :message-id:mime-version; bh=naLbiu6HsX+Z2d/q/OU86dDzWk8INFro9FYGhNZfqd8=; b=PxY4Wdud57DnexnkVs+mnlZak1Ty39spUCMIWWi7ideJnEE9b8PldMNScTyIoA+KQp HTQUX9dhcxu6bSURBf5fTxri2YiJ41zOpUhyIBiAFdEN62UNktJH9uRzkY9+5GjF9niI 73OvC/IDo0ReokxxTq5YPHwRhr7bDYOEVQAfomeLhQoVoX585uj7AiasWFTMUSxCIlnf SAJ5Ln34TanVXS1+BkePJJzsx7DaQU5k8ApjnwYVIFMe3VF5f8WHwkaE7i7ILCwoioXC /nnVBLCjbDAigEp2BjMMyWY1MpnxRjfoCpyJYuuYfPBnE8YglL4jEo2wlbgJdIWm+0TW vmyg== X-Gm-Message-State: AOAM530D9Vu2UAhsMBf0hndDeNQqiJ8G+x6GjGTYOicJpJUqZG2vMcIO RcwL8/r9CCfgHawJ0Mk0eFUtXu6ViJoCAjjAimqj1w6RyWVM+ocoyWBZtF3l+giiPtRxfLyl78h /g0dab1kMPyVxEQ9SsMahgP+1 X-Received: by 2002:aa7:dad6:: with SMTP id x22mr11558433eds.265.1591963612878; Fri, 12 Jun 2020 05:06:52 -0700 (PDT) X-Received: by 2002:aa7:dad6:: with SMTP id x22mr11558414eds.265.1591963612639; Fri, 12 Jun 2020 05:06:52 -0700 (PDT) Received: from alrua-x1.borgediget.toke.dk ([45.145.92.2]) by smtp.gmail.com with ESMTPSA id o90sm634231edb.60.2020.06.12.05.06.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jun 2020 05:06:51 -0700 (PDT) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id 69A291804F0; Fri, 12 Jun 2020 14:06:50 +0200 (CEST) From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= To: Joe Perches , Jesper Dangaard Brouer , Gaurav Singh Cc: Alexei Starovoitov , Daniel Borkmann , "David S. Miller" , Jakub Kicinski , Jesper Dangaard Brouer , John Fastabend , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , KP Singh , "open list\:XDP \(eXpress Data Path\)" , "open list\:XDP \(eXpress Data Path\)" , open list Subject: Re: [PATCH] xdp_rxq_info_user: Replace malloc/memset w/calloc In-Reply-To: <427be84b1154978342ef861f1f4634c914d03a94.camel@perches.com> References: <20200611150221.15665-1-gaurav1086@gmail.com> <20200612003640.16248-1-gaurav1086@gmail.com> <20200612084244.4ab4f6c6@carbon> <427be84b1154978342ef861f1f4634c914d03a94.camel@perches.com> X-Clacks-Overhead: GNU Terry Pratchett Date: Fri, 12 Jun 2020 14:06:50 +0200 Message-ID: <8736705vz9.fsf@toke.dk> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Joe Perches writes: > On Fri, 2020-06-12 at 08:42 +0200, Jesper Dangaard Brouer wrote: >> On Thu, 11 Jun 2020 20:36:40 -0400 >> Gaurav Singh wrote: >> >> > Replace malloc/memset with calloc >> > >> > Fixes: 0fca931a6f21 ("samples/bpf: program demonstrating access to xdp_rxq_info") >> > Signed-off-by: Gaurav Singh >> >> Above is the correct use of Fixes + Signed-off-by. >> >> Now you need to update/improve the description, to also >> mention/describe that this also solves the bug you found. > > This is not a fix, it's a conversion of one > correct code to a shorter one. No it isn't - the original code memset()s before it checks the return from malloc(), so it's a potential NULL-pointer reference... Which the commit message should explain, obviously :) -Toke