Received: by 10.223.164.202 with SMTP id h10csp29813wrb; Wed, 29 Nov 2017 16:21:57 -0800 (PST) X-Google-Smtp-Source: AGs4zMZfwvSQTJZcNLYisqta73hRUKIZrU1s6KxZbUJadub9mKlrcoqCF/7sJ2NuGezleMpkSRgj X-Received: by 10.101.80.1 with SMTP id f1mr650838pgo.262.1512001316916; Wed, 29 Nov 2017 16:21:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512001316; cv=none; d=google.com; s=arc-20160816; b=C0FrbqH1HdNxcqUb448u33mfdDaB5M57ybdlDczGyBzZ5DNoEJHEOcj12YZ+Q5XY+a vYmzFtbzW6PEiZkztoKeu5wQArtOk//AhnlQ1Up5yHFyjfBmrHqxELDCWsBSNVSPruhC 1GVzVTf2FXkpv7ytCSJOBNucU7nojvGC53mpPZL6Aa9U1g/hXcM33EyyZYDgtGhSJ3d9 ScUozXCjExWqjXLGFWrNCL1IR1PmW5xB5h1Vli050GQN2pkYRSdgYIm2GnsjryP+ChWG YfpNm6t1fyrkn5eOlph0scuip5IfVO1R0/CMl1benYRonq2ab2QTxTCPdHk/Imve7GqU GFQw== 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 :references:in-reply-to:mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=f980YQtiim901WGFy5Nswi9ZY3ys2Ct97kCI4zsVbyQ=; b=av0quqpfwxY4+NxA8V2dBqs+zbk/tDhfzZmH7iP2AmG2pAQeNTzRuz4613rdy7mKg7 feLfSa+xcphk8lmUEfPvTzBYlf/239HaUe80jl7cnm/KgcECel95lowspW1UkLH/mwGh /UDpwVie6NEW93G1QrjC5LL8WBVr23a+0xMtRD4e36Wb9MIAn9N9RscuDHfFstOeXgJr EbdpFrGi2nIKUIpW52X7ozzbSyRSteNjw7E+mNWrgpiPg8V6THXafrIqiTket6jeutt5 gbVJEIjfPIVlGbgIgJtp7QYOCtSjEoTlCp6E8HUD596RvBGevaNHrdZl0dZiHQyngxWz Is5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@google.com header.s=20161025 header.b=Bynz/FTD; dkim=fail header.i=@chromium.org header.s=google header.b=mwYMMo2d; 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=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m3si2092117pgd.193.2017.11.29.16.21.43; Wed, 29 Nov 2017 16:21:56 -0800 (PST) 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=fail header.i=@google.com header.s=20161025 header.b=Bynz/FTD; dkim=fail header.i=@chromium.org header.s=google header.b=mwYMMo2d; 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=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753483AbdK3AVY (ORCPT + 99 others); Wed, 29 Nov 2017 19:21:24 -0500 Received: from mail-vk0-f68.google.com ([209.85.213.68]:44038 "EHLO mail-vk0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753339AbdK3AVW (ORCPT ); Wed, 29 Nov 2017 19:21:22 -0500 Received: by mail-vk0-f68.google.com with SMTP id s197so2389462vkh.11 for ; Wed, 29 Nov 2017 16:21:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=f980YQtiim901WGFy5Nswi9ZY3ys2Ct97kCI4zsVbyQ=; b=Bynz/FTDiu6feu8PmrfVTsxo4zn7KYx5aYv0xz0IpzJ5YZg3uh3Ow5nF7bZOq4j7p5 cAfLvz79Y2XgMFT77DjRfdf+FGWgvjTvpzDgnWjw1/LE33X8VkdXFEZ3sERp21CA/FiA s9EwUrLJeJqTa7ZQ1ViIslKcDy9UJHdAjvWKjGMZH3zj9qyYNc8PMYAhdm0KsImSVkxo JPpu9POT8lrQHMmOzUUoIWueD6jvSn8rv8v5bHlbZXR8ggOjySL1j0mLb2Vhdmb7ncdv p02HofzGINW6o/SzfdAYik4AF12QGBDW97Qyp2liIBQA3z3Ib0FcaPjEEIPcT9oHdMG4 V/pA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=f980YQtiim901WGFy5Nswi9ZY3ys2Ct97kCI4zsVbyQ=; b=mwYMMo2di9VDicL6TU48Ou+ZAYg57QZ28JC0E7oRsf8Qz5eO89ht70UT+qrfCSOk3t UAlJe813o3T9h9Wfd7hO1uQQx9FDK8EIDvt+8el9E9092aE44lXO9Q6f9RcJq1jXeVpQ r0y8gmeY7pRqEuq2XkN74RXKEU0Pyo4x7ySBU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=f980YQtiim901WGFy5Nswi9ZY3ys2Ct97kCI4zsVbyQ=; b=btXsor34e4q3Z5lJ1JJLAp4nSnm9kNH1/RL/JQgrDwwDjOTxkRq3rFerJrCBozDk4v aUKF4L1CTMVNt8cwWkP2qWC9B0Nn+8PRJUo0KzEYMfxzTK3uxhApfl6wEPXrt79jLKmu Q070tKfb0mcTdZMshmm/kaly8fLKSLvp0MAIx+ePnb21+GIrlofczzERN/hn/9tu9hY4 7urzGXPoIvqmrwNJ3ku+VWK5Ymt+OFahVvyvt1bX9r7WD5zO+kxMgm0BKOj9AlkvNwUb Fe0HAUlndKjLiazneWPDJtjcJ68THW5Bib18Z6ubevuHGFVs8x11M6cCXOs2VxPeqd32 Ditw== X-Gm-Message-State: AKGB3mLFWIhPXntU89ZP3DyO4DvUfYF5sCOmbnQq9Orc8eWVEp62zer9 LJ4ezy31P9R3uZFqb/vn51NkdvQ0otsqMQvmwfctxw== X-Received: by 10.31.167.85 with SMTP id q82mr525357vke.49.1512001281338; Wed, 29 Nov 2017 16:21:21 -0800 (PST) MIME-Version: 1.0 Received: by 10.31.49.15 with HTTP; Wed, 29 Nov 2017 16:21:20 -0800 (PST) In-Reply-To: References: <20171127235253.GA20384@embeddedor.com> <20171128120512.Horde.1mz61Up1PsNtyHbrjWmK8L7@gator4166.hostgator.com> <20171128122235.Horde.vFP-9ZfAP0f9BFNePB8Z8xi@gator4166.hostgator.com> <20171128190032.2b1fa464@alans-desktop> <20171128142532.Horde.i2oBtHDOaD7XV1M3yAL7rga@gator4166.hostgator.com> <20171129091050.Horde.2q2U63NpkxZnJ2HEQ6hKGaB@gator4166.hostgator.com> From: Kees Cook Date: Wed, 29 Nov 2017 16:21:20 -0800 X-Google-Sender-Auth: zkWEw-qnzSkz3uYhnj-2LyoPOzc Message-ID: Subject: Re: [PATCH] x86/syscalls: Mark expected switch fall-throughs To: Thomas Gleixner Cc: "Gustavo A. R. Silva" , Alan Cox , Ingo Molnar , "H. Peter Anvin" , X86 ML , LKML 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 Wed, Nov 29, 2017 at 7:14 AM, Thomas Gleixner wrote: > On Wed, 29 Nov 2017, Gustavo A. R. Silva wrote: >> Quoting Thomas Gleixner : >> >> > >> > So I have to ask WHY this information was not in the changelog of the patch >> > in question: >> > >> > 1) How it works >> > >> > 2) Why comments have been chosen over macros >> > >> >> I will add this info and send the patch again. >> >> > > In preparation to enabling -Wimplicit-fallthrough, mark switch cases >> > > where we are expecting to fall through. >> > >> > It's not a reviewers job to chase that information down. >> > >> > While I can understand that the comments are intentional due to existing >> > tools, I still prefer the macro/annotation. But I'm not religious about it >> > when there is common consensus. :) > > ^^^^^^^^^^^^^^^^ > > This is the important point. And there are people aside of me who prefer the > macro annotation. Understood. I, too, prefer the macro annotation, but when considering where the primary benefit comes from, I had to admit that using the comments was tolerable: the many external tools (e.g. Coverity, Eclipse, gcc, clang, etc) that already process the comments means we gain their coverage without any additional work to teach them about yet another way to mark fall-through. In other words, making a marking that only works for humans and gcc leaves out the other tools. To me, "it's ugly" isn't sufficient to limit the wider benefit. And I do recognize that when we get all fixes landed and we add -Wimplicit-fallthrough, then we can just ignore the tools that don't understand the new marking and announce false positives: but it's not worth everyone else's time to deal with those false positives. There is already a solution that all "missing break" tools handle, so let's use it, all false positives vanish, and everyone wins (with a small "ugliness" cost). -Kees -- Kees Cook Pixel Security From 1585413938333802106@xxx Wed Nov 29 15:15:53 +0000 2017 X-GM-THRID: 1585265423856272058 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread