Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1700374

Re: [PATCH] ISDN: eicon: fix array-bounds warning properly

From Arnd Bergmann <arnd@arndb.de>
Newsgroups linux.kernel
Subject Re: [PATCH] ISDN: eicon: fix array-bounds warning properly
Date 2017-07-31 22:30 +0200
Message-ID <u9pu9-2mM-1@gated-at.bofh.it> (permalink)
References <u9eS6-4nS-3@gated-at.bofh.it> <u9oHL-1Rm-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Jul 31, 2017 at 9:38 PM,  <isdn@linux-pingi.de> wrote:
> Hi Arnd,
>
> I think you are right, but removing this is maybe the wrong fix.
>
> The issue is, that CAPI messages are packed byte streams and yes the
> 64bit extension of CAPI is not very good designed for modern CPU
> constrains with alignment, since the data pointer for the buffer is not
> on a 64bit boundary.

I also attempted to just mark the pointer as __packed, which would address
the warning as well, but then I saw that no code refers to it.

> All hardware controller implementations I know do
> ignore the data pointer, they are simple awaiting the data of the given
> length directly after the message. Only the application interface on 64
> bit systems really need the 64 bit data pointer value, which is usually
> set in the HW driver to the mapped user space address of the used data
> buffer if the user space process is 64bit.
> The user space CAPI library correctly use byte stream access functions
> to read/write the values. So the correct solution for this driver would
> be to use stream access functions as well here and not add a 64 bit
> pointer.

I'm not sure what change you are proposing here.

> On the other hand I do not think the any people use this driver on 64
> bit systems today, because they would run into this issue.

Right. Another way of addressing the warning would be to add a
'depends on BROKEN || !64BIT' dependency in Kconfig, which
would serve to document the fact that it's broken and prevent
us from running into it.

        Arnd

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] ISDN: eicon: fix array-bounds warning properly Arnd Bergmann <arnd@arndb.de> - 2017-07-31 11:10 +0200
  Re: [PATCH] ISDN: eicon: fix array-bounds warning properly isdn@linux-pingi.de - 2017-07-31 21:40 +0200
    Re: [PATCH] ISDN: eicon: fix array-bounds warning properly Arnd Bergmann <arnd@arndb.de> - 2017-07-31 22:30 +0200

csiph-web