<feed xmlns='http://www.w3.org/2005/Atom'>
<title>OpenOCD/src/server, branch master</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>https://git.amat.us/openocd/atom/src/server?h=master</id>
<link rel='self' href='https://git.amat.us/openocd/atom/src/server?h=master'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/openocd/'/>
<updated>2020-02-24T10:30:36Z</updated>
<entry>
<title>coding style: fix space around pointer's asterisk</title>
<updated>2020-02-24T10:30:36Z</updated>
<author>
<name>Antonio Borneo</name>
<email>borneo.antonio@gmail.com</email>
</author>
<published>2019-05-05T19:26:56Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/openocd/commit/?id=e7306d361b5d503cf27dfb3dc69298ddad495f88'/>
<id>urn:sha1:e7306d361b5d503cf27dfb3dc69298ddad495f88</id>
<content type='text'>
The script checkpatch available in new Linux kernel offers an
experimental feature for automatically fix the code in place.
While still experimental, the feature works quite well for simple
fixes, like spacing.

This patch has been created automatically with the script under
review for inclusion in OpenOCD, using the command
	find src/ -type f -exec ./tools/scripts/checkpatch.pl \
	-q --types POINTER_LOCATION --fix-inplace -f {} \;
then manually reviewed.

OpenOCD coding style does not mention the space around pointer's
asterisk, so no check is enforced. This patch only makes the style
uniform across the files.

The patch only changes amount and position of whitespace, thus
the following commands show empty diff
	git diff -w
	git log -w -p
	git log -w --stat

Change-Id: Iefb4998e69bebdfe0d1ae65cadfc8d2c4f166d13
Signed-off-by: Antonio Borneo &lt;borneo.antonio@gmail.com&gt;
Reviewed-on: http://openocd.zylin.com/5197
Tested-by: jenkins
</content>
</entry>
<entry>
<title>server/server: fix clang static analyzer warning</title>
<updated>2020-01-16T09:44:49Z</updated>
<author>
<name>Tomas Vanek</name>
<email>vanekt@fbl.cz</email>
</author>
<published>2019-12-20T22:40:07Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/openocd/commit/?id=98a8b99ef37542dc34e1b247d9946a127d4ab70d'/>
<id>urn:sha1:98a8b99ef37542dc34e1b247d9946a127d4ab70d</id>
<content type='text'>
Change-Id: I317e189b62540e3688a20d88a95f551280317f14
Signed-off-by: Tomas Vanek &lt;vanekt@fbl.cz&gt;
Reviewed-on: http://openocd.zylin.com/5373
Tested-by: jenkins
Reviewed-by: Oleksij Rempel &lt;linux@rempel-privat.de&gt;
</content>
</entry>
<entry>
<title>gdb_server: fix extended_protocol for multi-target</title>
<updated>2019-12-19T20:41:18Z</updated>
<author>
<name>Antonio Borneo</name>
<email>borneo.antonio@gmail.com</email>
</author>
<published>2019-09-27T10:27:01Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/openocd/commit/?id=964c4db9cec3e619545490ccb525be210e8008d5'/>
<id>urn:sha1:964c4db9cec3e619545490ccb525be210e8008d5</id>
<content type='text'>
The flag extended_protocol is currently a single static variable
thus, in case of multiple targets, it is shared among all the gdb
connections. This is an issue if the gdb connections are not all
using extended protocol, but also when one connection get closed
because the code sets the flag to zero impacting the other
connections still open.

Move the flag extended_protocol in the per-connection struct
gdb_connection.

Change-Id: I19d565f925df6a31767fd8d392242f60867109f2
Signed-off-by: Antonio Borneo &lt;borneo.antonio@gmail.com&gt;
Reviewed-on: http://openocd.zylin.com/5310
Tested-by: jenkins
Reviewed-by: Moritz Fischer &lt;moritzf@google.com&gt;
Reviewed-by: Tomas Vanek &lt;vanekt@fbl.cz&gt;
</content>
</entry>
<entry>
<title>gdb_server: fix string length with semihosting_fileio</title>
<updated>2019-12-19T20:40:55Z</updated>
<author>
<name>Antonio Borneo</name>
<email>borneo.antonio@gmail.com</email>
</author>
<published>2019-10-17T16:02:38Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/openocd/commit/?id=f476c9eec42d551bc9015089abc47b09058f06b5'/>
<id>urn:sha1:f476c9eec42d551bc9015089abc47b09058f06b5</id>
<content type='text'>
The GDB file-I/O remote protocol extension, used for implementing
the semihosting file I/O, requires the length of strings to
include the trailing zero character, as explicitly stated inside a
comment in GDB source code [1]:
	/* 1. Parameter: Ptr to pathname / length incl. trailing zero.  */

