Hi,
I did a make randconfig and then make C=1.
hci_sock.c fails to build because it doesnt know compat_timeval (i
guess).
find the error message and the config attached.
regards,
Andre
On Wed, Sep 12, 2007 at 11:29:29AM +0200, Andre Haupt wrote:
> Hi,
>
> I did a make randconfig and then make C=1.
>
> hci_sock.c fails to build because it doesnt know compat_timeval (i
> guess).
>
> find the error message and the config attached.
It's not even a randconfig issue, my build dies too (this is Linus's
current tree.)
Time to poke through the 10 bluetooth patches that were just added...
thanks,
greg k-h
On Wed, Sep 12, 2007 at 05:02:53AM -0700, Greg KH wrote:
> On Wed, Sep 12, 2007 at 11:29:29AM +0200, Andre Haupt wrote:
> > Hi,
> >
> > I did a make randconfig and then make C=1.
> >
> > hci_sock.c fails to build because it doesnt know compat_timeval (i
> > guess).
> >
> > find the error message and the config attached.
>
> It's not even a randconfig issue, my build dies too (this is Linus's
> current tree.)
>
> Time to poke through the 10 bluetooth patches that were just added...
It was 767c5eb5d35aeb85987143f0a730bc21d3ecfb3d that caused it. It
needs a .h file added to the file, patch forthcoming...
greg k-h
On Wed, Sep 12, 2007 at 05:04:07AM -0700, Greg KH wrote:
> On Wed, Sep 12, 2007 at 05:02:53AM -0700, Greg KH wrote:
> > On Wed, Sep 12, 2007 at 11:29:29AM +0200, Andre Haupt wrote:
> > > Hi,
> > >
> > > I did a make randconfig and then make C=1.
> > >
> > > hci_sock.c fails to build because it doesnt know compat_timeval (i
> > > guess).
> > >
> > > find the error message and the config attached.
> >
> > It's not even a randconfig issue, my build dies too (this is Linus's
> > current tree.)
> >
> > Time to poke through the 10 bluetooth patches that were just added...
>
> It was 767c5eb5d35aeb85987143f0a730bc21d3ecfb3d that caused it. It
> needs a .h file added to the file, patch forthcoming...
No, this is worse, i386 doesn't have a compat_timeval structure defined,
nor does any other 32 bit platform.
Marcel, I think you need to use a different structure, care to fix this
up?
thanks,
greg k-h
12 Eyl 2007 Çar tarihinde, Greg KH şunları yazmıştı:
> No, this is worse, i386 doesn't have a compat_timeval structure defined,
> nor does any other 32 bit platform.
>
> Marcel, I think you need to use a different structure, care to fix this
> up?
I sent a patch for this problem about ~4 hours ago :), see "[PATCH] Fix hci_sock build with CONFIG_COMPAT=n"
Cheers
--
S.Çağlar Onur <[email protected]>
http://cekirdek.pardus.org.tr/~caglar/
Linux is like living in a teepee. No Windows, no Gates and an Apache in house!
From: Greg KH <[email protected]>
Date: Wed, 12 Sep 2007 05:02:53 -0700
> It's not even a randconfig issue, my build dies too (this is Linus's
> current tree.)
>
> Time to poke through the 10 bluetooth patches that were just added...
I'll push the following fix to Linus.
>From 1da97f83a843f92678b614fcaebdb3e4ebd6c9dd Mon Sep 17 00:00:00 2001
From: David S. Miller <davem@kimchee.(none)>
Date: Wed, 12 Sep 2007 14:10:58 +0200
Subject: [PATCH] [BLUETOOTH]: Fix non-COMPAT build of hci_sock.c
Signed-off-by: David S. Miller <[email protected]>
---
net/bluetooth/hci_sock.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
index d16ca8e..5ccea5f 100644
--- a/net/bluetooth/hci_sock.c
+++ b/net/bluetooth/hci_sock.c
@@ -348,16 +348,17 @@ static inline void hci_sock_cmsg(struct sock *sk, struct msghdr *msg, struct sk_
skb_get_timestamp(skb, &tv);
+ data = &tv;
+ len = sizeof(tv);
+#ifdef CONFIG_COMPAT
if (msg->msg_flags & MSG_CMSG_COMPAT) {
struct compat_timeval ctv;
ctv.tv_sec = tv.tv_sec;
ctv.tv_usec = tv.tv_usec;
data = &ctv;
len = sizeof(ctv);
- } else {
- data = &tv;
- len = sizeof(tv);
}
+#endif
put_cmsg(msg, SOL_HCI, HCI_CMSG_TSTAMP, len, data);
}
--
1.5.2.4
From: Greg KH <[email protected]>
Date: Wed, 12 Sep 2007 05:04:07 -0700
> It was 767c5eb5d35aeb85987143f0a730bc21d3ecfb3d that caused it. It
> needs a .h file added to the file, patch forthcoming...
Ok, I though it was a CONFIG_COMPAT ifdef issue, feel
free to push the header include fix.
From: Greg KH <[email protected]>
Date: Wed, 12 Sep 2007 05:07:26 -0700
> No, this is worse, i386 doesn't have a compat_timeval structure defined,
> nor does any other 32 bit platform.
>
> Marcel, I think you need to use a different structure, care to fix this
> up?
Ok, then see the patch I posted which will do the trick.
I'll push it around.
On Wed, 12 Sep 2007, Greg KH wrote:
> On Wed, Sep 12, 2007 at 11:29:29AM +0200, Andre Haupt wrote:
> > Hi,
> >
> > I did a make randconfig and then make C=1.
> >
> > hci_sock.c fails to build because it doesnt know compat_timeval (i
> > guess).
> >
> > find the error message and the config attached.
>
> It's not even a randconfig issue, my build dies too (this is Linus's
> current tree.)
>
> Time to poke through the 10 bluetooth patches that were just added...
>
> thanks,
>
> greg k-h
that structure is undefined because that source file includes
<linux/compat.h>, which turns around and includes <asm/compat.h>
which, for i386, doesn't exist:
$ find include -name compat.h
include/asm-ia64/compat.h
include/config/video/v4l1/compat.h
include/config/sonypi/compat.h
include/asm-s390/compat.h
include/asm-mips/compat.h
include/linux/compat.h
include/asm-parisc/compat.h
include/asm-sparc64/compat.h
include/asm-x86_64/compat.h
include/asm-powerpc/compat.h
include/net/compat.h
rday
--
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA
http://crashcourse.ca
========================================================================
David Miller 写道:
> From: Greg KH <[email protected]>
> Date: Wed, 12 Sep 2007 05:02:53 -0700
>
>> It's not even a randconfig issue, my build dies too (this is Linus's
>> current tree.)
>>
>> Time to poke through the 10 bluetooth patches that were just added...
>
> I'll push the following fix to Linus.
>
> From 1da97f83a843f92678b614fcaebdb3e4ebd6c9dd Mon Sep 17 00:00:00 2001
> From: David S. Miller <davem@kimchee.(none)>
> Date: Wed, 12 Sep 2007 14:10:58 +0200
> Subject: [PATCH] [BLUETOOTH]: Fix non-COMPAT build of hci_sock.c
>
> Signed-off-by: David S. Miller <[email protected]>
> ---
> net/bluetooth/hci_sock.c | 7 ++++---
> 1 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
> index d16ca8e..5ccea5f 100644
> --- a/net/bluetooth/hci_sock.c
> +++ b/net/bluetooth/hci_sock.c
> @@ -348,16 +348,17 @@ static inline void hci_sock_cmsg(struct sock *sk, struct msghdr *msg, struct sk_
>
> skb_get_timestamp(skb, &tv);
>
> + data = &tv;
> + len = sizeof(tv);
> +#ifdef CONFIG_COMPAT
> if (msg->msg_flags & MSG_CMSG_COMPAT) {
> struct compat_timeval ctv;
> ctv.tv_sec = tv.tv_sec;
> ctv.tv_usec = tv.tv_usec;
> data = &ctv;
> len = sizeof(ctv);
should we consider the condition that msg->msg_flags & MSG_CMSG_COMPAT comes to true when
CONFIG_COMPAT is not defined ?
> - } else {
> - data = &tv;
> - len = sizeof(tv);
> }
> +#endif
>
> put_cmsg(msg, SOL_HCI, HCI_CMSG_TSTAMP, len, data);
> }
Coly Li 写道:
> David Miller 写道:
>> From: Greg KH <[email protected]>
>> Date: Wed, 12 Sep 2007 05:02:53 -0700
>>
>>> It's not even a randconfig issue, my build dies too (this is Linus's
>>> current tree.)
>>>
>>> Time to poke through the 10 bluetooth patches that were just added...
>> I'll push the following fix to Linus.
>>
>> From 1da97f83a843f92678b614fcaebdb3e4ebd6c9dd Mon Sep 17 00:00:00 2001
>> From: David S. Miller <davem@kimchee.(none)>
>> Date: Wed, 12 Sep 2007 14:10:58 +0200
>> Subject: [PATCH] [BLUETOOTH]: Fix non-COMPAT build of hci_sock.c
>>
>> Signed-off-by: David S. Miller <[email protected]>
>> ---
>> net/bluetooth/hci_sock.c | 7 ++++---
>> 1 files changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
>> index d16ca8e..5ccea5f 100644
>> --- a/net/bluetooth/hci_sock.c
>> +++ b/net/bluetooth/hci_sock.c
>> @@ -348,16 +348,17 @@ static inline void hci_sock_cmsg(struct sock *sk, struct msghdr *msg, struct sk_
>>
>> skb_get_timestamp(skb, &tv);
>>
>> + data = &tv;
>> + len = sizeof(tv);
>> +#ifdef CONFIG_COMPAT
>> if (msg->msg_flags & MSG_CMSG_COMPAT) {
>> struct compat_timeval ctv;
>> ctv.tv_sec = tv.tv_sec;
>> ctv.tv_usec = tv.tv_usec;
>> data = &ctv;
>> len = sizeof(ctv);
> should we consider the condition that msg->msg_flags & MSG_CMSG_COMPAT comes to true when
> CONFIG_COMPAT is not defined ?
Sorry, once CONFIG_COMPAT is not defined, msg->msg_flags & MSG_CMSG_COMPAT will never come to true.
forget my comments.
>
>> - } else {
>> - data = &tv;
>> - len = sizeof(tv);
>> }
>> +#endif
>>
>> put_cmsg(msg, SOL_HCI, HCI_CMSG_TSTAMP, len, data);
>> }
>
Hi Dave,
> > It's not even a randconfig issue, my build dies too (this is Linus's
> > current tree.)
> >
> > Time to poke through the 10 bluetooth patches that were just added...
>
> I'll push the following fix to Linus.
the patch looks absolutely fine to me. You can put an Acked-by line to
it. Sorry for breaking the build. I tested it on so many architectures,
but it seems I always had CONFIG_COMPAT enabled. Seems I am running out
of i386/32-bit only systems.
Regards
Marcel
Hello,
I'm wondering why the build failure wasn't fixed by a patch like this:
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
index 5ccea5f..85416bb 100644
--- a/net/bluetooth/hci_sock.c
+++ b/net/bluetooth/hci_sock.c
@@ -348,8 +348,6 @@ static inline void hci_sock_cmsg(struct sock *sk, struct msghdr *msg, struct sk_
skb_get_timestamp(skb, &tv);
- data = &tv;
- len = sizeof(tv);
#ifdef CONFIG_COMPAT
if (msg->msg_flags & MSG_CMSG_COMPAT) {
struct compat_timeval ctv;
@@ -358,6 +356,9 @@ static inline void hci_sock_cmsg(struct sock *sk, struct msghdr *msg, struct sk_
data = &ctv;
len = sizeof(ctv);
}
+#else
+ data = &tv;
+ len = sizeof(tv);
#endif
put_cmsg(msg, SOL_HCI, HCI_CMSG_TSTAMP, len, data);
--
MfG/Sincerely
Toralf F?rster
pgp finger print: 7B1A 07F4 EC82 0F90 D4C2 8936 872A E508 7DB6 9DA3
Hi Toralf,
> I'm wondering why the build failure wasn't fixed by a patch like this:
>
>
> diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
> index 5ccea5f..85416bb 100644
> --- a/net/bluetooth/hci_sock.c
> +++ b/net/bluetooth/hci_sock.c
> @@ -348,8 +348,6 @@ static inline void hci_sock_cmsg(struct sock *sk, struct msghdr *msg, struct sk_
>
> skb_get_timestamp(skb, &tv);
>
> - data = &tv;
> - len = sizeof(tv);
> #ifdef CONFIG_COMPAT
> if (msg->msg_flags & MSG_CMSG_COMPAT) {
> struct compat_timeval ctv;
> @@ -358,6 +356,9 @@ static inline void hci_sock_cmsg(struct sock *sk, struct msghdr *msg, struct sk_
> data = &ctv;
> len = sizeof(ctv);
> }
> +#else
> + data = &tv;
> + len = sizeof(tv);
> #endif
>
> put_cmsg(msg, SOL_HCI, HCI_CMSG_TSTAMP, len, data);
because that is wrong and will give you a different issue (the other way
around actually) that the change to use compat_timeval actually tried to
fix. Your patch actually will allow to return arbitrary kernel memory in
case of 64-bit applications since data and len might not be initialized.
In case of 64-bit kernels you can have 64-bit or 32-bit applications. In
case of 32-bit application you have to return compat_timeval and in cas
of 64-bit application you have to return timeval. It is checked by
MSG_CMSG_COMPAT runtime flag and not the CONFIG_COMPAT compile option.
Regards
Marcel