Date: Thu, 30 Aug 2007 10:17:04 +1200 From: Matthew Luckie <mjl@luckie.org.nz> To: FreeBSD-gnats-submit@FreeBSD.org Subject: kern/115931: [patch] change bpf_filter() mem[] from int32_t to u_int32_t Message-ID: <E1IQVqS-000HyL-Rx@latex.plunket.luckie.org.nz> Resent-Message-ID: <200708292240.l7TMe1em084567@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 115931 >Category: kern >Synopsis: [patch] change bpf_filter() mem[] from int32_t to u_int32_t >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Aug 29 22:40:00 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Matthew Luckie >Release: FreeBSD 6.1-RELEASE alpha >Organization: University of Waikato >Environment: System: FreeBSD latex.plunket.luckie.org.nz 6.1-RELEASE FreeBSD 6.1-RELEASE #0: Sat Jul 15 11:56:01 NZST 2006 root@:/usr/src/sys/alpha/compile/latex alpha >Description: In bpf_filter.c : bpf_filter() A and X are declared u_int32_t. mem[] is declared as int32_t. The only things that get saved or restored from mem[] are A and X. I suggest that mem[] be changed to u_int32_t to be precise about what is stored in there. I'm well aware how pedantic this is. I have compared the output for objdump -S on bpf_filter.o compiled with and without this patch on i386 and alpha on FreeBSD releases 6.2 and 6.1 respectively and there is zero change in the actual machine code generated. >How-To-Repeat: >Fix: --- bpf_filter.c.patch begins here --- --- bpf_filter.c.orig Thu Aug 30 09:48:40 2007 +++ bpf_filter.c Thu Aug 30 10:08:23 2007 @@ -186,7 +186,7 @@ { register u_int32_t A = 0, X = 0; register bpf_u_int32 k; - int32_t mem[BPF_MEMWORDS]; + u_int32_t mem[BPF_MEMWORDS]; if (pc == 0) /* --- bpf_filter.c.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E1IQVqS-000HyL-Rx>