From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,71171f53c22d92b5 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-11-14 07:47:52 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!in.100proofnews.com!in.100proofnews.com!cycny01.gnilink.net!cyclone1.gnilink.net!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!intern1.nntp.aus1.giganews.com!nntp.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Fri, 14 Nov 2003 09:47:49 -0600 Date: Fri, 14 Nov 2003 10:47:47 -0500 From: "Robert I. Eachus" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: C's trikery semantic opens up backdoor in new Linux kernel References: <3FB1A63C.9080200@nowhere.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 24.34.214.193 X-Trace: sv3-yyP1d87XwcYNkz6nY5RsTttYImbUqvCIrIUYZOnvoX2Y6kGJAMx90axwgGyLUkBm+ZUasXu9wFLiuRb!TT22hWpagbWOBxTZl/QAV1oYCLu142lGt91MtPSNBWFdhYGJb+aov157BLIR+g== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Xref: archiver1.google.com comp.lang.ada:2499 Date: 2003-11-14T10:47:47-05:00 List-Id: Vinzent 'Gadget' Hoefler wrote: >>>For instance considering the simple rule that in a comparison with a >>> >>>constant value you should always state the constant first: >>>|if ((__WCLONE|__WALL) == options) && (0 = current->uid)) >>> >>>wouldn't compile, either. >> >>No, but do you really think such a style could be enforced in the linux >>kernel community? > No. And you? Do you really think that the linux kernel community would > like the idea of using a *function* to get/set a plain simple integer > variable? I already hear them scream: "It would be too inefficient. > Especially in a *kernel*!" ;-) Bad example here. GCC will print a warning message about assignment in condition clauses unless the assignment is enclosed in parentheses. So: if (options == (__WCLONE|__WALL) && current->uid = 0) would generate a compiler warning message about the assignment to current -> uid. The Linux kernel coding standards make "redundant" parentheses in conditions illegal for exactly that reason, and one of the things that made it clear that this was an intentional attempt to get root was the "extra" parentheses. -- Robert I. Eachus 100% Ada, no bugs--the only way to create software.