ARM specification for semihosting [2] requires the string length
to not include the trailing zero character, e.g. in SYS_OPEN
specifications:
	"field 3: An integer that gives the length of the string
	 pointed to by field 1. The length does not include the
	 terminating null character that must be present."

The mismatch above requires OpenOCD to add "one" to the string
length before passing it to GDB. Such conversion is missing
either in the generic semihosting provider of the data, the
function semihosting_common(), and in the consumer of the data,
the gdb_server function gdb_fileio_reply().
The conversion is already implemented in the target specific
function nds32_get_gdb_fileio_info(), but it's not the preferred
place for such GDB specific requirement.

This issue affects the semihosting calls "open", "unlink",
"rename" and "system".

Remove the "+1" conversion from nds32_get_gdb_fileio_info().
Add the "+1" conversion in gdb_fileio_reply().

[1] http://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;f=gdb/remote-fileio.c;h=11c141e42c4d#l381
[2] "Semihosting for AArch32 and AArch64, Release 2.0"
    https://static.docs.arm.com/100863/0200/semihosting.pdf

Change-Id: I35461bcb30f734fe2d51f7f0d418e3d04b4af506
Signed-off-by: Antonio Borneo &lt;borneo.antonio@gmail.com&gt;
Reviewed-on: http://openocd.zylin.com/5322
Tested-by: jenkins
Reviewed-by: Steven Stallion &lt;sstallion@gmail.com&gt;
Reviewed-by: Muhammad Omair Javaid &lt;omair.javaid@linaro.org&gt;
Reviewed-by: Tomas Vanek &lt;vanekt@fbl.cz&gt;
</content>
</entry>
<entry>
<title>server/tcl_server.c: Fix buffer overrun</title>
<updated>2019-12-12T14:31:42Z</updated>
<author>
<name>Jimmy</name>
<email>nhminus@gmail.com</email>
</author>
<published>2019-12-05T06:45:17Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/openocd/commit/?id=0f12d792ed5ab2b8f934e689b8a23f8c55f1f218'/>
<id>urn:sha1:0f12d792ed5ab2b8f934e689b8a23f8c55f1f218</id>
<content type='text'>
The input buffer size is checked only after writing past its end.

Change-Id: I6a9651c5b7d82efe338468d67bf6caca41004b01
Signed-off-by: Jimmy &lt;nhminus@gmail.com&gt;
Reviewed-on: http://openocd.zylin.com/5352
Tested-by: jenkins
Reviewed-by: Tomas Vanek &lt;vanekt@fbl.cz&gt;
</content>
</entry>
<entry>
<title>server: gdb_server: fix memory map generation on a 32-bit BE host</title>
<updated>2019-12-10T10:43:03Z</updated>
<author>
<name>Paul Fertser</name>
<email>fercerpav@gmail.com</email>
</author>
<published>2019-11-06T16:04:57Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/openocd/commit/?id=1e427fd580ad94bb3bf29d4e02ef81361c920f28'/>
<id>urn:sha1:1e427fd580ad94bb3bf29d4e02ef81361c920f28</id>
<content type='text'>
Due to lack of printf format check wrong specifier was used and it
actually broke operation on a 32-bit BE host.

So fix this and add the necessary function attributes so that the bugs
like that can be uncovered automaticaly.

Reported and pinpointed by Karl Palsson on IRC.

Change-Id: I254ec28fcd9bb30594d607f74a6dba5456c2c7a1
Tested-by: Karl Palsson &lt;karlp@tweak.net.au&gt;
Signed-off-by: Paul Fertser &lt;fercerpav@gmail.com&gt;
Reviewed-on: http://openocd.zylin.com/5342
Tested-by: jenkins
Reviewed-by: Karl Palsson &lt;karlp@tweak.net.au&gt;
Reviewed-by: Antonio Borneo &lt;borneo.antonio@gmail.com&gt;
</content>
</entry>
<entry>
<title>CVE-2018-5704: Prevent some forms of Cross Protocol Scripting attacks</title>
<updated>2019-11-22T18:25:34Z</updated>
<author>
<name>Andreas Fritiofson</name>
<email>andreas.fritiofson@gmail.com</email>
</author>
<published>2018-01-13T20:00:47Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/openocd/commit/?id=6d54d905413243cc65687e30669a94037a14cbe6'/>
<id>urn:sha1:6d54d905413243cc65687e30669a94037a14cbe6</id>
<content type='text'>
OpenOCD can be targeted by a Cross Protocol Scripting attack from
a web browser running malicious code, such as the following PoC:

var x = new XMLHttpRequest();
x.open("POST", "http://127.0.0.1:4444", true);
x.send("exec xcalc\r\n");

