<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/net/wan/farsync.c, branch v4.4.171</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v4.4.171</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v4.4.171'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2016-04-20T06:42:03+00:00</updated>
<entry>
<title>farsync: fix off-by-one bug in fst_add_one</title>
<updated>2016-04-20T06:42:03+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2016-03-14T14:18:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6e6ede49a9bdc8e6762216fe1760c4183791676c'/>
<id>urn:sha1:6e6ede49a9bdc8e6762216fe1760c4183791676c</id>
<content type='text'>
[ Upstream commit e725a66c0202b5f36c2f9d59d26a65c53bbf21f7 ]

gcc-6 finds an out of bounds access in the fst_add_one function
when calculating the end of the mmio area:

drivers/net/wan/farsync.c: In function 'fst_add_one':
drivers/net/wan/farsync.c:418:53: error: index 2 denotes an offset greater than size of 'u8[2][8192] {aka unsigned char[2][8192]}' [-Werror=array-bounds]
 #define BUF_OFFSET(X)   (BFM_BASE + offsetof(struct buf_window, X))
                                                     ^
include/linux/compiler-gcc.h:158:21: note: in definition of macro '__compiler_offsetof'
  __builtin_offsetof(a, b)
                     ^
drivers/net/wan/farsync.c:418:37: note: in expansion of macro 'offsetof'
 #define BUF_OFFSET(X)   (BFM_BASE + offsetof(struct buf_window, X))
                                     ^~~~~~~~
drivers/net/wan/farsync.c:2519:36: note: in expansion of macro 'BUF_OFFSET'
                                  + BUF_OFFSET ( txBuffer[i][NUM_TX_BUFFER][0]);
                                    ^~~~~~~~~~

The warning is correct, but not critical because this appears
to be a write-only variable that is set by each WAN driver but
never accessed afterwards.

I'm taking the minimal fix here, using the correct pointer by
pointing 'mem_end' to the last byte inside of the register area
as all other WAN drivers do, rather than the first byte outside of
it. An alternative would be to just remove the mem_end member
entirely.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>PCI: Remove DEFINE_PCI_DEVICE_TABLE macro use</title>
<updated>2014-08-12T18:15:14+00:00</updated>
<author>
<name>Benoit Taine</name>
<email>benoit.taine@lip6.fr</email>
</author>
<published>2014-08-08T13:56:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9baa3c34ac4e27f7e062f266f50cc5dbea26a6c1'/>
<id>urn:sha1:9baa3c34ac4e27f7e062f266f50cc5dbea26a6c1</id>
<content type='text'>
We should prefer `struct pci_device_id` over `DEFINE_PCI_DEVICE_TABLE` to
meet kernel coding style guidelines.  This issue was reported by checkpatch.

