<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/include/linux/bug.h, branch linux-2.6.31.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-2.6.31.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-2.6.31.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2009-06-17T02:47:48Z</updated>
<entry>
<title>headers: move module_bug_finalize()/module_bug_cleanup() definitions into module.h</title>
<updated>2009-06-17T02:47:48Z</updated>
<author>
<name>Andrew Morton</name>
<email>akpm@linux-foundation.org</email>
</author>
<published>2009-06-16T22:33:37Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=0d9c25dde878a636ee9a9b53923569171bf9a55b'/>
<id>urn:sha1:0d9c25dde878a636ee9a9b53923569171bf9a55b</id>
<content type='text'>
They're in linux/bug.h at present, which causes include order tangles.  In
particular, linux/bug.h cannot be used by linux/atomic.h because,
according to Nikanth:

linux/bug.h pulls in linux/module.h =&gt; linux/spinlock.h =&gt; asm/spinlock.h
(which uses atomic_inc) =&gt; asm/atomic.h.

bug.h is a pretty low-level thing and module.h is a higher-level thing,
IMO.

Cc: Nikanth Karthikesan &lt;knikanth@novell.com&gt;
Cc: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>generic bug: use show_regs() instead of dump_stack()</title>
<updated>2007-07-16T16:05:51Z</updated>
<author>
<name>Heiko Carstens</name>
<email>heiko.carstens@de.ibm.com</email>
</author>
<published>2007-07-16T06:41:39Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=608e2619682e951f525b08e7a48669a3c0263b41'/>
<id>urn:sha1:608e2619682e951f525b08e7a48669a3c0263b41</id>
<content type='text'>
The current generic bug implementation has a call to dump_stack() in case a
WARN_ON(whatever) gets hit.  Since report_bug(), which calls dump_stack(),
gets called from an exception handler we can do better: just pass the
pt_regs structure to report_bug() and pass it to show_regs() in case of a
warning.  This will give more debug informations like register contents,
etc...  In addition this avoids some pointless lines that dump_stack()
emits, since it includes a stack backtrace of the exception handler which
is of no interest in case of a warning.  E.g.  on s390 the following lines
are currently always present in a stack backtrace if dump_stack() gets
called from report_bug():

 [&lt;000000000001517a&gt;] show_trace+0x92/0xe8)
 [&lt;0000000000015270&gt;] show_stack+0xa0/0xd0
 [&lt;00000000000152ce&gt;] dump_stack+0x2e/0x3c
 [&lt;0000000000195450&gt;] report_bug+0x98/0xf8
 [&lt;0000000000016cc8&gt;] illegal_op+0x1fc/0x21c
 [&lt;00000000000227d6&gt;] sysc_return+0x0/0x10

Acked-by: Jeremy Fitzhardinge &lt;jeremy@goop.org&gt;
Acked-by: Haavard Skinnemoen &lt;hskinnemoen@atmel.com&gt;
Cc: Andi Kleen &lt;ak@suse.de&gt;
Cc: Kyle McMartin &lt;kyle@parisc-linux.org&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Paul Mundt &lt;lethal@linux-sh.org&gt;
Cc: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
Signed-off-by: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] Generic BUG implementation</title>
<updated>2006-12-08T16:28:39Z</updated>
<author>
<name>Jeremy Fitzhardinge</name>
<email>jeremy@goop.org</email>
</author>
<published>2006-12-08T10:36:19Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=7664c5a1da4711bb6383117f51b94c8dc8f3f1cd'/>
<id>urn:sha1:7664c5a1da4711bb6383117f51b94c8dc8f3f1cd</id>
<content type='text'>
This patch adds common handling for kernel BUGs, for use by architectures as
they wish.  The code is derived from arch/powerpc.

The advantages of having common BUG handling are:
 - consistent BUG reporting across architectures
 - shared implementation of out-of-line file/line data
 - implement CONFIG_DEBUG_BUGVERBOSE consistently

This means that in inline impact of BUG is just the illegal instruction
itself, which is an improvement for i386 and x86-64.