This mitigation should provide some protection from browser-based
attacks and is based on the corresponding fix in Redis:

https://github.com/antirez/redis/blob/8075572207b5aebb1385c4f233f5302544439325/src/networking.c#L1758

Change-Id: Ia96ebe19b74b5805dc228bf7364c7971a90a4581
Signed-off-by: Andreas Fritiofson &lt;andreas.fritiofson@gmail.com&gt;
Reported-by: Josef Gajdusek &lt;atx@atx.name&gt;
Reviewed-on: http://openocd.zylin.com/4335
Tested-by: jenkins
Reviewed-by: Jonathan McDowell &lt;noodles-openocd@earth.li&gt;
Reviewed-by: Paul Fertser &lt;fercerpav@gmail.com&gt;
</content>
</entry>
<entry>
<title>gdb_server: Support vRun packet, allow setting cmdline from GDB</title>
<updated>2019-10-18T08:21:56Z</updated>
<author>
<name>Andreas Fritiofson</name>
<email>andreas.fritiofson@gmail.com</email>
</author>
<published>2018-08-20T13:34:19Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/openocd/commit/?id=a944ee28d98d538c6a46f8026bbf0f0e90219c36'/>
<id>urn:sha1:a944ee28d98d538c6a46f8026bbf0f0e90219c36</id>
<content type='text'>
GDB uses the vRun packet if available to restart a running process in
extended remote mode. Support this like the R packet and set the
semihosting command-line to allow it to be specified from GDB.

Change-Id: I9cb812b22170630f782113c9927e46e0cd5b1f0f
Signed-off-by: Andreas Fritiofson &lt;andreas.fritiofson@gmail.com&gt;
Reviewed-on: http://openocd.zylin.com/5186
Tested-by: jenkins
Reviewed-by: Tomas Vanek &lt;vanekt@fbl.cz&gt;
Reviewed-by: Matthias Welwarsky &lt;matthias@welwarsky.de&gt;
</content>
</entry>
<entry>
<title>gdb-server: Create arch-specific structure type for every feature</title>
<updated>2019-10-18T08:21:45Z</updated>
<author>
<name>Alexey Brodkin</name>
<email>abrodkin@synopsys.com</email>
</author>
<published>2019-05-17T19:18:45Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/openocd/commit/?id=c983f8ee00527504cedad932858f00458d7b9b43'/>
<id>urn:sha1:c983f8ee00527504cedad932858f00458d7b9b43</id>
<content type='text'>
As it is mentioned here [1] type's ID is unique name within containing feature.

That said if regs of the same type located in different features it's required
to insert type definition at least in each feature.

See more details in discussion here [2].

[1] https://sourceware.org/gdb/onlinedocs/gdb/Target-Description-Format.html#Types
[2] https://github.com/foss-for-synopsys-dwc-arc-processors/openocd/commit/2a5f5125ac8fa0e1359b6be03b209f9f5d1ade82#r33460077

Change-Id: Id92b061cfbf47d5c032a02c2c406b28affd0b02a
Signed-off-by: Alexey Brodkin &lt;abrodkin@synopsys.com&gt;
Reviewed-on: http://openocd.zylin.com/5179
Tested-by: jenkins
Reviewed-by: Muhammad Omair Javaid &lt;omair.javaid@linaro.org&gt;
Reviewed-by: Matthias Welwarsky &lt;matthias@welwarsky.de&gt;
</content>
</entry>
<entry>
<title>gdb_server, rtos: Fine-grained RTOS register access</title>
<updated>2019-08-28T07:07:37Z</updated>
<author>
<name>Tim Newsome</name>
<email>tim@sifive.com</email>
</author>
<published>2019-04-08T23:42:48Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/openocd/commit/?id=081954136681b26ad30db9b4cc40cb360f47602c'/>
<id>urn:sha1:081954136681b26ad30db9b4cc40cb360f47602c</id>
<content type='text'>
1. Add get_thread_reg() to rtos. It's used in rtos_get_gdb_reg() to read
the value of a single register, instead of reading all register values
by calling get_thread_reg_list().
2. Add set_reg() to rtos. gdb_server uses this to change a single
register value for a specific thread.
3. Add target_get_gdb_reg_list_noread() so it's possible for gdb to get
a list of registers without attempting to read their contents.

The clang static checker doesn't find any new problems with this change.

Change-Id: I77f792d1238cb015b91527ca8cb99593ccc8870e
Signed-off-by: Tim Newsome &lt;tim@sifive.com&gt;
Reviewed-on: http://openocd.zylin.com/5114
Tested-by: jenkins
Reviewed-by: Matthias Welwarsky &lt;matthias@welwarsky.de&gt;
</content>
</entry>
</feed>
