login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
September
»
11
Re: [PATCH] netlink: fix overrun in attribute iteration
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: David Miller
Subject:
Re: [PATCH] netlink: fix overrun in attribute iteration
Date: Thursday, September 11, 2008 - 3:04 pm
From: Vegard Nossum <vegard.nossum@gmail.com> Date: Thu, 11 Sep 2008 22:59:33 +0200
quoted text
> A short example illustrating this point is here: > > #include <stdio.h> > > main(void) > { > printf("%d\n", -1 >= sizeof(int)); > } > > ...which prints "1".
Someone should print that out on a huge poster, it's a good example of why C promotion rules suck :)
quoted text
> This patch adds a cast in front of the sizeof so that GCC will make > a signed comparison and fix the illegal memory dereference. With the > patch applied, there is no kmemcheck report. > > Cc: Thomas Graf <tgraf@suug.ch> > Signed-off-by: Vegard Nossum <vegard.nossum@gmail.com>
Thomas, please review.
quoted text
> diff --git a/include/net/netlink.h b/include/net/netlink.h > index 18024b8..208fe5a 100644 > --- a/include/net/netlink.h > +++ b/include/net/netlink.h > @@ -702,7 +702,7 @@ static inline int nla_len(const struct nlattr *nla) > */ > static inline int nla_ok(const struct nlattr *nla, int remaining) > { > - return remaining >= sizeof(*nla) && > + return remaining >= (int) sizeof(*nla) && > nla->nla_len >= sizeof(*nla) && > nla->nla_len <= remaining; > } > -- > 1.5.5.1 >
--
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH] netlink: fix overrun in attribute iteration
, Vegard Nossum
, (Thu Sep 11, 1:59 pm)
Re: [PATCH] netlink: fix overrun in attribute iteration
, David Miller
, (Thu Sep 11, 3:04 pm)
Re: [PATCH] netlink: fix overrun in attribute iteration
, Andrew Morton
, (Thu Sep 11, 4:52 pm)
Re: [PATCH] netlink: fix overrun in attribute iteration
, Thomas Graf
, (Thu Sep 11, 5:35 pm)
Re: [PATCH] netlink: fix overrun in attribute iteration
, David Miller
, (Thu Sep 11, 7:05 pm)
Re: [PATCH] netlink: fix overrun in attribute iteration
, Vegard Nossum
, (Thu Sep 11, 10:42 pm)
Re: [PATCH] netlink: fix overrun in attribute iteration
, Andrew Morton
, (Thu Sep 11, 11:02 pm)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
FUJITA Tomonori
Re: [Scst-devel] Integration of SCST in the mainstream Linux kernel
Ingo Molnar
Re: [RFC/RFT PATCH] sched: automated per tty task groups
Josef Bacik
[PATCH] fallocate.2: add FALLOC_FL_PUNCH_HOLE flag definition
Rezwanul_Kabir
RE: Dell Studio 1555 eject key does not work ( small patch to fix included )
Rafael J. Wysocki
[Bug #15669] INFO: suspicious rcu_dereference_check()
git
:
Michal Sojka
[PATCHv5 1/2] filter-branch: Fix to allow replacing submodules with another content
Junio C Hamano
Re: Fwd: git status options feature suggestion
Stefan Richter
Re: [kernel.org users] [RFD] On deprecating "git-foo" for builtins
A Large Angry SCM
Re: [RFC] origin link for cherry-pick and revert
Bert Wesarg
[TopGit PATCH v3 06/12] list_deps: accept -i/-w
linux-netdev
:
Arnaldo Carvalho de Melo
Re: [PATCH 06/37] dccp: Limit feature negotiation to connection setup phase
Gerrit Renker
[PATCH 1/5] dccp: Initialisation framework for feature negotiation
Ursula Braun
[patch 2/8] [PATCH] af_iucv: sync sk shutdown flag if iucv path is quiesced
Daniel Lezcano
getsockopt(TCP_DEFER_ACCEPT) value change
David Miller
Re: 2.6.27.18: bnx2/tg3: BUG: "scheduling while atomic" trying to ifenslave a seco...
git-commits-head
:
Linux Kernel Mailing List
libata: disable ATAPI AN by default
Linux Kernel Mailing List
ARM: 5905/1: ARM: Global ASID allocation on SMP
Linux Kernel Mailing List
misc: replace remaining __FUNCTION__ with __func__
Linux Kernel Mailing List
Disallow gcc versions 4.1.{0,1}
Linux Kernel Mailing List
timer: Try to survive timer callback preempt_count leak
openbsd-misc
:
Rene Maroufi
smtpd: Aliases only work with for local alias aliases
Stephen J. Bevan
GRE over IPsec
Darrin Chandler
Re: strange output on openbsd C code
Nick Holland
Re: Install OpenBSD from USB ?
KURS ENGLESKOG JEZIKA NA 10 CD-a
AUDIO-VIZUELNA METODA UCENJA ENGLESKOG JEZIKA na 10 CD-a
Colocation donated by:
Syndicate