A BUG is represented in the instruction stream as an illegal instruction,
which has file/line information associated with it.  This extra information is
stored in the __bug_table section in the ELF file.

When the kernel gets an illegal instruction, it first confirms it might
possibly be from a BUG (ie, in kernel mode, the right illegal instruction).
It then calls report_bug().  This searches __bug_table for a matching
instruction pointer, and if found, prints the corresponding file/line
information.  If report_bug() determines that it wasn't a BUG which caused the
trap, it returns BUG_TRAP_TYPE_NONE.

Some architectures (powerpc) implement WARN using the same mechanism; if the
illegal instruction was the result of a WARN, then report_bug(Q) returns
CONFIG_DEBUG_BUGVERBOSE; otherwise it returns BUG_TRAP_TYPE_BUG.

lib/bug.c keeps a list of loaded modules which can be searched for __bug_table
entries.  The architecture must call
module_bug_finalize()/module_bug_cleanup() from its corresponding
module_finalize/cleanup functions.

Unsetting CONFIG_DEBUG_BUGVERBOSE will reduce the kernel size by some amount.
At the very least, filename and line information will not be recorded for each
but, but architectures may decide to store no extra information per BUG at
all.

Unfortunately, gcc doesn't have a general way to mark an asm() as noreturn, so
architectures will generally have to include an infinite loop (or similar) in
the BUG code, so that gcc knows execution won't continue beyond that point.
gcc does have a __builtin_trap() operator which may be useful to achieve the
same effect, unfortunately it cannot be used to actually implement the BUG
itself, because there's no way to get the instruction's address for use in
generating the __bug_table entry.

