From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6910AC76195 for ; Mon, 15 Jul 2019 14:16:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4181A212F5 for ; Mon, 15 Jul 2019 14:16:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563200217; bh=MqQ7+6uO3U1MJ9rEw4/ihtpnAkJ3hCypH8t/tLfmNLI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=IPop7tYTTxtJCcuH/adNhUUTLf60jU//Ong36IUuUASi233pojgzktwQeKNpraNOT SFTZZShP1//IPgof3NO7ClDZFx8mK+RXO8S3j/o1/pDqoJkoN4Xr5EFIagzfrrlJVp Eyh7gd3Np57H9L2+nH4dNzVNWQ5xsSjs8TAv+5nw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389457AbfGOOO5 (ORCPT ); Mon, 15 Jul 2019 10:14:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:57774 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389438AbfGOOOy (ORCPT ); Mon, 15 Jul 2019 10:14:54 -0400 Received: from sasha-vm.mshome.net (unknown [73.61.17.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3184B20651; Mon, 15 Jul 2019 14:14:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563200093; bh=MqQ7+6uO3U1MJ9rEw4/ihtpnAkJ3hCypH8t/tLfmNLI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=azcGRny1fqpnUuYUCwAVH8Kj85/+KIPAQgWtme9BolnHaCDhVxh18c5Ii8Dx1urGk MUx3nz0CFzgOB8QE0bopmIxARTMeFpnqo01rWPBSAzC38ik1i9wpkqxwrLdoaif5oA 5IJ8fv74YWqmF8izGXFkIV+GzM1UFpclZOUcc2Cc= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Baruch Siach , Song Liu , Jiri Olsa , Daniel Borkmann , Geert Uytterhoeven , Linus Torvalds , Sasha Levin , netdev@vger.kernel.org, bpf@vger.kernel.org Subject: [PATCH AUTOSEL 5.1 182/219] bpf: fix uapi bpf_prog_info fields alignment Date: Mon, 15 Jul 2019 10:03:03 -0400 Message-Id: <20190715140341.6443-182-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190715140341.6443-1-sashal@kernel.org> References: <20190715140341.6443-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Baruch Siach [ Upstream commit 0472301a28f6cf53a6bc5783e48a2d0bbff4682f ] Merge commit 1c8c5a9d38f60 ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next") undid the fix from commit 36f9814a494 ("bpf: fix uapi hole for 32 bit compat applications") by taking the gpl_compatible 1-bit field definition from commit b85fab0e67b162 ("bpf: Add gpl_compatible flag to struct bpf_prog_info") as is. That breaks architectures with 16-bit alignment like m68k. Add 31-bit pad after gpl_compatible to restore alignment of following fields. Thanks to Dmitry V. Levin his analysis of this bug history. Signed-off-by: Baruch Siach Acked-by: Song Liu Cc: Jiri Olsa Cc: Daniel Borkmann Cc: Geert Uytterhoeven Cc: Linus Torvalds Signed-off-by: Daniel Borkmann Signed-off-by: Sasha Levin --- include/uapi/linux/bpf.h | 1 + tools/include/uapi/linux/bpf.h | 1 + 2 files changed, 2 insertions(+) diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h index 9d01f4788d3e..9ae3f28ca469 100644 --- a/include/uapi/linux/bpf.h +++ b/include/uapi/linux/bpf.h @@ -2871,6 +2871,7 @@ struct bpf_prog_info { char name[BPF_OBJ_NAME_LEN]; __u32 ifindex; __u32 gpl_compatible:1; + __u32 :31; /* alignment pad */ __u64 netns_dev; __u64 netns_ino; __u32 nr_jited_ksyms; diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index 929c8e537a14..f6ce794c0f36 100644 --- a/tools/include/uapi/linux/bpf.h +++ b/tools/include/uapi/linux/bpf.h @@ -2869,6 +2869,7 @@ struct bpf_prog_info { char name[BPF_OBJ_NAME_LEN]; __u32 ifindex; __u32 gpl_compatible:1; + __u32 :31; /* alignment pad */ __u64 netns_dev; __u64 netns_ino; __u32 nr_jited_ksyms; -- 2.20.1