A simplified version of the semantic patch that makes this change is as
follows (http://coccinelle.lip6.fr/):

// &lt;smpl&gt;

@@
identifier i;
declarer name DEFINE_PCI_DEVICE_TABLE;
initializer z;
@@

- DEFINE_PCI_DEVICE_TABLE(i)
+ const struct pci_device_id i[]
= z;

// &lt;/smpl&gt;

[bhelgaas: add semantic patch]
Signed-off-by: Benoit Taine &lt;benoit.taine@lip6.fr&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;</content>
</entry>
<entry>
<title>farsync: fix invalid memory accesses in fst_add_one() and fst_init_card()</title>
<updated>2014-07-11T20:34:48+00:00</updated>
<author>
<name>Alexey Khoroshilov</name>
<email>khoroshilov@ispras.ru</email>
</author>
<published>2014-07-10T22:43:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=19eeb2f9e750f47c805f66e3b0e889b12557d80f'/>
<id>urn:sha1:19eeb2f9e750f47c805f66e3b0e889b12557d80f</id>
<content type='text'>
There are several issues in fst_add_one() and fst_init_card():
- invalid pointer dereference at card-&gt;ports[card-&gt;nports - 1] if
  register_hdlc_device() fails for the first port in fst_init_card();
- fst_card_array overflow at fst_card_array[no_of_cards_added]
  because there is no checks for array overflow;
- use after free because pointer to deallocated card is left in fst_card_array
  if something fails after fst_card_array[no_of_cards_added] = card;
- several leaks on failure paths in fst_add_one().

The patch fixes all the issues and makes code more readable.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov &lt;khoroshilov@ispras.ru&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>farsync: Fix confusion about DMA address and buffer offset types</title>
<updated>2014-06-11T07:45:29+00:00</updated>
<author>
<name>Ben Hutchings</name>
<email>ben@decadent.org.uk</email>
</author>
<published>2014-06-08T22:49:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=581d9baa21dbd69b5b02cd654d858d064c400769'/>
<id>urn:sha1:581d9baa21dbd69b5b02cd654d858d064c400769</id>
<content type='text'>
Use dma_addr_t for DMA address parameters and u32 for shared memory
offset parameters.

Do not assume that dma_addr_t is the same as unsigned long; it will
not be in PAE configurations.  Truncate DMA addresses to 32 bits when
printing them.  This is OK because the DMA mask for this device is
32-bit (per default).

Also rename the DMA address parameters from 'skb' to 'dma'.

Compile-tested only.

Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>wan: Use usleep_range()</title>
<updated>2014-06-03T00:01:33+00:00</updated>
<author>
<name>Manuel Schölling</name>
<email>manuel.schoelling@gmx.de</email>
</author>
<published>2014-05-31T15:07:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8db4ec6641db69f59314894bad6ed7b609e691f6'/>
<id>urn:sha1:8db4ec6641db69f59314894bad6ed7b609e691f6</id>
<content type='text'>
Instead of using a jiffies hack we can use the standard api for delays.

Signed-off-by: Manuel Schölling &lt;manuel.schoelling@gmx.de&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>farsync: fix info leak in ioctl</title>
<updated>2013-10-11T21:50:59+00:00</updated>
<author>
<name>Salva Peiró</name>
<email>speiro@ai2.upv.es</email>
</author>
<published>2013-10-11T09:50:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=96b340406724d87e4621284ebac5e059d67b2194'/>
<id>urn:sha1:96b340406724d87e4621284ebac5e059d67b2194</id>
<content type='text'>
The fst_get_iface() code fails to initialize the two padding bytes of
struct sync_serial_settings after the -&gt;loopback member. Add an explicit
memset(0) before filling the structure to avoid the info leak.

Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>wan: Remove unnecessary alloc/OOM messages</title>
<updated>2013-02-04T18:22:34+00:00</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2013-02-03T17:28:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1d5d1fdc52b879d8d2bb40546472b4dcfd99f118'/>
<id>urn:sha1:1d5d1fdc52b879d8d2bb40546472b4dcfd99f118</id>
<content type='text'>
alloc failures already get standardized OOM
messages and a dump_stack.

Hoist assigns from if tests.

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>farsync: remove __dev* attributes</title>
<updated>2012-12-03T19:17:06+00:00</updated>
<author>
<name>Bill Pemberton</name>
<email>wfp5p@virginia.edu</email>
</author>
<published>2012-12-03T14:24:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5a37931ff0be06b4c774aa604f86ed4566a0ede7'/>
<id>urn:sha1:5a37931ff0be06b4c774aa604f86ed4566a0ede7</id>
<content type='text'>
CONFIG_HOTPLUG is going away as an option.  As result the __dev*
markings will be going away.

Remove use of __devinit, __devexit_p, __devinitdata, __devinitconst,
and __devexit.

Signed-off-by: Bill Pemberton &lt;wfp5p@virginia.edu&gt;
Cc: Kevin Curtis &lt;kevin.curtis@farsite.co.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>farsync: fix support for over 30 cards</title>
<updated>2012-10-09T17:54:59+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2012-10-08T21:20:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=50fb47ae4d812d5eabc57539701dc0fd6404495e'/>
<id>urn:sha1:50fb47ae4d812d5eabc57539701dc0fd6404495e</id>
<content type='text'>
We're trying to fill a 64 bit bitmap but only the lower 30 shifts work
because the shift wraps around.

Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>drivers/net/wan/farsync.c: add missing iounmap</title>
<updated>2012-04-18T02:31:59+00:00</updated>
<author>
<name>Julia Lawall</name>
<email>Julia.Lawall@lip6.fr</email>
</author>
<published>2012-04-16T05:22:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=48159f009f5f92ef5962e7c278ac615d74242fa5'/>
<id>urn:sha1:48159f009f5f92ef5962e7c278ac615d74242fa5</id>
<content type='text'>
Free card-&gt;mem in the error-handling code since it was successfully
allocated just above.

Signed-off-by: Julia Lawall &lt;Julia.Lawall@lip6.fr&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
</feed>
