From mboxrd@z Thu Jan 1 00:00:00 1970 From: Guenter Roeck Subject: Re: [bpf-next,v3,11/13] tools: bpf: make use of reallocarray Date: Fri, 13 Jul 2018 16:53:05 -0700 Message-ID: <20180713235305.GA2779@roeck-us.net> References: <20180710214307.4834-12-jakub.kicinski@netronome.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: alexei.starovoitov@gmail.com, daniel@iogearbox.net, Andrey Ignatov , oss-drivers@netronome.com, netdev@vger.kernel.org To: Jakub Kicinski Return-path: Received: from mail-pg1-f194.google.com ([209.85.215.194]:44460 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729780AbeGNAKA (ORCPT ); Fri, 13 Jul 2018 20:10:00 -0400 Received: by mail-pg1-f194.google.com with SMTP id r1-v6so5471024pgp.11 for ; Fri, 13 Jul 2018 16:53:08 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20180710214307.4834-12-jakub.kicinski@netronome.com> Sender: netdev-owner@vger.kernel.org List-ID: Hi, On Tue, Jul 10, 2018 at 02:43:05PM -0700, Jakub Kicinski wrote: > reallocarray() is a safer variant of realloc which checks for > multiplication overflow in case of array allocation. Since it's > not available in Glibc < 2.26 import kernel's overflow.h and > add a static inline implementation when needed. Use feature > detection to probe for existence of reallocarray. > This probe doesn't work on my system (Ubuntu 16.04). libbpf.c: In function ‘bpf_object__add_program’: libbpf.c:326:10: error: implicit declaration of function ‘reallocarray’ bisect points to this patch. Guenter