[randy.dunlap@oracle.com: Handle BUG=n, GENERIC_BUG=n to prevent build errors]
[bunk@stusta.de: include/linux/bug.h must always #include &lt;linux/module.h]
Signed-off-by: Jeremy Fitzhardinge &lt;jeremy@goop.org&gt;
Cc: Andi Kleen &lt;ak@muc.de&gt;
Cc: Hugh Dickens &lt;hugh@veritas.com&gt;
Cc: Michael Ellerman &lt;michael@ellerman.id.au&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Cc: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Signed-off-by: Adrian Bunk &lt;bunk@stusta.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
</feed>
'>linux-rolling-lts</option>
<option value='linux-rolling-stable'>linux-rolling-stable</option>
<option value='master'>master</option>
</select> <input type='submit' value='switch'/></form></td></tr>
<tr><td class='sub'>Hosts the 0x221E linux distro kernel.</td><td class='sub right'>Ubuntu</td></tr></table>
<table class='tabs'><tr><td>
<a href='/distro/kernel/'>summary</a><a href='/distro/kernel/refs/?id=43fb9e113bf11d78e7c817e2696705f458753c79'>refs</a><a class='active' href='/distro/kernel/log/drivers/crypto/virtio/virtio_crypto_mgr.c?showmsg=1'>log</a><a href='/distro/kernel/tree/drivers/crypto/virtio/virtio_crypto_mgr.c?id=43fb9e113bf11d78e7c817e2696705f458753c79'>tree</a><a href='/distro/kernel/commit/drivers/crypto/virtio/virtio_crypto_mgr.c?id=43fb9e113bf11d78e7c817e2696705f458753c79'>commit</a><a href='/distro/kernel/diff/drivers/crypto/virtio/virtio_crypto_mgr.c?id=43fb9e113bf11d78e7c817e2696705f458753c79'>diff</a></td><td class='form'><form class='right' method='get' action='/distro/kernel/log/drivers/crypto/virtio/virtio_crypto_mgr.c'>
<input type='hidden' name='id' value='43fb9e113bf11d78e7c817e2696705f458753c79'/><input type='hidden' name='showmsg' value='1'/><select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='path'>path: <a href='/distro/kernel/log/?id=43fb9e113bf11d78e7c817e2696705f458753c79&amp;showmsg=1'>root</a>/<a href='/distro/kernel/log/drivers?id=43fb9e113bf11d78e7c817e2696705f458753c79&amp;showmsg=1'>drivers</a>/<a href='/distro/kernel/log/drivers/crypto?id=43fb9e113bf11d78e7c817e2696705f458753c79&amp;showmsg=1'>crypto</a>/<a href='/distro/kernel/log/drivers/crypto/virtio?id=43fb9e113bf11d78e7c817e2696705f458753c79&amp;showmsg=1'>virtio</a>/<a href='/distro/kernel/log/drivers/crypto/virtio/virtio_crypto_mgr.c?id=43fb9e113bf11d78e7c817e2696705f458753c79&amp;showmsg=1'>virtio_crypto_mgr.c</a></div><div class='content'><table class='list nowrap'><tr class='nohover'><th class='left'>Age</th><th class='left'>Commit message (<a href='/distro/kernel/log/drivers/crypto/virtio/virtio_crypto_mgr.c?id=43fb9e113bf11d78e7c817e2696705f458753c79'>Collapse</a>)</th><th class='left'>Author</th></tr>
<tr class='logheader'><td><span title='2025-06-23 17:00:27 +0800'>2025-06-23</span></td><td class='logsubject'><a href='/distro/kernel/commit/drivers/crypto/virtio/virtio_crypto_mgr.c?id=1adaaeeb90c341a7e577b11d57354b22ea307003'>crypto: virtio - Remove unused virtcrypto functions</a></td><td>Dr. David Alan Gilbert</td></tr>
<tr class='nohover-highlight'><td/><td colspan='3' class='logmsg'>
virtcrypto_devmgr_get_first() and virtcrypto_dev_in_use() were added in
2016 by
commit dbaf0624ffa5 ("crypto: add virtio-crypto driver")

but have remained unused.

Remove them.

Signed-off-by: Dr. David Alan Gilbert &lt;linux@treblig.org&gt;
Reviewed-by: Zenghui Yu &lt;yuzenghui@huawei.com&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;


</td></tr>
<tr class='logheader'><td><span title='2025-02-22 15:56:02 +0800'>2025-02-22</span></td><td class='logsubject'><a href='/distro/kernel/commit/drivers/crypto/virtio/virtio_crypto_mgr.c?id=dede7911e603d6d1952f766fb4541b988e4439c0'>crypto: virtio - Fix kernel-doc of virtcrypto_dev_stop()</a></td><td>Lukas Wunner</td></tr>
<tr class='nohover-highlight'><td/><td colspan='3' class='logmsg'>
It seems the kernel-doc of virtcrypto_dev_start() was copied verbatim to
virtcrypto_dev_stop().  Fix it.

Signed-off-by: Lukas Wunner &lt;lukas@wunner.de&gt;
Signed-off-by: Herbert Xu &lt;herbert@gondor.apana.org.au&gt;


</td></tr>
<tr class='logheader'><td><span title='2022-03-28 16:52:58 -0400'>2022-03-28</span></td><td class='logsubject'><a href='/distro/kernel/commit/drivers/crypto/virtio/virtio_crypto_mgr.c?id=ea993de113b85557ed34da8f7b4af0629550e023'>virtio-crypto: rename skcipher algs</a></td><td>zhenwei pi</td></tr>
<tr class='nohover-highlight'><td/><td colspan='3' class='logmsg'>
Suggested by Gonglei, rename virtio_crypto_algs.c to
virtio_crypto_skcipher_algs.c. Also minor changes for function name.
Thus the function of source files get clear: skcipher services in
virtio_crypto_skcipher_algs.c and akcipher services in
virtio_crypto_akcipher_algs.c.

Signed-off-by: zhenwei pi &lt;pizhenwei@bytedance.com&gt;
Link: https://lore.kernel.org/r/20220302033917.1295334-5-pizhenwei@bytedance.com
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Reviewed-by: Gonglei &lt;arei.gonglei@huawei.com&gt;


</td></tr>
<tr class='logheader'><td><span title='2022-03-28 16:52:58 -0400'>2022-03-28</span></td><td class='logsubject'><a href='/distro/kernel/commit/drivers/crypto/virtio/virtio_crypto_mgr.c?id=59ca6c93387d325e96577d8bd4c23c78c1491c11'>virtio-crypto: implement RSA algorithm</a></td><td>zhenwei pi</td></tr>
<tr class='nohover-highlight'><td/><td colspan='3' class='logmsg'>
Support rsa &amp; pkcs1pad(rsa,sha1) with priority 150.

Test with QEMU built-in backend, it works fine.
1, The self-test framework of crypto layer works fine in guest kernel
2, Test with Linux guest(with asym support), the following script
test(note that pkey_XXX is supported only in a newer version of keyutils):
  - both public key &amp; private key
  - create/close session
  - encrypt/decrypt/sign/verify basic driver operation
  - also test with kernel crypto layer(pkey add/query)

All the cases work fine.

rm -rf *.der *.pem *.pfx
modprobe pkcs8_key_parser # if CONFIG_PKCS8_PRIVATE_KEY_PARSER=m
rm -rf /tmp/data
dd if=/dev/random of=/tmp/data count=1 bs=226

openssl req -nodes -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -subj "/C=CN/ST=BJ/L=HD/O=qemu/OU=dev/CN=qemu/emailAddress=qemu@qemu.org"
openssl pkcs8 -in key.pem -topk8 -nocrypt -outform DER -out key.der
openssl x509 -in cert.pem -inform PEM -outform DER -out cert.der

PRIV_KEY_ID=`cat key.der | keyctl padd asymmetric test_priv_key @s`
echo "priv key id = "$PRIV_KEY_ID
PUB_KEY_ID=`cat cert.der | keyctl padd asymmetric test_pub_key @s`
echo "pub key id = "$PUB_KEY_ID

keyctl pkey_query $PRIV_KEY_ID 0
keyctl pkey_query $PUB_KEY_ID 0

echo "Enc with priv key..."
keyctl pkey_encrypt $PRIV_KEY_ID 0 /tmp/data enc=pkcs1 &gt;/tmp/enc.priv
echo "Dec with pub key..."
keyctl pkey_decrypt $PRIV_KEY_ID 0 /tmp/enc.priv enc=pkcs1 &gt;/tmp/dec
cmp /tmp/data /tmp/dec

echo "Sign with priv key..."
keyctl pkey_sign $PRIV_KEY_ID 0 /tmp/data enc=pkcs1 hash=sha1 &gt; /tmp/sig
echo "Verify with pub key..."
keyctl pkey_verify $PRIV_KEY_ID 0 /tmp/data /tmp/sig enc=pkcs1 hash=sha1

echo "Enc with pub key..."
keyctl pkey_encrypt $PUB_KEY_ID 0 /tmp/data enc=pkcs1 &gt;/tmp/enc.pub
echo "Dec with priv key..."
keyctl pkey_decrypt $PRIV_KEY_ID 0 /tmp/enc.pub enc=pkcs1 &gt;/tmp/dec
cmp /tmp/data /tmp/dec

echo "Verify with pub key..."
keyctl pkey_verify $PUB_KEY_ID 0 /tmp/data /tmp/sig enc=pkcs1 hash=sha1

[1 compiling warning during development]
Reported-by: kernel test robot &lt;lkp@intel.com&gt;

Co-developed-by: lei he &lt;helei.sig11@bytedance.com&gt;
Signed-off-by: lei he &lt;helei.sig11@bytedance.com&gt;
Signed-off-by: zhenwei pi &lt;pizhenwei@bytedance.com&gt;
Link: https://lore.kernel.org/r/20220302033917.1295334-4-pizhenwei@bytedance.com
Reviewed-by: Gonglei &lt;arei.gonglei@huawei.com&gt;
Signed-off-by: Nathan Chancellor &lt;nathan@kernel.org&gt; #Kconfig tweaks
Link: https://lore.kernel.org/r/20220308205309.2192502-1-nathan@kernel.org
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;


</td></tr>
