Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp7072654ybp; Wed, 16 Oct 2019 03:26:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqye/reGgOR9v/xm8ZnH90LZt063xUBDeevhBozKQwJzuAZDIKitlD81YQ1bxwf8v6yQb9z9 X-Received: by 2002:a17:906:5e50:: with SMTP id b16mr38912229eju.156.1571221578915; Wed, 16 Oct 2019 03:26:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571221578; cv=none; d=google.com; s=arc-20160816; b=T4Trbc9W8yDv7BS6qpwJFofpsitsAyJs/gtqrDNR+XNlirHB/nB8eTiXwe7NxS1ohA f28tH9pOLeBpftWyLwJwsTgKuCw5JWryMPlcVXEhIeZWm5kiCv0X7/WoeT6vmvraoJ0H F4+S15mIpH5S31LGAF/FKLP+VaZWW2jszrmekLhLESKURDcALQp+OBWjueQWvOQFftby f4aUHoIQvGpiCAtFN9IFkN9dOFclUFxbg1YcXh33JFlGPQThoj8JYqlj5FEzfCa8cPqg vaJhr98q853xTpardfL7Jct/1r5KYhzjMnmylOQk9bqmiBjg2sBWjN5o8VuhpllT+2JF gNFA== 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=dZBjgflZUS0VEu2+zyGgxZgBbs6Ispwu0JDsbM63CLE=; b=C+Qgkjt5nMg/eGDshHjz2lk4JL7esgaOoTKPMmShKM2krAuQ6e95y23rf3giyfNibT W4EgMCk2v0/lC7UrW+tXea/hoKQ2NAEGug1rYGpx8UFy7fT6wo4JbaUCdFTn8qHzlmnJ i8vl0hT9A09Kah8LMyZpJebbZv/MP2d8fRUvY0YgxLN4EdPQD+ezOImmXV2jRTdSfDUw KoXEOMn2Hm9U6Sn9edE8Mz3eBLU2CWSbs2ZeOmen+C8/ykavx93Y8Jw1MJLynzhfYVkz 1BY6xxH6vYs6ukQlF5YRzvmdGSmC2ebIbkUv7Dr3s8sdnUGqKB6X/d4vVY/COlzmlcyx SZ1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FsMI5jcf; 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 d9si17254242edb.371.2019.10.16.03.25.55; Wed, 16 Oct 2019 03:26:18 -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=FsMI5jcf; 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 S2389410AbfJPCO5 (ORCPT + 99 others); Tue, 15 Oct 2019 22:14:57 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:37673 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730455AbfJPCO5 (ORCPT ); Tue, 15 Oct 2019 22:14:57 -0400 Received: by mail-lj1-f193.google.com with SMTP id l21so22287429lje.4; Tue, 15 Oct 2019 19:14:55 -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=dZBjgflZUS0VEu2+zyGgxZgBbs6Ispwu0JDsbM63CLE=; b=FsMI5jcfDV8QuHHUyk8C6hI6V3hKANoxTut3jPAALDhpSpkUuL+u5sgtcVFb6hwhTH MuesHwQ6Q+wu6JLhERHXVd1BY178VDtJquh8PqycvgERReId04sSNaKNPXGTfG2zfLt+ HaFkEXEZCVN87iM7QJ5Y4jIaHoADJN0SBntJLlZodccARQadmgK+1eQfbZskV9WhX2Ei b1vw8Zcf+OgP2Yd7gJXhdJrOiPm1KAMEbjhntCioVfzPx+Bzl+460RrqvzFMWSCeuTs8 0jQ5SZ1OvomnsnjFKQuusU+udw0mvHGYWRq/w1vX7gF7Qajuy4GQI0Ao2Jw7D11h7oRh gREw== 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=dZBjgflZUS0VEu2+zyGgxZgBbs6Ispwu0JDsbM63CLE=; b=hM4L0Q/dJemLZJkRg1FVJgo8P/pSif0HX7CfMEcK4GZA19a6Vbo9DgTQRJHuDyaecT N4eEov5Ml3QPA/qTVknyRqTQB2ee1b6GineAK5/iXtIokfp6mO783FdMMqmO2l6DOPMT NWqflKxfF5V57JEx50GZ4Fxkm7VoWnyWW1iEoMRM1rCcgtnbbJPEVamW94IKzXm/3rEF oEZxVIvx5rXhuBFaTfwSFke6kJUMOW5j5MOTs9uHBR5LikQXzse2pC8Ww9+6G05AwInX 0tPa7+qJ6dZYup2BZhiclPhchCs3iQBawbhQf4VJ19zsO9W3QUKuCSw3n3IKiePFg4An 1uRw== X-Gm-Message-State: APjAAAUR2RzwunbfzsFnomyqHgzTZ6AK6arxGx/Yu7YDr+n53JNzpjHz OnVF4I10f0m4e7frTuNeGWYD17fgTof+es/ch1U= X-Received: by 2002:a2e:9cc9:: with SMTP id g9mr23396415ljj.188.1571192094476; Tue, 15 Oct 2019 19:14:54 -0700 (PDT) MIME-Version: 1.0 References: <20191009160907.10981-1-christian.brauner@ubuntu.com> <20191016004138.24845-1-christian.brauner@ubuntu.com> In-Reply-To: <20191016004138.24845-1-christian.brauner@ubuntu.com> From: Alexei Starovoitov Date: Tue, 15 Oct 2019 19:14:42 -0700 Message-ID: Subject: Re: [PATCH v2 0/3] bpf: switch to new usercopy helpers To: Christian Brauner Cc: Alexei Starovoitov , bpf , Daniel Borkmann , Martin KaFai Lau , LKML , Network Development , Song Liu , Yonghong Song 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 Tue, Oct 15, 2019 at 5:41 PM Christian Brauner wrote: > > Hey everyone, > > In v5.4-rc2 we added two new helpers check_zeroed_user() and > copy_struct_from_user() including selftests (cf. [1]). It is a generic > interface designed to copy a struct from userspace. The helpers will be > especially useful for structs versioned by size of which we have quite a > few. Was it tested? Either your conversion is incorrect or that generic helper is broken. ./test_progs -n 2 and ./test_btf are catching the bug: BTF prog info raw test[8] (line_info (No subprog. zero tailing line_info): do_test_info_raw:6205:FAIL prog_fd:-1 expected_prog_load_failure:0 errno:7 nonzero tailing record in line_infoprocessed 0 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0