Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2627010rdb; Mon, 12 Feb 2024 10:42:40 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUT5Z9gWUN/uaNH0VBOxLuZvlmgkBDO3u0zQeYmfQgV2fMP+sMuE955VmNTrpcaYKBtAZdnADMhUkZtprtbWoWTjso3o/Xa8V9PI9SBpA== X-Google-Smtp-Source: AGHT+IEAnWsiuqUiBjd6lk3clquUaJnx8DmjsUjJPIzKlLhOrZ7RiCSTB+7/6vCruoSEBWctNmAj X-Received: by 2002:a17:90a:fe94:b0:296:341b:a60 with SMTP id co20-20020a17090afe9400b00296341b0a60mr5249074pjb.13.1707763360709; Mon, 12 Feb 2024 10:42:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707763360; cv=pass; d=google.com; s=arc-20160816; b=MDFj/ayyoBpJLf8WmSxH8tCu1PomBfXmjj32z4Jl+ZBn0/RXKe+44OnBHyXZXhXCWR vUfDuVX3yAnve7NFA9WkC5s5DgxucV6yd7ddAKVd5EKLDXaqs1W9vMSC4LrrsYKEQ0t3 vA7emnKtybMBZzT0onqrcssHvth+AuAxMPHwU24xYeJaVDsfE8OuGZyVlabXVggh7cbZ GQ1SUz8DmBbC8tjAGU4rl/Pwoi5iwjBFkL0uRctyFMJkd9CnrFTREYXR6F/Jr/lQggke RAJygog1AcIAASTmxvpPKHaHkfbOogiarASWXfYTannOyXj8u6VSI7LFKfhQggN/6mTU I0Bw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=C5O/DgDJHKyCX9I0LJ0N7xQAH4vdnIVRZHo7qsnEaBE=; fh=oKhcnaPRrVgFYPv7f47ld0uMOeq63+fzLqGju4r7JiE=; b=bCoKsXwMPttKXUQi1u7HTQXYmnHWmBCnRkk06RScCF5B4D84xM5scCs36UGAw9bhz5 Psqm5v3rDRg3gbMSBBEoMpb/R0qyzo/CJiUwPywtj0mNzaNYHudgs9AaOMgWYn31Js9N liCOa8zJ42FcfKEdtzj51TQJaWsLaeko+1eMHEHhhyTB8W51rMLasPS89hqk511QbWvs e05SwyYHqONVPYjpMBoHQFwbb9CCcwSK9u8yLx7pQSaZxjtMi7yQXweliVS4EdqbNS1D NpM8vl//9P0nLreTrpeTmqiUv9uPxWNch4QM9ynHX446hNN50S+gS6+ANOxLXElh40SW 1T1A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=CC3IZAjB; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-62207-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62207-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org X-Forwarded-Encrypted: i=2; AJvYcCV6Tt8JGg7mR9FhozwjH05o5c2ZoD+g1D4bbznz3WJ09n1ALgvXh3DKXFeYB26P8j1cjuowdhfKZAgmYle4a8pDEbolOZ8CbVgWNDXi5g== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id ip2-20020a17090b314200b00296c2c83cffsi660332pjb.68.2024.02.12.10.42.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 10:42:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-62207-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=CC3IZAjB; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-62207-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-62207-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 5E51828183A for ; Mon, 12 Feb 2024 18:42:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A441C40BF9; Mon, 12 Feb 2024 18:42:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="CC3IZAjB" Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 864B73FE2B for ; Mon, 12 Feb 2024 18:42:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707763352; cv=none; b=JvJf06gEKU4PBww+Q7I+JhX6N50ABAm8xHmRKnLq4wLAR0YThSxiQj2Dgg/peYwgiXLEdlWvCnGf7ia8J+oSzXshuFFCdmPqMrGFoYkLAPULWqLy9DY8WRnorHCGynTv5by1a6Niiz9W12/64ep0XCrjcXql6/SZl3ztRXuCJbg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707763352; c=relaxed/simple; bh=Dc5XPnxb7UwGebap8tjBl1xRgA1Ca1uOKkbMPUv6C54=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=GBmepKbc5a85SmtMTkuuzvKL7gzT0cEuJ7yngXn9hLjeevkPF2N/bP4EDH+UzwPPI6BTvult/C7nwl0Q3KhXS8+Rrykeg4cn1ruebp2s1iiFe3F/VhyAmSI8abauNyn+KtR31s/+uqeXhBS57HHqvQ1r2BFlt3kRoHVyeUODass= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=CC3IZAjB; arc=none smtp.client-ip=209.85.214.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-1d7354ba334so30159525ad.1 for ; Mon, 12 Feb 2024 10:42:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1707763351; x=1708368151; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=C5O/DgDJHKyCX9I0LJ0N7xQAH4vdnIVRZHo7qsnEaBE=; b=CC3IZAjBaE9iTWekttb/pkAkZ6a0cBlFBewIwLi0M0rAWolU2inX9QxcYLGPhZiIzv wLghtnt/+YjMl8X/T+Wgd+3diuASAKvZFBtTDakx/3miBwsfOyeDT+HvjkMkdxKkCP4e +a1qsptJRhZpAFXC8J+gMpUj/ndv+lFL/zyHw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707763351; x=1708368151; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=C5O/DgDJHKyCX9I0LJ0N7xQAH4vdnIVRZHo7qsnEaBE=; b=GdOFLJA1fDp64JjcD3ljz/vFYHJ9+9737nH8nN7MlnjJ9dwOrcJwNhftXs0kqK5IPp hMKGIGJS71XspMpPfjR7vjWbDGZmYaxRRrFSioNqR9BuL0RFIfUKB6aOjfioBvwRsD+m ce3exgY3JhRqrDgMp9ljn+G7AXrpp7SoEKdhjPJw/lMUcozRq+lLbjDflLccb2IW4pv1 dmDSUaNWALpommd65daQQu7Ec+4gNpDlmDJEjO6T0R8b4K4uA4ELOhkECncFFmVsnwOK YFoq9cKvZF0rE3bI6UJ2jQEp88sZbQH8KTV6TXggc3UZW8x77w8U+aFvWxDMUUc+KQ3/ NcMA== X-Forwarded-Encrypted: i=1; AJvYcCUEC/y9NbG7oFzpxZUo+9/rNvQ1GA8adU23niGWnodfJxjX55HS5CXUZtsfOTm+TU7UNfgTlmCw0rNMGp1xJApgIFwCFwA8+MW+67D6 X-Gm-Message-State: AOJu0YwPJMnoiQH0rwqIzGAaOudLWRv/b9M7RK2gmFNPGu4VoKnOmjyz uFhih+FVPBH7lErrMRLcw8uT29NWtbIJSNMkOzLL0Z+v/G/PY4nOeZTg47IlKg== X-Received: by 2002:a17:903:228b:b0:1d9:bbc2:87e7 with SMTP id b11-20020a170903228b00b001d9bbc287e7mr10750955plh.36.1707763350839; Mon, 12 Feb 2024 10:42:30 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUlN1kCG4L3xI7IqulfRnGZ15q3ilsPABEiCGdulsJoWDtsXE46LZ/Ym6P5yoP53zCEmaijFBQHFhM01x1GopsuaZFy1q6u6QC9IzmhFBRdPZznJos6l+0lclEdcvZGPvL481HLNn0rjz+zhmE= Received: from www.outflux.net ([198.0.35.241]) by smtp.gmail.com with ESMTPSA id u11-20020a170903308b00b001d9a146907dsm672613plc.11.2024.02.12.10.42.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 10:42:30 -0800 (PST) From: Kees Cook To: Tycho Andersen , Arnd Bergmann Cc: Kees Cook , Arnd Bergmann , linux-kernel@vger.kernel.org Subject: Re: [PATCH] samples: user-trap: fix strict-aliasing warning Date: Mon, 12 Feb 2024 10:42:27 -0800 Message-Id: <170776334482.2557794.95461406898503535.b4-ty@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240212111737.917428-1-arnd@kernel.org> References: <20240212111737.917428-1-arnd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit On Mon, 12 Feb 2024 12:17:31 +0100, Arnd Bergmann wrote: > I started getting warnings for this one file, though I can't see what changed > since it was originally introduced in commit fec7b6690541 ("samples: add an > example of seccomp user trap"). > > samples/seccomp/user-trap.c: In function 'send_fd': > samples/seccomp/user-trap.c:50:11: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] > 50 | *((int *)CMSG_DATA(cmsg)) = fd; > | ~^~~~~~~~~~~~~~~~~~~~~~~ > samples/seccomp/user-trap.c: In function 'recv_fd': > samples/seccomp/user-trap.c:83:18: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] > 83 | return *((int *)CMSG_DATA(cmsg)); > | ~^~~~~~~~~~~~~~~~~~~~~~~ > > [...] Applied to for-next/seccomp, thanks! [1/1] samples: user-trap: fix strict-aliasing warning https://git.kernel.org/kees/c/9ad28ca5238d Take care, -- Kees Cook